Hi again. I just realized something that might help figuring out the problem.
When I'm trying to debug a simple program (like this<http://www.codeproject.com/ce/PalmOS_I.asp>hello world sample), I hit "Enable stub" in gdbpanel, execute the program, and it breaks at a function called StartDebug(), which I assume is the debug stub. When I try to debug my own program, I can't do it like that, because when I launch my program, it doesn't break at StartDebug(), but just crashes. I have to hit "Debug" in gdbpanel, set a breakpoint at PilotMain in GDB, continue execution and then launch my application (like I mentioned in the previous post). It then breaks at the error. This difference of debugging methods might indicate the problem: Maybe the debug stub isn't included in my application, even though I compiled AND linked with the -g flag? Maybe the crash occurs before entering the debug stub at StartDebug(), which explains why I can't just hit "Enable stub"? But if so, how come the program breaks when I set a breakpoint at PilotMain()? Isn't StartDebug() located before PilotMain()? I'm completely stumped on this one. Jonathan P.S. I tried debugging this on a Garmin iQue 3000, but tcpusb failed to connect to the debugged device with the following message: $ ./tcpusb.exe Tcpusb - A bridge between Palm OS USB devices and m68k-palmos-gdb Version: 0.2 2005-05-29 Options chosen: debuglevel = 0 log = <None> verbose = 0 port = 2000 Waiting ... putpkt_to: usb_bulk_write failed On 9/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello all. > > (Before I begin may I remark to the admins that I searched for " > Emuk68KMain.c" and no results came up, even though I saw a message with > that topic.) > > I am trying to set up a development environment for a project that was > written with Palm OS SDK 3.5, using PRC-Tools. > I'm going completely open-source, and using SlickEdit to edit my code (if > you don't know it - it's highly recommended). > > I worked pretty hard for the last two days trying to compile, link, and > set up debugging using GDB (I must say that PRC-Tools's documentation is > pretty good). > > Here are the steps I took before getting the error in the subject: > 1) I compiled my resource file (.rcp) using pilrc > 2) I compiled all my code files (.c) using m68k-palmos-gcc > 3) I generated the sections file (.s) using multigen > 4) I compiled the sections file (.s) using m68k-palmos-gcc > 5) I linked all my object files (.o) and the sections ld file (.ld) with > m68k-palmos-gcc, and got a final object file. > 6) I built the prc using build-prc > > All is good, everything compiled neatly (I had to remove some code parts > that used a Handspring SDK that I didn't have, but no matter). > > I uploaded the prc to the device, executed and - crash. I get the message > in the subject. > The address of the illegal instruction seems to be OK - it's not like it's > "0000001" or something, that might indicate a memory corruption. > > So, after uploading gdbpanel.prc (enables debugging on the device side) to > the device, I fire up tcpusb.exe (used as a bridge between the GDB > debugger and the device) and m68k-palmos-gdb (the debugger itself). > > I hit "Debug" on the device's gdbpanel, and the device connected to > tcpusb.exe. > Then I connect GDB to tcpusb.exe using the command "target palmos": > > (gdb) target palmos > Remote debugging under PalmOS using localhost:2000 > Waiting... (Press Ctrl-C to connect to halted machine) > > Then I set a breakpoint in GDB using the "break" command: > > (gdb) break PilotMain > > Then I continue execution... > > (gdb) continue > Continuing. > > In the device I go to my application and start it. > The device screen goes blank (since the debug breakpoint was hit). > In GDB, I receive these exact lines: > > Emul68KMain.c, Line:403, illegal instruction 00DE at address 007C1CD8 > Program received signal SIGEMT, Emulation trap. > 0x007c1cda in ?? () > > I believe that the question marks ("??") indicate that the error occured > even before entering PilotMain. Am I wrong? > > To find out more, I type in the command to show the stack trace: > > (gdb) where > #0 0x007c1cda in ?? () > #1 0x0074f176 in ?? () > #2 0x0074ef84 in ?? () > #3 0x0074e9e6 in ?? () > > This, of course, tells me nothing :) > > Can anyone nudge me in the right direction? > I fought so hard to get the project to compile and link, it seems such a > small matter to get it to actually run! > > Any help will be greatly appreciated. > > Jonathan > > P.S. Attached is the GDB log of the session. > > -- > For information on using the ACCESS Developer Forums, or to unsubscribe, > please see http://www.access-company.com/developers/forums/ > -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
