Author Topic: Can't set scheduler locking using debugger init settings [SOLVED]  (Read 12696 times)

Offline jackhab

  • Multiple posting newcomer
  • *
  • Posts: 16
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.
« Last Edit: August 25, 2009, 12:26:01 pm by jackhab »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Can't set scheduler locking using debugger init settings
« Reply #1 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

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).
« Last Edit: August 02, 2009, 12:32:26 pm by jens »

Offline jackhab

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Can't set scheduler locking using debugger init settings
« Reply #2 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.

Offline jackhab

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Can't set scheduler locking using debugger init settings
« Reply #3 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.
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!