[kvm-unit-tests PATCH 5/6] efi: Print address of image

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Nadav Amit <namit@xxxxxxxxxx>

Using gdb to debug tests that are run from efi is very hard without
knowing the base address in which the image was loaded. Print the
address so it can be used while debugging.

Signed-off-by: Nadav Amit <namit@xxxxxxxxxx>
---
 lib/efi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/efi.c b/lib/efi.c
index 2e127a4..f42edd4 100644
--- a/lib/efi.c
+++ b/lib/efi.c
@@ -18,6 +18,7 @@
 extern int __argc, __envc;
 extern char *__argv[100];
 extern char *__environ[200];
+extern char _text;
 
 extern int main(int argc, char **argv, char **envp);
 
@@ -363,6 +364,8 @@ efi_status_t efi_main(efi_handle_t handle, efi_system_table_t *sys_tab)
 		goto efi_main_error;
 	}
 
+	printf("Address of image is: 0x%lx\n", (unsigned long)&_text);
+
 	/* Run the test case */
 	ret = main(__argc, __argv, __environ);
 
-- 
2.34.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux