/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Development/debugging/gdb/threads.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2015-08-21 03:52:00 UTC
  • Revision ID: csa@suren.me-20150821035200-xu1zh22cqlk2omcq
Profiling

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Attaching
2
 
=========
3
 
 * attach <pid> / detach
4
 
    The attach command stops execution of the specified process, it can be
5
 
    ran again by 'detach' or 'continue' commands.
6
 
 * threads support
7
 
    info threads
8
 
    thread <threadno>
9
 
    thread apply [threadno] [all] args (apply command to all threads)
10
 
 * if this doesn't work
11
 
    Under Linux 'ps -L' shows LWP pids of multithreaded applications, this
12
 
    LWP can be used as a PID numbers for attaching.
13
 
 * Actually, the 'info threads' would only work on linux if threaded app. is
14
 
    started from gdb. Most of the following only works with 'info threads'
15
 
    working.
16
 
 * For me it even doesn't work in that case:
17
 
    - Dies by SIGTRAP if there is plugin loading code 
18
 
    - Doesn't see any threads if there are no plugin loading code
19
 
    - Checked 6.6-r2, 6.6mdk, 6.7.1 (glibc 2.6.1, 2.7 on Gentoo, DualCore)
20
 
 
21
 
Scheduller
22
 
==========
23
 
 show scheduler-locking
24
 
 set scheduler-locking <mode>
25
 
    off         - then there is no locking and any thread may run at any time
26
 
    on          - only the current thread may run when the inferior is resumed
27
 
    step        - optimizes single-stepping, it stops other threads from 
28
 
                "seizing the prompt" by preempting the current thread while you 
29
 
                are stepping.
30
 
                Other threads will only rarely (or never) get a chance to run 
31
 
                when you step. They are more likely to run when you `next' over
32
 
                a function call, and they are completely free to run when you 
33
 
                use commands like `continue', `until', or `finish'.
34
 
 
35
 
Threads
36
 
=======
37
 
    - break <linespec> thread <threadno> if <cond>