Debugging in the DXE Phase

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 all DXE Modules

Use the button LoadDXEModules with target booted at the end of DXE phase, for example to the UEFI shell or idle loop. This action inserts a short piece of assembly code into the target system, by default at address 0x100000. This code will search the target DRAM for the signature of the UEFI system table and restore the original memory contents afterwards. If memory access to this address may crash your target, refer to "Target crashes while using LoadDXEModules Button" in section UEFI Debugging Troubleshooting.

Once a valid system table is located, enter EFI SHOWDXEMODULES to display a list of all found EFI modules.

One of the most common error cases is to invoke the UEFI commands while the target CPU is in the HALT state. Most commonly, this is the case when the target is executing the HLT opcode or any other similar instruction. The script will usually detect this case and will show a dialog box offering to attempt to work around it, but this might not work in all cases. Refer to "Execution Stopped by HLT Instruction" section in UEFI Debugging Troubleshooting for details.

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.

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