Author Topic: Debugging avr project with simulavr and avr-gdb  (Read 12784 times)

Offline lnsdf

  • Single posting newcomer
  • *
  • Posts: 2
Debugging avr project with simulavr and avr-gdb
« on: January 29, 2013, 06:23:17 am »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugging avr project with simulavr and avr-gdb
« Reply #1 on: January 29, 2013, 09:05:24 am »
You can setup a tool.
(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!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Debugging avr project with simulavr and avr-gdb
« Reply #2 on: January 29, 2013, 11:19:14 am »
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.

Offline lnsdf

  • Single posting newcomer
  • *
  • Posts: 2
Re: Debugging avr project with simulavr and avr-gdb
« Reply #3 on: January 29, 2013, 07:18:23 pm »
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. :)