Code::Blocks Forums

User forums => Embedded development => Topic started by: lnsdf on January 29, 2013, 06:23:17 am

Title: Debugging avr project with simulavr and avr-gdb
Post by: lnsdf 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.
Title: Re: Debugging avr project with simulavr and avr-gdb
Post by: oBFusCATed on January 29, 2013, 09:05:24 am
You can setup a tool.
Title: Re: Debugging avr project with simulavr and avr-gdb
Post by: scarphin 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.
Title: Re: Debugging avr project with simulavr and avr-gdb
Post by: lnsdf 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. :)