Author Topic: Set remote debug option with Wizard script [SOLVED]  (Read 22874 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: 9429
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: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://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: 9429
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: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://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: 9429
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: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://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: [Select]
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: 10403
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.
<debugger plugin maintainer>
(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: 33
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: [Select]
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10403
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #15 on: February 13, 2016, 05:48:20 pm »
You need to apply this patch:
Code: [Select]
Index: src/sdk/scripting/bindings/scriptbindings.cpp
===================================================================
--- src/sdk/scripting/bindings/scriptbindings.cpp    (revision 10780)
+++ src/sdk/scripting/bindings/scriptbindings.cpp    (working copy)
@@ -26,6 +26,7 @@
 #include "scriptbindings.h"
 #include <cbexception.h>
 #include "sc_base_types.h"
+#include "projectloader_hooks.h"

 namespace ScriptBindings
 {
@@ -265,6 +266,24 @@ namespace ScriptBindings
         }
         return sa.ThrowError("Invalid arguments to \"cbProject::ExportTargetAsProject\"");
     }
+
+    SQInteger cbProject_CallHooks(HSQUIRRELVM v)
+    {
+        StackHandler sa(v);
+        int paramCount = sa.GetParamCount();
+        if (paramCount == 2)
+        {
+            cbProject* prj = SqPlus::GetInstance<cbProject,false>(v, 1);
+            if (!prj)
+                return sa.ThrowError("Null project in \"cbProject::CallHooks\"");
+            bool isLoading = (sa.GetBool(2) != 0);
+
+            ProjectLoaderHooks::CallHooks(prj, prj->GetExtensionsNode()->ToElement(), isLoading);
+            return 1;
+        }
+        return sa.ThrowError("Invalid arguments to \"cbProject::CallHooks\"");
+    }
+
     SQInteger ProjectManager_AddFileToProject(HSQUIRRELVM v)
     {
         StackHandler sa(v);
@@ -582,6 +601,7 @@ namespace ScriptBindings
                 func(&cbProject::GetCheckForExternallyModifiedFiles, "GetCheckForExternallyModifiedFiles").
                 func(&cbProject::ShowNotes, "ShowNotes").
                 func(&cbProject::AddToExtensions, "AddToExtensions").
+                staticFuncVarArgs(cbProject_CallHooks, "CallHooks", "*").
                 func(&cbProject::DefineVirtualBuildTarget, "DefineVirtualBuildTarget").
                 func(&cbProject::HasVirtualBuildTarget, "HasVirtualBuildTarget").
                 func(&cbProject::RemoveVirtualBuildTarget, "RemoveVirtualBuildTarget").

And then use code like:
Code: [Select]
project.AddToExtensions(_T("debugger/remote_debugging:target=Debug"));
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=127.0.0.1"));
project.AddToExtensions(_T("debugger/remote_debugging/options:ip_port=3333"));

project.CallHooks(true);

I won't apply this patch in trunk, because there is a plan to replace the script bindings code with a newer binding library, so I don't want to cause conflicts.
Also I have plans to remove the whole project hooks in the future and thus I'll have to remove this call, which means I'll have to break users scripts.
<debugger plugin maintainer>
(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 anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 97
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #16 on: May 22, 2017, 03:22:53 pm »
Hi,

Sorry for reviving this topic again. I am doing this bcz my query is related to all the changes suggested here

I am facing sokme difficulties in project.AddtoExtension command in wizard.script file.
What I want is : (within cbp file of generated project from wizard)
Quote
                    <remote_debugging>
               <options conn_type="0" serial_baud="115200" additional_cmds="monitor halt;monitor flash erase_address 0x0 0x10000;load bin/Debug/rth.elf;file bin/Debug/rth.elf;monitor halt; />
            </remote_debugging>
                                <remote_debugging target="Debug">
               <options conn_type="0" serial_baud="115200" additional_cmds="monitor halt;monitor flash erase_address 0x0 0x10000;load bin/Debug/rth.elf;file bin/Debug/rth.elf;monitor halt; />
            </remote_debugging>
            <remote_debugging target="Release">
               <options conn_type="0" serial_baud="115200" additional_cmds="monitor halt;monitor flash erase_address 0x0 0x10000;load bin/Release/rth.elf;file bin/Release/rth.elf;monitor halt; />
            </remote_debugging>

To get this as output, I use one of the suggestion mentioned earlier - To use "scriptadd" in defining path, like this
Code: [Select]
local additional_commands = _T("monitor halt\n") +
                                _T("monitor flash erase_address 0x0 0x10000\n") +
                                _T("load bin/Debug/") + projectName + _T(".elf\n") +    // load /bin/debug/ will not work
                                _T("file bin/Debug/") + projectName + _T(".elf\n") +
                                _T("monitor halt\n");

        local additional_commands1 = _T("monitor halt\n") +
                                _T("monitor flash erase_address 0x0 0x10000\n") +
                                _T("load bin/Release/") + projectName + _T(".elf\n") +    // load /bin/debug/ will not work
                                _T("file bin/Release/") + projectName + _T(".elf\n") +
                                _T("monitor halt\n");

    project.AddToExtensions(_T("debugger/scriptadd/remote_debugging/options:additional_cmds=") + additional_commands);

    project.AddToExtensions(_T("debugger/scriptadd/remote_debugging:target=Release"));
    project.AddToExtensions(_T("debugger/scriptadd/remote_debugging/options:additional_cmds=") + additional_commands1);


The problem is whenever I do this,
Quote
    project.AddToExtensions(_T("debugger/scriptadd/remote_debugging:target=Release"));
    project.AddToExtensions(_T("debugger/scriptadd/remote_debugging/options:additional_cmds=") + additional_commands1);
Above function replaces the below function
Quote
project.AddToExtensions(_T("debugger/scriptadd/remote_debugging/options:additional_cmds=") + additional_commands);
Now I can only see 1 of above.
Is there any method that I can used to get the desired output?

Outcome I am getting is
Quote
            <remote_debugging target="Release">
               <options conn_type="0" serial_baud="115200" additional_cmds="monitor halt;monitor flash erase_address 0x0 0x10000;load bin/Release/rth.elf;file bin/Release/rth.elf;monitor halt; />
            </remote_debugging>

Just for Reference, I tries to use this solution, available here only a few comments before
Quote
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...
* cb_dbgscradd.patch

Is anyone can help me with this? Any possible solution?
« Last Edit: May 22, 2017, 03:30:37 pm by anandamu16 »

Offline anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 97
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #17 on: May 24, 2017, 01:10:37 pm »
Anyone can provide any solution or any way to achieve the desired possibility in codeblocks?

It seems I need to make a few modifications in debuggergdb.cpp

Online BlueHazzard

  • Lives here!
  • ****
  • Posts: 1583
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #18 on: May 24, 2017, 04:30:28 pm »
Hmm, i don't quire understand your question:

Quote
    project.AddToExtensions(_T("debugger/scriptadd/remote_debugging:target=Release"));
    project.AddToExtensions(_T("debugger/scriptadd/remote_debugging/options:additional_cmds=") + additional_commands1);

can you replay exactly what the outcome is, and what you want?

Does
Code: [Select]
project.AddToExtensions(_T("debugger/scriptadd/remote_debugging:target=Release"));
overwrites
Code: [Select]
project.AddToExtensions(_T("debugger/scriptadd/remote_debugging/options:additional_cmds=") + additional_commands1);
??

What is the desired outcome of this:
Code: [Select]
project.AddToExtensions(_T("debugger/scriptadd/remote_debugging:target=Release"));
?

thank you for the patience

Offline anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 97
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #19 on: May 24, 2017, 07:15:25 pm »
Code I am using in wizard script file:
Code: [Select]
                     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"));

            local additional_commands1 = _T("monitor halt\n") +
                                _T("monitor flash erase_address 0x0 0x10000\n") +
                                _T("load bin/Debug/\n") + projectName + _T(".elf\n") +
                                _T("file bin/Debug/") + projectName + _T(".elf\n") +
                                _T("monitor halt\n");

                   project.AddToExtensions(_T("debugger/scriptadd/remote_debugging/options:additional_cmds=") + additional_commands1);

                     project.AddToExtensions(_T("debugger/scriptadd/remote_debugging:target=Release"));
                     project.AddToExtensions(_T("debugger/scriptadd/remote_debugging/options:conn_type=0"));
                     project.AddToExtensions(_T("debugger/scriptadd/remote_debugging/options:serial_baud=115200"));

            local additional_commands2 = _T("monitor halt\n") +
                                _T("monitor flash erase_address 0x0 0x10000\n") +
                                _T("load bin/Release/\n") + projectName + _T(".elf\n") +
                                _T("file bin/Release/") + projectName + _T(".elf\n") +
                                _T("monitor halt\n");

                   project.AddToExtensions(_T("debugger/scriptadd/remote_debugging/options:additional_cmds=") + additional_commands2);


Expected Outcome:
Quote
<remote_debugging target="Debug">
               <options conn_type="0" serial_baud="115200" additional_cmds="monitor halt;monitor flash erase_address 0x0 0x10000;load bin/Debug/rth.elf;file bin/Debug/rth.elf;monitor halt; />
</remote_debugging>
<remote_debugging target="Release">
               <options conn_type="0" serial_baud="115200" additional_cmds="monitor halt;monitor flash erase_address 0x0 0x10000;load bin/Release/rth.elf;file bin/Release/rth.elf;monitor halt; />
</remote_debugging>

Actual Outcome:
Quote
<remote_debugging target="Release">
               <options conn_type="0" serial_baud="115200" additional_cmds="monitor halt;monitor flash erase_address 0x0 0x10000;load bin/Release/rth.elf;file bin/Release/rth.elf;monitor halt; />
            </remote_debugging>


Sorry for posting unclear query earlier. I hope this will be concise and clear  :)

It seems that we can add only 1 Extension line to cbp file corresponding to each parameter. Incase, I try to write multiple extension lines, only the information corresponding to last "project.AddtoExtension" gets reflected.
« Last Edit: May 25, 2017, 07:24:05 am by anandamu16 »

Online BlueHazzard

  • Lives here!
  • ****
  • Posts: 1583
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #20 on: May 24, 2017, 08:07:31 pm »
i tried your code and it does not work for me...
can you post more code?

Online BlueHazzard

  • Lives here!
  • ****
  • Posts: 1583
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #21 on: May 24, 2017, 08:18:21 pm »
i looked into the code of
Code: [Select]
void cbProject::AddToExtensions(const wxString& stringDesc)
and i have to tell you with this code it will not work... The problem is that the code does not look for attributes of the xml nodes. For the current code
Code: [Select]
<remote_debugging target="Debug">
</remote_debugging>
is the same as
Code: [Select]
<remote_debugging target="Release">
</remote_debugging>
so if the code comes to the first remote_debugging target node it will use it. The code needs modifications... Can you open a ticket on sourceforge? Probably i find time today to fix this and post a patch, but you have to find a dev who applies it ;)



Offline anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 97
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #22 on: May 25, 2017, 07:08:59 am »
Quote
i tried your code and it does not work for me...
can you post more code?
It will not work today, I applied a hack in debuggergdb.cpp file to make it work.
Kindly refer the reply of tomjnx in this same thread, he introduced a patch, I applied it and it worked.
Quote
tomjnx
Multiple posting newcomer

Re: Set remote debug option with Wizard script
Reply #11 on: January 10, 2013, 11:38:36 am
Quote
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...

I have added my modified debuggergdb.cpp file for reference. Kindly search for 'scriptadd' in this file.
Also I modified the code, I posted in last comment by adding /scriptadd/ in path.
If you will make the changes as stated in debuggergdb.cpp and use the above code in wizard.script, you can actualkly see the output
« Last Edit: May 25, 2017, 07:26:20 am by anandamu16 »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10403
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #23 on: May 25, 2017, 08:24:47 am »
If you want to provide a patch please follow this procedure described here: http://wiki.codeblocks.org/index.php/Creating_a_patch_to_submit_(Patch_Tracker)

EDIT:
fixed link
jens
« Last Edit: May 26, 2017, 09:05:43 am by jens »
<debugger plugin maintainer>
(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 anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 97
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #24 on: May 26, 2017, 08:36:03 am »
Hi oBFusCATed

I am not giving any patch here. I find this solution by someone here on this thread only.
Quote
If you want to provide a patch please follow this procedure described here: http://wiki.codeblocks.org/index.php/Creating_a_patch_to_submit_(Patch_Tracker)
Anyway, I tried to follow the link, its an empty page :)

My query is there any way in current codeblocks to get this (in cbp file)
Quote
<remote_debugging target="Debug">
               <options conn_type="0" serial_baud="115200" additional_cmds="monitor halt;monitor flash erase_address 0x0 0x10000;load bin/Debug/rth.elf;file bin/Debug/rth.elf;monitor halt; />
</remote_debugging>
<remote_debugging target="Release">
               <options conn_type="0" serial_baud="115200" additional_cmds="monitor halt;monitor flash erase_address 0x0 0x10000;load bin/Release/rth.elf;file bin/Release/rth.elf;monitor halt; />
</remote_debugging>
I want this to be automatic part of new project created by wizard, for this, I am writing the wizard.script file but don't know how to achieve this. Any help will be of great value?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10403
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #25 on: May 26, 2017, 09:12:10 am »
Anyway, I tried to follow the link, its an empty page :)
The link in my post works fine at least in Firefox on linux. To fix it just add a closing bracket at the end.
<debugger plugin maintainer>
(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 jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7222
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #26 on: May 26, 2017, 09:12:24 am »
Hi oBFusCATed

I am not giving any patch here. I find this solution by someone here on this thread only.
Quote
If you want to provide a patch please follow this procedure described here: http://wiki.codeblocks.org/index.php/Creating_a_patch_to_submit_(Patch_Tracker)
Anyway, I tried to follow the link, its an empty page :)
I fixed the link in oBFusCATed's post.
The automatic link-recognition of the forum software does not recognize the closing parenthesis as part of the link and omits it therefore.
My query is there any way in current codeblocks to get this (in cbp file)
Quote
<remote_debugging target="Debug">
               <options conn_type="0" serial_baud="115200" additional_cmds="monitor halt;monitor flash erase_address 0x0 0x10000;load bin/Debug/rth.elf;file bin/Debug/rth.elf;monitor halt; />
