> On Nov 11, 2014, at 10:36 AM, Olivier Martin <olivier.mar...@arm.com> wrote:
>
> FYI, the symbols are always stripped out from the ARM EFI binaries. The
> symbol you see are the DWARF debug symbols not the PDB.
> It means with the DEBUG and RELEASE the ELF binaries used to generate the
> EFI binaries contain the debug information.
> But there is no debug information on the target.
>
Xcode and VC++ basically work the same way. The PE/COFF image contains a debug
directory entry. This entry contains info about where to find the symbols.
For the VC++ builds the entry will contain the file path to the PDB file. For
Xcode we usually just put the name of the Mach-O or nothing as we can lookup
the symbols via the UUID.
Thus the debugger scripts that load symbols will usually figure out where the
PE/COFF image got loaded in memory. Read the header, find the debug directory
(if it exists) and load symbols based on this info.
Thanks,
Andrew Fish
https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdePkg/Include/IndustryStandard/PeImage.h
///
/// Debug Directory Format.
///
typedef struct {
UINT32 Characteristics;
UINT32 TimeDateStamp;
UINT16 MajorVersion;
UINT16 MinorVersion;
UINT32 Type;
UINT32 SizeOfData;
UINT32 RVA; ///< The address of the debug data when loaded,
relative to the image base.
UINT32 FileOffset; ///< The file pointer to the debug data.
} EFI_IMAGE_DEBUG_DIRECTORY_ENTRY;
#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2 ///< The Visual C++ debug
information.
///
/// Debug Data Structure defined in Microsoft C++.
///
#define CODEVIEW_SIGNATURE_NB10 SIGNATURE_32('N', 'B', '1', '0')
typedef struct {
UINT32 Signature; ///< "NB10"
UINT32 Unknown;
UINT32 Unknown2;
UINT32 Unknown3;
//
// Filename of .PDB goes here
//
} EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY;
///
/// Debug Data Structure defined in Microsoft C++.
///
#define CODEVIEW_SIGNATURE_RSDS SIGNATURE_32('R', 'S', 'D', 'S')
typedef struct {
UINT32 Signature; ///< "RSDS".
UINT32 Unknown;
UINT32 Unknown2;
UINT32 Unknown3;
UINT32 Unknown4;
UINT32 Unknown5;
//
// Filename of .PDB goes here
//
} EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY;
///
/// Debug Data Structure defined by Apple Mach-O to Coff utility.
///
#define CODEVIEW_SIGNATURE_MTOC SIGNATURE_32('M', 'T', 'O', 'C')
typedef struct {
UINT32 Signature; ///< "MTOC".
GUID MachOUuid;
//
// Filename of .DLL (Mach-O with debug info) goes here
//
} EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY;
>> -----Original Message-----
>> From: Scott Duplichan [mailto:sc...@notabs.org]
>> Sent: 11 November 2014 16:57
>> To: edk2-devel@lists.sourceforge.net; 'Jordan Justen'
>> Subject: Re: [edk2] patch: enable NOOPT build target for each EDK2
>> package
>>
>> Laszlo Ersek [mailto:ler...@redhat.com] wrote:
>>
>> ]On 11/11/14 03:23, Scott Duplichan wrote:
>> ]> Jordan Justen [mailto:jordan.l.jus...@intel.com] wrote:
>> ]>
>> ]> ]To contradict my request for separate patches for each package, I
>> do
>> ]> ]think this is a case where a single patch makes more sense even
>> though
>> ]> ]it touches multiple packages.
>> ]> ]
>> ]> ]I don't really find the NOOPT target very interesting. I think we
>> ]> ]don't actually gain much with NOOPT since it can't often be used on
>> ]> ]firmware images.
>> ]>
>> ]> The NOOPT build is almost a necessity for source level debugging
>> ]> a Microsoft build. With it, local variables are visible and accurate
>> ]> for every single step. With an optimized build, some locals are
>> ]> eliminated entirely and others are kept in registers, something the
>> ]> Microsoft debug information doesn't track.
>> ]>
>> ]> During the transition from legacy BIOS to UEFI, the projects I
>> worked
>> ]> on were limited to 1MB flash, the max size for LPC chips used on
>> ]> reference boards at the time. We had to make do with enabling debug
>> ]> info for the optimized build during that period. Servers are less
>> ]> likely to have a flash space limitation that prevents NOOPT build
>> ]> use. The last server project I worked on used a 16MB flash chip.
>> ]> Don't today's desktop boards have 4-8 MB of flash? That should
>> ]> hold a NOOPT build.
>> ]
>> ]What's wrong with simply using DEBUG then?
>>
>> The problem with the using EDK2 defined DEBUG build, at least with
>> Microsoft tools, is that DEBUG build is fully optimized. That means
>> a debugger can't reliably display local variables. The EDK2 DEBUG
>> build (Microsoft case), is just a release build with debug symbols
>> added.
>>
>> I see that GCCxx_ARM is setup a little differently. In tools_def
>> GCCxx_ARM defines DEBUG and RELEASE builds. The DEBUG build
>> disables optimization.
>>
>> MSFT tools GCC-ARM
>> OPTIMIZED SYMBOLS OPTIMIZED SYMBOLS
>> DEBUG yes yes no yes
>> RELEASE yes no yes yes
>> NOOPT no yes n/a n/a
>>
>> Thanks,
>> Scott
>>
>> ]Thanks
>> ]Laszlo
>>
>> -----------------------------------------------------------------------
>> -------
>> Comprehensive Server Monitoring with Site24x7.
>> Monitor 10 servers for $9/Month.
>> Get alerted through email, SMS, voice calls or mobile push
>> notifications.
>> Take corrective actions from your mobile device.
>> http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.c
>> lktrk
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>>
>>
>> -----------------------------------------------------------------------
>> -------
>> Comprehensive Server Monitoring with Site24x7.
>> Monitor 10 servers for $9/Month.
>> Get alerted through email, SMS, voice calls or mobile push
>> notifications.
>> Take corrective actions from your mobile device.
>> http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.c
>> lktrk
>> _______________________________________________
>> edk2-devel mailing list
>> edk2-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>
>
>
>
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
> http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel