05.06.2014 Views

QNX Neutrino Programmer's Guide [6.5.0 SP1] - QNX Software ...

QNX Neutrino Programmer's Guide [6.5.0 SP1] - QNX Software ...

QNX Neutrino Programmer's Guide [6.5.0 SP1] - QNX Software ...

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.

© 2012, <strong>QNX</strong> <strong>Software</strong> Systems Limited Debugging<br />

Debugging in a cross-development environment<br />

The debugger can run on one platform to debug executables on another:<br />

Communications<br />

channel<br />

Debugger<br />

Debug<br />

agent<br />

Executable<br />

Debugging in a cross-development environment.<br />

In a cross-development environment, the host and the target systems must be<br />

connected via some form of communications channel.<br />

The two components, the debugger and the debug agent, perform different functions.<br />

The debugger is responsible for presenting a user interface and for communicating<br />

over some communications channel to the debug agent. The debug agent is<br />

responsible for controlling (via the /proc filesystem) the process being debugged.<br />

All debug information and source remains on the host system. This combination of a<br />

small target agent and a full-featured host debugger allows for full symbolic<br />

debugging, even in the memory-constrained environments of small targets.<br />

In order to debug your programs with full source using the symbolic debugger, you’ll<br />

need to tell the C compiler and linker to include symbolic information in the object<br />

and executable files. For details, see the qcc docs in the Utilities Reference. Without<br />

this symbolic information, the debugger can provide only assembly-language-level<br />

debugging.<br />

The GNU debugger (gdb)<br />

Starting gdb<br />

The GNU debugger is a command-line program that provides a very rich set of<br />

options. You’ll find a tutorial-style doc called “Using GDB” as an appendix in this<br />

manual.<br />

You can invoke gdb by using the following variants, which correspond to your target<br />

platform:<br />

June 14, 2012 Chapter 1 • Compiling and Debugging 23

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

Saved successfully!

Ooh no, something went wrong!