Author Topic: Set remote debug option with Wizard script [SOLVED]  (Read 79224 times)

Offline ZdenoQC

  • Single posting newcomer
  • *
  • Posts: 9
Set remote debug option with Wizard script [SOLVED]
« on: September 11, 2012, 05:24:35 pm »
Hi,

I'm creating a wizard template for my board base on a freescale imx processor (armv7). I have set all compiler and librairie function but I haven't found a way to set gdb remote debugging option like IP address and pre-command.

Is this possible?

Thanks

William Deshaies
« Last Edit: January 30, 2013, 05:00:23 pm by ZdenoQC »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Set remote debug option with Wizard script
« Reply #1 on: September 12, 2012, 07:30:50 am »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ZdenoQC

  • Single posting newcomer
  • *
  • Posts: 9
Re: Set remote debug option with Wizard script
« Reply #2 on: September 13, 2012, 02:26:36 pm »
Nice!

And how I do that? Is it with the read/write function and I look in the project XML to find the name of the parameter I want to change?

Thanks

William Deshaies

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Set remote debug option with Wizard script
« Reply #3 on: September 13, 2012, 02:51:25 pm »
And how I do that?
I can't tell because it depends on you platform, version of C::;B and compiler/debugger version / framework you are using. Unfortunately you didn't provide any of these information.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ZdenoQC

  • Single posting newcomer
  • *
  • Posts: 9
Re: Set remote debug option with Wizard script
« Reply #4 on: September 13, 2012, 03:07:28 pm »
Sorry I totally forgot. I'm using Ubuntu 11.04 and codeblocks 10.05 from synaptic (not svn), gcc 4.4.4 (gcc-4.4.4-glibc-2.11.1-multilib-1.0).

I'm not sure about the framework you are talking because I haven't add any plugin or addon.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Set remote debug option with Wizard script
« Reply #5 on: September 13, 2012, 03:23:32 pm »
codeblocks 10.05
I suppose you better use a nightly for this purpose. Then, within the debugger configuration you can setup the connectivity options using the GUI.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ZdenoQC

  • Single posting newcomer
  • *
  • Posts: 9
Re: Set remote debug option with Wizard script
« Reply #6 on: September 13, 2012, 03:24:53 pm »
I already know how to setup those setting in the project with Properties->Debugger->Remote debugging, but I want this to be made by the wizard script I'm writing. Just like the function project.AddLinkLib(_T(""));.

I thought it was a codeblocks project thing and not compiler/debugger specific thing.

Offline ZdenoQC

  • Single posting newcomer
  • *
  • Posts: 9
Re: Set remote debug option with Wizard script
« Reply #7 on: October 10, 2012, 04:35:39 pm »
Hi,
 
After some days I found something interesting. The function project.AddToExtensions() add elements in the project xml file.

Code
project.AddToExtensions(_T("debugger/remote_debugging/options:conn_type=0"));
project.AddToExtensions(_T("debugger/remote_debugging/options:serial_baud=115200"));
project.AddToExtensions(_T("debugger/remote_debugging/options:ip_address=192.168.0.1"));
project.AddToExtensions(_T("debugger/remote_debugging/options:ip_port=2222"));
project.AddToExtensions(_T("debugger/remote_debugging:target=Debug"));

The problem is that it seems that the debugger option is ovewrite elsewhere. When I use de "+" in front of "debugger/.." , I see the the duplicate options, but the first is clear.

Do someone know what is the function that overwrite the debugger setting and how I can bypass that? Or is there an other way of writing theses settings?

Thanks

Offline ZdenoQC

  • Single posting newcomer
  • *
  • Posts: 9
Re: Set remote debug option with Wizard script
« Reply #8 on: October 12, 2012, 04:12:23 pm »
Hi,

I found a workaround for the previous method I found. I just find out that the debugger was a plugin in codeblocks. So I disable it first. I create the project with my wizard with the "AddToExtensions" lines and I close it. Finally, I enable the plugin and I open the project. Its the only way that my settings are not erase by the debugger plugin.

I guess the only way to avoid that is to modify the debugger plugin or disable and enable the plugin via the wizard.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Set remote debug option with Wizard script
« Reply #9 on: October 15, 2012, 05:22:32 pm »
I guess the only way to avoid that is to modify the debugger plugin or disable and enable the plugin via the wizard.
Modify the plugin and provide a patch, but please use the latest SVN HEAD sources as reference.
(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 firew4lker

  • Single posting newcomer
  • *
  • Posts: 7
Re: Set remote debug option with Wizard script
« Reply #10 on: December 13, 2012, 03:40:59 pm »
I have the same Issue.

@ZdenoQC. Did you fill a bug report?

Offline tomjnx

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: Set remote debug option with Wizard script
« Reply #11 on: January 10, 2013, 11:38:36 am »
Something like this?

You could then add something to "debugger/scriptadd/x", which would then be converted to "debugger/x" on first save (or load)

Yes it's a hack, but minimally intrusive, and the whole AddToExtension interface seems a bit q&d to me...

Offline firew4lker

  • Single posting newcomer
  • *
  • Posts: 7
Re: Set remote debug option with Wizard script
« Reply #12 on: January 10, 2013, 11:55:16 am »
I will give it a try.

Offline ZdenoQC

  • Single posting newcomer
  • *
  • Posts: 9
Re: Set remote debug option with Wizard script
« Reply #13 on: January 30, 2013, 04:59:27 pm »
Wow I thought it would never work! Thanks a lot tomjnx for this patch!

Offline Jungle

  • Single posting newcomer
  • *
  • Posts: 9
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #14 on: February 10, 2016, 12:24:11 pm »
I apologize for reviving this topic, but I'm unable to set debugger options in the wizard.script. I've tried the following
Code
project.AddToExtensions(_T("debugger/scriptadd/remote_debugging"));
project.AddToExtensions(_T("+debugger/scriptadd/remote_debugging:target=Debug"));
project.AddToExtensions(_T("+debugger/scriptadd/remote_debugging/options:conn_type=0"));
project.AddToExtensions(_T("+debugger/scriptadd/remote_debugging/options:serial_baud=115200"));
project.AddToExtensions(_T("+debugger/scriptadd/remote_debugging/options:ip_address=127.0.0.1"));
project.AddToExtensions(_T("+debugger/scriptadd/remote_debugging/options:ip_port=3333"));
and it doesn't work. I've also tried without "+" and without "scriptadd". No success.

C::B version is 16.01.