</remote_debugging>
<remote_debugging target="Release">
               <options conn_type="0" serial_baud="115200" additional_cmds="monitor halt;monitor flash erase_address 0x0 0x10000;load bin/Release/rth.elf;file bin/Release/rth.elf;monitor halt; />
</remote_debugging>
I want this to be automatic part of new project created by wizard, for this, I am writing the wizard.script file but don't know how to achieve this. Any help will be of great value?
You can create a stub project with all settings you need and save it as user template: "File -> Save project as template ..".

Offline anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 97
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #27 on: May 26, 2017, 10:25:12 am »
Quote
You can create a stub project with all settings you need and save it as user template: "File -> Save project as template ..".

In my project some setiings required the name of project like
In Remote debugging:          load bin/Debug/ptojectName.elf

For these kind of settings, I wish to set all these settings through wizard script file. Setting a template will not be of help

Pls clear my doubt: In today's scenario, Can we add multiple remote debugging commands through wizard script like this:??
Quote
<remote_debugging target="Debug">
               <options conn_type="0" serial_baud="115200" additional_cmds="monitor halt;monitor flash erase_address 0x0 0x10000;load bin/Debug/rth.elf;file bin/Debug/rth.elf;monitor halt; />
</remote_debugging>
<remote_debugging target="Release">
               <options conn_type="0" serial_baud="115200" additional_cmds="monitor halt;monitor flash erase_address 0x0 0x10000;load bin/Release/rth.elf;file bin/Release/rth.elf;monitor halt; />
