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.web10.8647.1604029210045876017 for ; Thu, 29 Oct 2020 20:40:10 -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 ; Fri, 30 Oct 2020 11:39:59 +0800 X-WM-Sender: fengyunhua@byosoft.com.cn From: "fengyunhua" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen Subject: [PATCH v2 1/2] BaseTools: Add image type into generate map file Date: Fri, 30 Oct 2020 11:39:38 +0800 Message-Id: <20201030033939.2094-2-fengyunhua@byosoft.com.cn> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20201030033939.2094-1-fengyunhua@byosoft.com.cn> References: <20201030033939.2094-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