GDB scheduler-locking Command Detailed

Source: Internet
Author: User

GDB scheduler-locking Command Detailed

Gdb> show scheduler-locking//show thread's scheduler-locking status
Gdb> set scheduler-locking on//debug lock current thread, stop all other threads

Set scheduler-locking mode
set the scheduler locking mode. It applies to normal execution, record mode, and replay mode. If it is off, then there are no locking and any thread could run at any time. If on and then only the current thread may run when the inferior is resumed. The step mode optimizes for single-stepping; It prevents other threads from preempting the "the current" thread while you were stepping, so that the focus of debugging does n OT change unexpectedly. Other threads never get a chance to run if you step, and they is completely free to run when you use commands like ' con Tinue ', ' until ', or ' finish '. However, unless another thread hits a breakpoint during its timeslice, GDB does isn't change the current thread away from th e thread that is debugging. The replay mode behaves like off in record mode and like on replay mode.

show Scheduler-locking

by default, when you issue one of the execution Commands such as continue, next or step, GDB allows only threads of the current inferior to run. For example, if GDB was attached to both inferiors, each with a threads, the continue command resumes only the same threads of the current inferior. This is useful, for example, when you debug a program that forks and you want to the parent stopped Tance, it doesn ' t run to exit) and while you debug the child. In other situations, the interested in inspecting and the current state of any of the processes GDB are attached to, Want to resume them all until some breakpoint are hit. In the latter case, you can instruct GDB to allow all threads of a inferiors to run with the set Schedule-multiple C Ommand.

Set Schedule-multiple
Set the mode for allowing threads of multiple processes to being resumed when a execution command is issued. When on, all threads of all processes is allowed to run. When off, only the threads of the current process is resumed. The default is off. The scheduler-locking mode takes precedence when set to ON, or if you were stepping and set to step.

Show Schedule-multiple
Display the current mode for resuming the execution of threads of multiple processes.

Gdb> Set scheduler-locking offgdb> Show Scheduleschedule-multiple scheduler-Locking gdb> Show Scheduler-Locking Mode forLocking scheduler during execution is"off". Gdb> Set Scheduler-Locking stepgdb> Show Scheduler-Locking Mode forLocking scheduler during execution is"Step". Gdb> Set Scheduler-Locking ongdb> Show Scheduler-Locking Mode forLocking scheduler during execution is" on".

GDB scheduler-locking Command Detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.