Source-Level Debugging with GNU PalmPilot SDK
The GNU tools can’t debug an application running on the handheld. You only have POSE available to you. To debug:
Compile and link your application with the
-g
flag.Run POSE and load your application.
Run an intermediary application called gdbplug , which communicates via TCP/IP to GDB. It communicates with POSE using a POSE debugging protocol. See http://www.tiac.net/users/thomas/pilot-gdbplug.html for documentation and the latest version.
In a separate DOS window, run:
gdbplug -port 2000 -enable
Run GDB. Pass as a command-line argument your linked file, not the PRC (if your application is foo, pass foo as the parameter, not foo.prc):
m68k-palmos-coff-gdb your_linked_app
Within GDB, specify the PalmPilot as a target by executing:
target pilot localhost:2000
Within POSE, start your application. GDB stops at the first line.
Here are the most important commands that GDB supports:
- print expressionToPrint1, ..., expressionToPrintN
Use the print command to look at the values of variables. Here’s an example:
print *myStructPtr, theString[5], myOtherStruct.x
- backtrace
Prints a stack crawl, showing each function in the stack, including parameter names and values.
- step
Single-steps, stepping into functions.
- next
Single-steps, stepping over functions.
- cont
Continues running the program until it reaches a breakpoint, causes an error, or exits.
- break funcNameOrLineNumber
Sets a breakpoint. You can break at a function:
break MyFunction
Or you can set a breakpoint ...
Get Palm Programming: The Developer's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.