Code::Blocks Forums

User forums => Embedded development => Topic started by: ffelagund on May 19, 2008, 10:29:19 pm

Title: Remote debugging/execution
Post by: ffelagund on May 19, 2008, 10:29:19 pm
Hello,
I'm trying to setup C::B for remote debugging and compilation. Well, currently, I'm using a custom makefile that sends the make comands through ssh to the remote machine. With this, I can compile and clean the application. For running it remotely, I've added a little script that executes remotely the application (#!/bin/bash ssh -C ps3 -p 43210 'cd programming && ./cellTest') in Project Properties->Build Targets->Output Filename (I dont know if there are a better way of doing this). This works good for EXECUTING the application, but for debugging.

For debugging I use gdbserver in the remote machine and I've configured succesfully the gdb custom client in C::B, but here is where lies my problem. C::B launches internally the gdb client with the 'program' I've placed in the Output Filename textbox, and of course, it doesn't work, because gdb must use the real binary (in this case ./cellTest in the remote machine)

The question is, how can I set the correct executable for C::B's gdb call and the ssh command for remote execution?

Best regards,
Jacobo.
Title: Re: Remote debugging/execution
Post by: mariocup on May 19, 2008, 11:05:02 pm
Hi ffelagund,

I do not know it really works, but perhaps you can try the following procedure.

You can type

Code
shell command string

in the gdb console or gdb script to execute an executable with parameters. E.g. shell explorer will launch the explorer. To ensure that gdb finds the correct executable cellTest perhaps you will have to modify the pwd variable in gdb console/script.

Bye,

Mario

Title: Re: Remote debugging/execution
Post by: ffelagund on May 22, 2008, 06:38:50 pm
Hello,

I've tested that way and doesnt work, because gdb doesn't starts with my 'executing configuration', and it would be nice not having to start gdb manually.

A possible solution would be write a macro and invoke it through a keypress or a toolbar button. Is that possible?
Title: Re: Remote debugging/execution
Post by: mariocup on May 22, 2008, 11:24:19 pm
Hi ffelagund,

perhaps you are looking for something like that?

http://wiki.codeblocks.org/index.php?title=Installing_Uniwin_remote_compiler

Bye,

Mario
Title: Re: Remote debugging/execution
Post by: ffelagund on May 23, 2008, 07:24:33 am
I read about Uniwin in my searchs before posting here, and I realized that is only for windows (I'm developing under Debian) so I cant take advantage of such tool, but I think that is a neccessary feature for C::B to be able of use remote debugging and custom makefiles together, and have custom or configurable commands for compiling, running and debugging remotely.

I workarounded that problem by coping the 'Debug'  C::B configuration into an "Execute" one. In the Debug config I placed the compiled binary file as executable, and in the Execute, I'm using the ssh remote execution script. With this, I only have to change the active configuration in the dropdown list located in the toolbar before executing or debugging. This could serve, but is dirty workaourd because I have to manage two configurations for the same thing.

The ability of allowing generic buttons attached to an user's shell script could improve greatly the flexbility of this wornderful application (after knowing about C::B I loose my personal dependecies with Visual Studio :) )

Regards,
Jacobo