Author Topic: how to control debugger setting in wizard script  (Read 5889 times)

Offline kccheng

  • Multiple posting newcomer
  • *
  • Posts: 30
how to control debugger setting in wizard script
« on: May 29, 2011, 12:32:15 am »
Hi,

I'm using wizard script to create a new type of project.
I want to turn off "Catch C++ exceptions" debugger setting
from wizard script.  How can I do that ?
Thanks a lot.

KC

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: how to control debugger setting in wizard script
« Reply #1 on: May 29, 2011, 01:25:25 am »
I guess you can use the config manager (see here for details: http://wiki.codeblocks.org/index.php?title=Scripting_commands ).
But this doesn't sound right. "Catch C++ exceptions" is a global setting, so changing it in a wizard is strange (btw why do you want to do it?).
Please keep in mind that we have a branch, where we've done major refactoring of the debugger's code. When this code lands in trunk,
the config variables will change and you script will be broken! (this is if you use 10.05 or trunk version)

The best solution is to put a message stating what is the problem with having this option enabled, so users can decide if they want to turn it off.
(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 kccheng

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: how to control debugger setting in wizard script
« Reply #2 on: May 29, 2011, 01:36:05 am »
I guess you can use the config manager (see here for details: http://wiki.codeblocks.org/index.php?title=Scripting_commands ).
But this doesn't sound right. "Catch C++ exceptions" is a global setting, so changing it in a wizard is strange (btw why do you want to do it?).
...

I'm debugging a DLL.  The host application (a multi-thread Gtk+ app. writing by C) will fail
if "Catch C++ exceptions" is turn on.  I don't know if this is CB's issue or host application's problem,
just know if I turn it off, it works OK.

BTW, I do think Wizard is a right place to change that options, specially for DLL
type of project.  DLL requires a host application to run, so configure CB to meet
host application's requirement (eg, environment variables ...) is not a bad thing
IMHO.

I'm new to Code::Blocks ... if Wizard is not a good place to turn that options off, does any
configuration flags exist which I can use ?

And I check ConfigManger's page and it only provide Read/Write function.
How can I know which configuration I should read from or write to ?  Where can
I find that information ?

Thanks a lot
KC
« Last Edit: May 29, 2011, 01:59:01 am by kccheng »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: how to control debugger setting in wizard script
« Reply #3 on: May 29, 2011, 01:54:39 am »
Settings -> Compiler & Debugger -> Debugger -> Catch C++ exceptions?
In the same dialog you can see the "Display debugger's debug log", turn it on and inspect the communication between C::B and GDB, see if there is something wrong.

Probably something is wrong with GDB...

BTW, Is you project C only? Probably I can do this option clever :)
(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 kccheng

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: how to control debugger setting in wizard script
« Reply #4 on: May 29, 2011, 02:08:47 am »
Settings -> Compiler & Debugger -> Debugger -> Catch C++ exceptions?
In the same dialog you can see the "Display debugger's debug log", turn it on and inspect the communication between C::B and GDB, see if there is something wrong.

Probably something is wrong with GDB...

BTW, Is you project C only? Probably I can do this option clever :)

I turn on the debug log and got this:
...
>>>>>>> cb_gdb:
> catch throw
Function "__cxa_throw" not defined.

and then GDB quit.
And yes, my project is pure C project.  So, it will be great if you
can make it smart :-)  Thanks.


Best Regards,
KC

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: how to control debugger setting in wizard script
« Reply #5 on: May 29, 2011, 08:48:03 am »
What is your gdb? Mine here :gdb 7.1 mingw + windows xp, doesn't quit. I've tried a simple hello world, C project.

I guess my linux gdb doesn't have this problem, too. Gentoo amd64 gdb 7.2.
(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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: how to control debugger setting in wizard script
« Reply #6 on: May 29, 2011, 09:00:46 am »
There was such an issue with older gdb versions (gdb quits if no c++ execptions are used) see: http://forums.codeblocks.org/index.php/topic,10829.msg74132.html#msg74132