Operating systems, development tools, and professional
services for connected embedded systems
Home
Developer Resources
Technical Articles

QNX Technical Articles

 

QNX® Software Development Platform 6.4.1: Debugging Information

QNX® Software Development Platform 6.4.1: Debugging Information

Date of this edition: May 13, 2009

Starting with QNX SDP 6.4.1, we're generating binaries with debugging information (-g) and map files. With few exceptions, all binaries are available with debugging information, but this data as well as the .ident information are stripped and stored in a separate binaryName.sym file. These files are linked together, so gdb understands where to find the symbol data.

There's now no need for a separate debug version of all the binaries. There's a separate tar file containing all the .sym files that will untarred alongside each binary. This file is available in the Download area of our website, as well as in the debugging_info directory on the QNX SDP 6.4.1 DVD.

What it means to you:

These *-buildid.sym files are in CPU-specific tar files. The usage of these tar files is straightforward. Suppose you want to debug the ls command for x86. You could just add the entire set of debug files to your target (you need to be root, of course):

  1. Get the target-x86-debug-date.tgz file.
  2. cd $QNX_TARGET
  3. tar -zxf path/target-x86-debug-date.tgz

Then ntox86-gdb $QNX_TARGET/bin/ls would load the debugging symbols from the .sym file automatically. Since this is the full debugging information, you can point gdb at the location of source for ls.

You don't have to extract the entire tar file. In fact all that matters is that the .sym file be in the same directory as the binary. So you could simply copy $QNX_TARGET/x86/bin/ls and the x86/bin/ls-*.sym file (from the debug tar file) to your current directory, and then run gdb there.

In order to get a list of the source files used to build a binary (e.g. to determine the associated licensing), use the .sym file instead of the binary. So continuing with the example above, to get a list of the source files used in building ls, type:

use -s $QNX_TARGET/x86/bin/ls-*.sym
 
©2013 QNX Software Systems Limited, a subsidiary of BlackBerry.   BlackBerry Logo