Code::Blocks Forums

User forums => Help => Topic started by: jackhab on August 02, 2009, 12:11:13 pm

Title: Can't set scheduler locking using debugger init settings [SOLVED]
Post by: jackhab on August 02, 2009, 12:11:13 pm
I added set scheduler-locking on command to Debugger Initialization Commands list and it's not working giving me the following in debugger's log:

...
>>>>>>cb_gdb:
> set scheduler-locking on
Target 'exec' cannot support this command.
...

What could be the problem?
Thanks.
Title: Re: Can't set scheduler locking using debugger init settings
Post by: Jenna on August 02, 2009, 12:29:54 pm
It's not a C::B but a gdb related problem.
You can try the solution suggested here: http://www.mathworks.com/matlabcentral/newsreader/view_thread/96539 (http://www.mathworks.com/matlabcentral/newsreader/view_thread/96539)

In short, it seems not to work (in some cases) if the program is not running, so put a breakpoint at the start of main or start debugging with step into, if gdb stops send the command to the debugger, even via "Debug -> Send user command to debugger" or (more comfortable in newer C::B) from the text-box inside the debugger-panel.

This works for me here (debian unstable/experimental 64-bit, GNU gdb (GDB) 6.8.50.20090628-cvs-debian).
Title: Re: Can't set scheduler locking using debugger init settings
Post by: jackhab on August 02, 2009, 04:25:57 pm
That's what I've been doing until now. I just thought I can't configure gdb properly.
Thanks.
Title: Re: Can't set scheduler locking using debugger init settings
Post by: jackhab on August 25, 2009, 12:16:05 pm
Well, thanks to GDB flexibility I found the solution. The process of putting a breakpoint in main() and executing the command can be automated using  Breakpoint Command Lists http://sourceware.org/gdb/current/onlinedocs/gdb.html#SEC40 (http://sourceware.org/gdb/current/onlinedocs/gdb.html#SEC40).
So the text to be added into Debugger Initialization Commands list is:
Code
break main 	
commands
silent
set scheduler-locking on
cont
end

And this will do the trick!