Identifying and Loading Symbols for a Module at a Certain Address

To load symbols for a specific address, use the EFI "LOADTHIS" command. This command identifies the module at the indicated address and loads symbols for it. If no address is provided, the current instruction pointer is used.

Note that this method is not really EFI-specific, it will detect any PE/COFF image in target memory, and it is only dependent on the debug information compiled into the PE/COFF header, not on any other EFI data structures.

Example 1

Using instruction pointer as the search address:

xdb> efi "loadthis"
INFO: Software debugger set to: efi64 - EFI/PI compliant BIOS (64-bit mode)
INFO: Using DRAM search semantics, align=0x00001000 range=0x00100000
INFO: Searching backwards from 0x00000000809FB6C3 to 0x00000000808FB6C3 for PE/COFF header
INFO: Found PE/COFF module at 0x00000000809FB000 - 0x00000000809FF1C0 (size: 16832 bytes)
INFO: Loading debug symbols found at: 
e:\dev.efi\work\Build\MdeModule\NOOPT_VS2008x86\X64\MdeModulePkg\Application\xdbefiutil\xdbefiutil\DEBUG\xdbefiutil.efi

Example 2

Specifying a known address:

xdb> efi "loadthis 0xFFF98765"
INFO: Software debugger set to: efi32 - EFI/PI compliant BIOS (32-bit mode)
INFO: Using FLASH search semantics, align=0x00000004 range=0x00100000
INFO: Searching backwards from 0x00000000FFF98765 to 0x00000000FFE98765 for PE/COFF header
INFO: Found PE/COFF module at 0x00000000FFF97B04 - 0x00000000FFFA1A64 Entrypoint: 0x00000000FFF99E89 (size: 40800 bytes)

Note

Depending on the searched object (for example RAM or flash modules), the debugger uses different search semantics. These can be configured, enter the command EFI "SHOWCONFIG" for more information.

For more complete information about compiler optimizations, see our Optimization Notice.