public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Marvin Häuser" <mhaeuser@posteo.de>
To: devel@edk2.groups.io
Cc: Leif Lindholm <leif@nuviainc.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Vitaly Cheptsov <vit9696@protonmail.com>
Subject: [PATCH 3/3] ArmPkg: Use Image base address for RVCT symbols loading
Date: Sat, 21 Aug 2021 19:55:50 +0000	[thread overview]
Message-ID: <fc7b6713ec8772622eeb3f579914f5f15a86e1ee.1629574351.git.mhaeuser@posteo.de> (raw)
In-Reply-To: <cover.1629574351.git.mhaeuser@posteo.de>

The initial import of the RVCT debug code used 0 for the address of
the first Image section [1]. This commit has been made in 2010, when
"--ro-base 0" was still passed as a build argument [2]. In 2015, this
was changed to mirror the PE/COFF memory layout the same way that ELF
does [3]. Update the corresponding debug code to no longer manually
account for the PE/COFF header offset.

[1] https://github.com/mhaeuser/edk2/commit/62e797a489341b13a095b3cd7c0f7bd9eac12efe
[2] https://github.com/mhaeuser/edk2/blob/62e797a489341b13a095b3cd7c0f7bd9eac12efe/BaseTools/Conf/tools_def.template#L2299-L2300
[3] https://github.com/tianocore/edk2/commit/b12ef6b964f8fc0532432ebffd67748648487133

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
---
 ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.c | 2 +-
 ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.c b/ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.c
index 2ca42c19c03f..f65463be96b0 100644
--- a/ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.c
+++ b/ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.c
@@ -81,7 +81,7 @@ PeCoffLoaderRelocateImageExtraAction (
 #ifdef __CC_ARM
 #if (__ARMCC_VERSION < 500000)
     // Print out the command for the RVD debugger to load symbols for this image
-    DEBUG ((EFI_D_LOAD | EFI_D_INFO, "load /a /ni /np %a &0x%p\n", DeCygwinPathIfNeeded (ImageContext->PdbPointer, Temp, sizeof (Temp)), (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders)));
+    DEBUG ((EFI_D_LOAD | EFI_D_INFO, "load /a /ni /np %a &0x%p\n", DeCygwinPathIfNeeded (ImageContext->PdbPointer, Temp, sizeof (Temp)), (UINTN)ImageContext->ImageAddress));
 #else
     // Print out the command for the DS-5 to load symbols for this image
     DEBUG ((EFI_D_LOAD | EFI_D_INFO, "add-symbol-file %a -o 0x%p\n", DeCygwinPathIfNeeded (ImageContext->PdbPointer, Temp, sizeof (Temp)), (UINTN)ImageContext->ImageAddress));
diff --git a/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c b/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c
index 0b78554f6347..0a5e8db294ea 100644
--- a/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c
+++ b/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c
@@ -114,7 +114,7 @@ PeCoffLoaderRelocateImageExtraAction (
   CHAR8 Buffer[256];
 
 #if (__ARMCC_VERSION < 500000)
-  AsciiSPrint (Buffer, sizeof(Buffer), "load /a /ni /np \"%a\" &0x%08x\n", ImageContext->PdbPointer, (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders));
+  AsciiSPrint (Buffer, sizeof(Buffer), "load /a /ni /np \"%a\" &0x%08x\n", ImageContext->PdbPointer, (UINTN)ImageContext->ImageAddress);
 #else
   AsciiSPrint (Buffer, sizeof(Buffer), "add-symbol-file %a -o 0x%08x\n", ImageContext->PdbPointer, (UINTN)ImageContext->ImageAddress);
 #endif
-- 
2.31.1


      parent reply	other threads:[~2021-08-21 19:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-21 19:55 [PATCH 0/3] Update GDB and RVCT symbols loading to use the Image base address Marvin Häuser
2021-08-21 19:55 ` [PATCH 1/3] EmulatorPkg: Use Image base address for GDB symbols loading Marvin Häuser
2021-08-21 19:55 ` [PATCH 1/1] MdeModulePkg: Move PiSmmCoreMemoryAllocationLib into PiSmmCore Marvin Häuser
2021-09-01  4:21   ` Ni, Ray
2021-09-01  7:17     ` Marvin Häuser
2021-09-02 10:53       ` Ni, Ray
2021-09-02 13:22         ` [edk2-devel] " Marvin Häuser
2021-09-03  1:29           ` 回复: " gaoliming
2021-08-21 19:55 ` [PATCH 1/5] MdeModulePkg/PeiCore: Align fixed-address error behaviour Marvin Häuser
2021-08-21 19:55   ` [PATCH 2/5] MdeModulePkg/DxeCore: " Marvin Häuser
2021-08-21 19:55   ` [PATCH 3/5] MdeModulePkg/DxeCore: Check for fixed-address Image relocations Marvin Häuser
2021-08-21 19:55   ` [PATCH 4/5] MdeModulePkg/PiSmmIpl: Disallow stripped " Marvin Häuser
2021-08-21 19:55   ` [PATCH 5/5] MdeModulePkg/PiSmmCore: " Marvin Häuser
2021-08-21 20:10   ` [edk2-devel] [PATCH 1/5] MdeModulePkg/PeiCore: Align fixed-address error behaviour Marvin Häuser
2021-08-22  9:28     ` Marvin Häuser
2021-08-21 19:55 ` [PATCH 2/3] ArmPkg: Use Image base address for GDB symbols loading Marvin Häuser
2021-08-21 19:55 ` Marvin Häuser [this message]

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-list 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=fc7b6713ec8772622eeb3f579914f5f15a86e1ee.1629574351.git.mhaeuser@posteo.de \
    --to=devel@edk2.groups.io \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox