Daryl Huff <[EMAIL PROTECTED]> wrote: > > I'm trying to debug my first Palm app using the PRC tools and I can't > get gdb (m68k-palmos-gdb) to connect to the Palm OS 5 Simulator to debug > my app. I carefully followed the instructions at > http://prc-tools.sourceforge.net/install/cygwin.html to install > everything onto my Win XP system. I have the SDK and PilRC on my system > and I can compile and run my app fine in the Simulator. I did build and > link with the -g flag set. > > However, when I go to connect the debugger to the simulator. I > > -start the simulator, > -double check the debugging port is set to "localhost:2000", > -load my app (Hello2 from PalmOS Programming Bible), > -start GDB with the name of the app "m68k-palmos-gdb hello2" > -type in "target pilot localhost:2000" > > and all the cygwin window does is print the following: > > Remote debugging under PalmOS using localhost:2000 > Waiting... (Press Ctrl-C to connect to halted machine) > > I run my app in the simulator and the gdb window never seems to connect. > If I close the simulator window the cygwin window immediatly reports: > > Couldn't establish connection to remote target > Remote communication error: Connection reset by peer. > > So I know it must have known about the Simulator window. > > I must be doing something basic incorrectly but for the life of me I > can't figure out what. Please help. >
You also need the gdbpanel.prc installed on the simulator. Since you get the message: Remote debugging under PalmOS using localhost:2000 Waiting... (Press Ctrl-C to connect to halted machine) it means the TCP connection between POSE and the simulator has been established. gdbpanel can be found in the prc-tools-samples collection. See http://sourceforge.net/project/showfiles.php?group_id=4429. Before starting your app on the simulator, first launch gdbpanel, enable the gdbstub, return to the launcher and then launch the app you want to debug. What happens is that gdbpanel sets the 'gdbS' feature. The gdb startup code (when linked with -g) looks for this feature. If it is present it will break at PilotMain, if not the app will run normally. POSE sets this feature automatically, so you do not need gdbpanel when debugging with POSE. When you want to debug on a real device you will also need gdbpanel. See also http://www.falch.net/Articles?art=338 which addresses the same issue, but for running the sim and gdb together with the Falch IDE. Look at the last part of the article about gdbpanel. Ton van Overbeek -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
