News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Debugging avr project with simulavr and avr-gdb

Started by lnsdf, January 29, 2013, 06:23:17 AM

Previous topic - Next topic

lnsdf

Hey.
So I'm, trying to debug my AVR project in codeblocks  by using simulavr to simulate the mcu. If I open simulavr in a terminal window and set it to listen for avr-gdb then I can connect to it with avr-gdb in codeblocks then debugging works in the IDE. The only problem is the fact that I have to manually run simulavr in a terminal. Is there any way I can have simulavr be run automatically before avr-gdb is launched? I've tried adding it to the additional shell commands before connection for GDB but it doesn't seem to work.

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

scarphin

Unfortunately 'shell commands' feature of 'gdb' waits the command it launched to finish before resuming the debugging session. I mean if you try to launch the gdb-server (simulavr in your case) from shell commands, it gets launched but you can't continue debugging because gdb waits for it to finish. I tried .bat files to prevent this from happening with no luck. So another alternative is to setup a tool as Obfuscated said. Then assign a shortcut to the tool you've created and use it before running gdb.

lnsdf

Thanks for the suggestion to use tools! I never thought of that. In fact, it ends up working out better because after a debugging session I must kill simulavr with ^C which would not be possible if the shell command option actually worked. It is much better then manually opening a terminal window. :)