Debugging in SEC and PEI Phases

There are several ways to load symbols for debugging UEFI modules on the flash. Before you start to debug, make sure the debugger settings match the module you want to debug and that you the symbols and sources are available.

See UEFI Debug Mode Configuration and Using the UEFI Scripted Buttons for more information.

Loading Symbols for the Current Module

Use the LoadThis button or the command EFI "LOADTHIS" to load symbols for the current module.

If the debugger does not find the current module header, you may need to adjust the search range using the command EFI "SETMEMORYSEARCHSIZE"

Loading Symbols for PEI Modules in Flash

Boot your target up to the PEI or DXE phase and use the button LoadPEIMs to automatically scan flash memory and look for the signature of the firmware volume and load the found PEI module.

By default, the LoadPEIMs script will assume a common address range of 0xFFC00000 to 0xFFFF8000 for flash memory. If the range for flash memory is different on the target system, please edit the file <install-dir>/<debugger-dir>/system_debug/scripts/constants.xdb and modify the variables "FVBASE" and "FVLIMIT" to reflect the correct values.

Any HW breakpoints set on modules will be enabled for modules executed from flash. Breakpoints set on flash will not be hit after PEI core shadowing and when modules executed from memory.

Loading Symbols for SEC Modules

The debugger can load the UEFI BIOS flash module symbols using the map file produced by the build. Use the command EFI "LOADFROMMAP map_file" to load symbols for all flash modules or EFI "LOADFROMMAPmap_filemodule_name" to load symbols for a selected module.

Any HW breakpoints set on modules will be enabled for modules executed from flash. Breakpoints set on flash will not be hit after PEI core shadowing and when modules executed from memory.

Note

The location of the modules in shadowed memory might change after reset when the target's HW configuration change. In this case, reloading the symbols is needed.

To use any of this commands the target needs to be connected and stopped.

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