Author Topic: Running bash script before starting debugger  (Read 9330 times)

Offline 3sv

  • Single posting newcomer
  • *
  • Posts: 6
Running bash script before starting debugger
« on: February 25, 2009, 09:57:02 am »
Hello All,

I can successfully use remote debugging from within CodeBlocks. It works nice but now I have to copy the executable to the target outside C::B, and has to start the remote debugger also outside C::B. I want to automate these two tasks.

Therefore I want to use a bash script that runs every time I start a debug session. In the project/target options on the debugger tab there is an input field for Additional commands before connection. On the first sight it looks exactly like what i need, but on a second look it seems that this is made for gdb commands. It should be possible also to use the After connection gdb commands to copy the executable but then I still have to start the remote debugger by hand, and for starting the server I should already have the executable. Thus that would lead to a chicken and egg problem.

So I would prefer to just start a bash script. That script can copy the executable with scp , and then starts the remote debugger over ssh with public-key based authentication.

Any ideas? what is the most simple way to do this?

Thanks in advance.




Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Running bash script before starting debugger
« Reply #1 on: February 25, 2009, 11:35:28 am »
There's no support for pre/post debugging shell commands currently so the only solution would be to manually run the said shell script before debugging.

On the other hand, one could possibly write a plugin that listens to EVT_DEBUGGER_STARTED/EVT_DEBUGGER_FINISHED messages and add this functionality. But I haven't seen this part of the code in a while and I 'm not sure it would work out of the box or if it 'd take some fiddling first.
Be patient!
This bug will be fixed soon...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Running bash script before starting debugger
« Reply #2 on: February 25, 2009, 12:20:41 pm »
as discussed I will try to add some initial support for this.