Andrew,
I found EmulatorPkg is using <Module>.dll as the debug symbol by sourcing 
Build/Emulator/DEBUG_GCC46/X64/Host.gdb as the GDB script. Actually 
<Module>.debug should be used. Because Conf/build_rule.txt strips the debug 
information out of the <ModuleName>.dll and creates a separate debug symbol 
file <Module>.debug to store all the .debug_xxx sections.

So I think we may need to change the EmulatorPkg/Unix/Host/Host.c to generate 
the correct Host.gdb by using <Module>.debug.

Another issue I observed only happens in Fedora. Even I changed Host.c to use 
<Module>.debug as the symbol file. I still find the output of GDB "bt" command 
cannot display the parameter value correctly. The output of GDB looks like this:
...
#17 0x0000000044f616a8 in PlatformBdsEnterFrontPage (TimeoutDefault=can't 
compute CFA for this frame)
At /home/ray/work/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c:1117
#18 0x0000000043d786da in PlatformBdsPolicyBehavior (DriverOptionList=can't 
compute CFA for this frame)
At 
/home/ray/work/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BdsPlatform.c:413
...

I found it's due to the missing of .eh_frame section which is removed by ld 
because of the --gc-sections flag. If I remove the --gc-sections flag and 
modify the Conf/build_rule.txt to keep .eh_frame section, the issue was gone.
<Command.GCC>
  $(OBJCOPY) -only-keep-debug $(src) $(DEBUG_DIR)(+)$(MODULE_NAME).debug
  $(OBJCOPY) --strip-unneeded $(src)
to
<Command.GCC>
  $(CP) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug
  $(OBJCOPY) --strip-unneeded $(src)

But I don't think what the root cause is. Do you have any suggestion on this?

Regards,
Ray

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to