User forums > Help

Can't set scheduler locking using debugger init settings [SOLVED]

(1/1)

jackhab:
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.

Jenna:
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

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).

jackhab:
That's what I've been doing until now. I just thought I can't configure gdb properly.
Thanks.

jackhab:
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.
So the text to be added into Debugger Initialization Commands list is:

--- Code: ---break main
commands
silent
set scheduler-locking on
cont
end
--- End code ---

And this will do the trick!

Navigation

[0] Message Index

Go to full version