</remote_debugging>

Online BlueHazzard

  • Lives here!
  • ****
  • Posts: 1583
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #28 on: May 26, 2017, 09:26:52 pm »
Ok, i have created a patch with this codeblocks would be able to do what you want.
https://sourceforge.net/p/codeblocks/tickets/513/

there is a other problem with codeblocks. The debugger deletes all configuration done outside from the plugin. I would like to know form a dev why this was done... The configuration should only be overwritten when you change the options... But if you use this api provided by my patch only from the scripted wizard this should be ok..

Offline anandamu16

  • Multiple posting newcomer
  • *
  • Posts: 97
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #29 on: May 29, 2017, 01:10:35 pm »
Hi BlueHazzard,

Your code looks good, but alas nothing gets displayed/reflected in cbp file of the project..?
As per your patch, I modified cbproject.h and cbproject.cpp. I keep all other files such as debuggergdb.cpp same as available in nighty build. But still I am not able to see debugger options in cbp file.
I checked my cbp file, and it has no information about debugger.

In wizard.script file, I used this command -
project.AddToExtensions(_T("debugger/remote_debugging/options:conn_type=0/sub_conn:baudrate=32000"));
project.AddToExtensions(_T("debugger/remote_debugging/options:conn_type=0/sub_conn:+interface=COM1"));

Any comments? Am I missing anything?

Even I tried disabling the debugger plugin, before creating the project, even that didn't work. Also please clear, whether disabling a plugin is mandatorystep or not required?
« Last Edit: May 29, 2017, 01:13:45 pm by anandamu16 »

Online BlueHazzard

  • Lives here!
  • ****
  • Posts: 1583
Re: Set remote debug option with Wizard script [SOLVED]
« Reply #30 on: May 29, 2017, 05:16:33 pm »
there is a other problem with codeblocks. The debugger deletes all configuration done outside from the plugin. I would like to know form a dev why this was done... The configuration should only be overwritten when you change the options.

This is the problem, so there is still missing a part to fix your problem...