5.1 Building an application with debugging enabled
As on any other platform, you instruct GCC to produce debugging information
by compiling with the `-g' option.
Some debuggers targeting Palm OS, notably GDB, also need your application
to have a special stub (called StartDebug) in its startup code so
that they can attach to the running application successfully.
To include this stub, you also need to link with `-g'.
By default, the stub is disabled and your application runs normally.
When the stub sees that a gdbS #0 feature exists and has the value
0x12BEEF34, it is enabled and will converse with the debugger, telling it
where in memory to find the application.
There are two convenient ways to set this feature and enable the stub:
The Palm OS Emulator (version 2.1d22 or greater) sets the feature
automatically whenever there is a debugger connected to its debugger port.
Thus there is no need to do anything yourself to enable debugging on Poser.
Gdb Panel, in the
prc-tools samples,
is a small Palm OS application which sets this feature. You need to use it
or something similar when debugging on a real device.
This document was generated
by root on January, 30 2002
using texi2html