Dustin Davis wrote:

Can anyone provide me with the GCC debugger in action. I'm still confused as to how it is supposed to work...

It's usually used in conjunction with POSE. You start it with a command like this:

m68k-palmos-gdb progname

where "progname" is the file name for your application (before a .prc file is built out of it). You'll get a "(gdb)" prompt. At this prompt, enter:

target palmos localhost:2000

which tells GDB to enter remote debugging mode and wait for a response from the remote, in this case POSE. When you install the .prc file in POSE and fire up the application, it should halt at a blank screen, and you should see output from GDB similar to this:

Program received signal SIGSTOP, Stopped (signal).
PilotMain (cmd=0, cmdPBP=0x0, launchFlags=142) at chesscli.c:745
745 if (cmd == sysAppLaunchCmdNormalLaunch) {
(gdb)

The output will of course be different, unless you happen to be debugging the same chess program I'm working on. :-) But you should recognize the name of your main source file, and the first line of code within PilotMain in that file.

The actual use of GDB from this point is probably better covered by the GDB manual itself. But here are some quick starting points: "b" lets you set breakpoints (e.g. "b FunctionName" to break at FunctionName, or "b filename.c:23" to break at line 23 in filename.c). "c" continues the program until it hits a breakpoint or until you interrupt it (Ctrl-C). "p" lets you print out the contents of a variable (must be within scope; e.g. "p x" to show the variable x); "disp" works similarly but keeps printing out the variable after each command you give. "s" steps through the program one line at a time, stepping into function calls as it goes; "n" works similarly but does not step into function calls. "bt" displays a backtrace of the stack.

Hope this helps.

--Larry


--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/


Reply via email to