1.2.14.1 Showing thread information (info thread)

info thread [thread-name|thread-number][verbose|terse]

List all currently-known thread name(s).

If no thread name or thread number is given, we list info for all threads. Unless a terse listing, for each thread we give:

The specific output you get depends on whether you are using Python 2.5 or later or (when not) have the threadframe module installed.

Here is an example assuming Python 2.5 is installed:

(Pydb) info thread 
----------------------------------------
   <_MainThread(MainThread, started)>
    <module>() called from file '/src/external-cvs/pydb/test/thread/q.py' at line 52
----------------------------------------
   <Producer(Thread-1, started)>
    run(self=<Producer(Thread-1, started)>) called from file '/src/external-cvs/pydb/test/thread/q.py' at line 19
----------------------------------------
-> <Consumer(Thread-2, started)>
    run(self=<Consumer(Thread-2, started)>) called from file '/src/external-cvs/pydb/test/thread/q.py' at line 39
----------------------------------------
   <Consumer(Thread-3, started)>
    run(self=<Consumer(Thread-3, started)>) called from file '/src/external-cvs/pydb/test/thread/q.py' at line 38

The arrow -> indicates which thread is current. Here it is Thread-2. If terse is appended, we just list the thread name and thread id. Here's an example:

(Pydb) info thread terse
   MainThread: -1210480976
   Thread-3: -1231336544
-> Thread-2: -1222943840
   Thread-1: -1214551136

The arrow indicates the current thread; again it is Thread-2. This listing is available on all Python versions and without threadframe installed.

To get the full stack trace for a specific thread pass in the thread name (assuming Python 2.5 or threadframe). Here's an example:

(Pydb) info thread Thread-3
    trace_dispatch_gdb(self=<threaddbg.threadDbg ins...) called from file 'None' at line 162
    run(self=<Consumer(Thread-3, star...) called from file 'q.py' at line 39
    __bootstrap(self=<Consumer(Thread-3, star...) called from file 'threading.py' at line 460

If verbose appended without a thread name, then the entire stack trace is given for each frame and the thread ID is shown as well.

See About this document... for information on suggesting changes.