10.01.2015 Views

Intel(r) UEFI Development Kit Debugger Tool User Manual

Intel(r) UEFI Development Kit Debugger Tool User Manual

Intel(r) UEFI Development Kit Debugger Tool User Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7.4.3 End the GDB debug session<br />

To end a GDB debug session, follow these steps:<br />

1. Halt the TARGET if the TARGET is running<br />

2. In GDB, enter the quit command to end the debugging session.<br />

(gdb) quit<br />

A debugging session is active.<br />

Inferior 1 [Remote target] will be detached.<br />

Quit anyway (y or n) y<br />

qTStatus: Remote connection closed<br />

user@user-Ubuntu11-64:~$<br />

Figure 7-5—Detach in GDB<br />

Note: Closing GDB without running the “quit” command leaves<br />

the TARGET firmware in an intermediate state and it cannot<br />

be reattached until restarted.<br />

7.5 Basic GDB debugging operations<br />

The <strong>Intel</strong> UDK <strong>Debugger</strong> <strong>Tool</strong> supports GDB operations for Linux platforms, including<br />

these critical operations:<br />

Embed a breakpoint in the source code. Adding the CpuBreakpoint() statement to<br />

the source code allows the GDB to enter interactive mode when the target executes<br />

the line.<br />

Add a function breakpoint in a debug session. As long as a module’s symbol file<br />

is loaded, use of the break command to set a breakpoint for a function within the<br />

module is permissible. Command syntax for the break command is:<br />

break <br />

In the following example, a breakpoint is added to the IoBitFieldRead16 function:<br />

foo@foo:~$ break IoBitFieldRead16<br />

7.5.1 GDB extension commands<br />

<strong>Intel</strong> provides several extension commands for GDB on Linux platforms. The following<br />

extension commands add functionality to GDB to support debugging of the target firmware.<br />

Once the commands are loaded, the commands become part of GDB.<br />

Note: Remember that compiler optimization is typically enabled by default. To see more<br />

debug information in the output file, disable compiler optimization for the module<br />

being debugged.<br />

40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!