All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nadav Amit <nadav.amit@gmail.com>
To: Andrew Jones <andrew.jones@linux.dev>
Cc: kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu,
	kvm@vger.kernel.org, Nikos Nikoleris <nikos.nikoleris@arm.com>,
	Nadav Amit <namit@vmware.com>
Subject: [kvm-unit-tests PATCH 5/6] efi: Print address of image
Date: Sat, 17 Jun 2023 01:49:29 +0000	[thread overview]
Message-ID: <20230617014930.2070-6-namit@vmware.com> (raw)
In-Reply-To: <20230617014930.2070-1-namit@vmware.com>

From: Nadav Amit <namit@vmware.com>

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@vmware.com>
---
 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


  parent reply	other threads:[~2023-06-17  1:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-17  1:49 [kvm-unit-tests PATCH 0/6] arm64: improve debuggability Nadav Amit
2023-06-17  1:49 ` [kvm-unit-tests PATCH 1/6] arm: keep efi debug information in a separate file Nadav Amit
2023-06-24 10:12   ` Andrew Jones
2023-06-24 10:31   ` Andrew Jones
2023-06-25 19:21     ` Nadav Amit
2023-06-17  1:49 ` [kvm-unit-tests PATCH 2/6] lib/stack: print base addresses on efi Nadav Amit
2023-06-24 10:13   ` Andrew Jones
2023-06-25 19:23     ` Nadav Amit
2023-06-17  1:49 ` [kvm-unit-tests PATCH 3/6] arm64: enable frame pointer and support stack unwinding Nadav Amit
2023-06-24 10:13   ` Andrew Jones
2023-06-25 19:22     ` Nadav Amit
2023-06-26  5:42       ` Andrew Jones
2023-06-17  1:49 ` [kvm-unit-tests PATCH 4/6] arm64: stack: update trace stack on exception Nadav Amit
2023-06-24 10:18   ` Andrew Jones
2023-06-17  1:49 ` Nadav Amit [this message]
2023-06-17  1:49 ` [kvm-unit-tests PATCH 6/6] arm64: dump stack on bad exception Nadav Amit
2023-06-17  1:52   ` Nadav Amit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230617014930.2070-6-namit@vmware.com \
    --to=nadav.amit@gmail.com \
    --cc=andrew.jones@linux.dev \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=kvmarm@lists.linux.dev \
    --cc=namit@vmware.com \
    --cc=nikos.nikoleris@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.