From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web09.4363.1603862033032677669 for ; Tue, 27 Oct 2020 22:13:54 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: fengyunhua@byosoft.com.cn) Received: from localhost.localdomain ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Wed, 28 Oct 2020 13:13:43 +0800 X-WM-Sender: fengyunhua@byosoft.com.cn From: "fengyunhua" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen Subject: [PATCH 1/2] BaseTools: Add image type into generate map file Date: Wed, 28 Oct 2020 13:13:17 +0800 Message-Id: <20201028051318.1075-2-fengyunhua@byosoft.com.cn> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20201028051318.1075-1-fengyunhua@byosoft.com.cn> References: <20201028051318.1075-1-fengyunhua@byosoft.com.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2977 For a source-level BIOS debugger the .map files are quite useful with one major shortcoming: the debugger cannot know, solely from the .map file, the format (PE/COFF vs. TE) of the image included in the final BIOS ROM Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Yunhua Feng --- BaseTools/Source/C/GenFv/GenFvInternalLib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c b/BaseTools/Source/C/GenFv/GenFvInternalLib.c index b5ffed93a9..6e296b8ad6 100644 --- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c +++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c @@ -903,7 +903,12 @@ Returns: fprintf (FvMapFile, "BaseAddress=0x%010llx, ", (unsigned long long) (ImageBaseAddress + Offset)); } - fprintf (FvMapFile, "EntryPoint=0x%010llx", (unsigned long long) (ImageBaseAddress + AddressOfEntryPoint)); + fprintf (FvMapFile, "EntryPoint=0x%010llx, ", (unsigned long long) (ImageBaseAddress + AddressOfEntryPoint)); + if (!pImageContext->IsTeImage) { + fprintf (FvMapFile, "Type=PE"); + } else { + fprintf (FvMapFile, "Type=TE"); + } fprintf (FvMapFile, ")\n"); fprintf (FvMapFile, "(GUID=%s", FileGuidName); -- 2.27.0.windows.1