Author Topic: How to send "Continue" command to debugger?  (Read 4055 times)

dtlinker

  • Guest
How to send "Continue" command to debugger?
« on: October 19, 2008, 11:35:30 pm »
I am using CodeBlocks to do "remote" debugging of the Palm Emulator, using a connection to m68k-palmos-gdb.

Everything hooks up OK, and I can single step through the code. I can set breakpoints, and if I use "Send user command to debugger" and send "cont", it will run to the breakpoint.

If I use the "Continue" command from the menu, the application on the Palm crashes. The same thing happens if I choose run to cursor. Looking at the debugger log, the command issued was "run" rather than "cont". I have tested, and that command does cause a crash when running from the command line. "cont" works fine.

I have "Do *not* run the debugee" checked under the debugger settings.

How do I get the program to send a "cont" command without typing it myself?

I am using CodeBlocks 8.2, on Mac OS X 10.5.5. The version number of m68k-palmos-gdb is 5.3

Thanks in advance.

dtlinker

  • Guest
Re: How to send "Continue" command to debugger?
« Reply #1 on: October 22, 2008, 11:20:19 pm »
I have found a solution.

The key is to redefine the "run" command.

In CodeBlocks, under Project -> Properties -> Debugger -> Debug -> Additional commands, in the box "Before connection" put the following:

source fixrun
target palmos

The new line is "source fixrun".

Then, in the main directory of the project, create a textfile called "fixrun" which contains the following:

define run
cont
end

That is it!

When you start the debugger, it will run the "Before connection" commands. The "Source" command reads in a command file. The "define" command redefines "run" as "cont", so that if a "run" command is issued, it is translated to a "cont". This has to be in an external file, since otherwise there is an interactive dialog which asks if your really want to replace the command "run".

Now, continuing, and breakpoints work as they are supposed to. Run to cursor, however is still broken.