Multithreaded Programming Guide

Using dbx

With the dbx utility you can debug and execute source programs written in C++, ANSI C, and FORTRAN. dbx accepts the same commands as the Debugger, but uses a standard terminal (TTY) interface. Both dbx and the Debugger support debugging multithreaded programs. For a full overview of dbx and Debugger features see the dbx(1) reference manual page and the Using Sun Workshop user's guide.

All the dbx options listed in Table 7-5 can support multithreaded applications.

Table 7-5 dbx Options for MT Programs

Option 

Meaning 

cont at line [sig signo id]

Continues execution at line with signal signo. The id, if present, specifies which thread or LWP to continue. The default value is all.

lwp

Displays current LWP. Switches to given LWP [lwpid].  

lwps

Lists all LWPs in the current process.  

next ... tid

Steps the given thread. When a function call is skipped, all LWPs are implicitly resumed for the duration of that function call. Nonactive threads cannot be stepped.  

next ... lid

Steps the given LWP. Does not implicitly resume all LWPs when skipping a function. The LWP on which the given thread is active. Does not implicitly resume all LWP when skipping a function.  

step... tid

Steps the given thread. When a function call is skipped, all LWPs are implicitly resumed for the duration of that function call. Nonactive threads cannot be stepped.  

step... lid

Steps the given LWP. Does not implicitly resume all LWPs when skipping a function.  

stepi... lid

The given LWP.  

stepi... tid

The LWP on which the given thread is active.  

thread

Displays current thread. Switches to thread tid. In all the following variations, an optional tid implies the current thread.

thread -info [ tid ]

Prints everything known about the given thread.  

thread -locks [ tid ]

Prints all locks held by the given thread.  

thread -suspend [ tid ]

Puts the given thread into suspended state.  

thread -continue [ tid ]

Unsuspends the given thread.  

thread -hide [ tid ]

Hides the given (or current) thread. It will not appear in the generic threads listing.

thread -unhide [ tid ]

Unhides the given (or current) thread.

allthread-unhide

Unhides all threads.

threads

Prints the list of all known threads.  

threads-all

Prints threads that are not usually printed (zombies).  

all|filterthreads-mode

Controls whether threads prints all threads or filters them by default.

auto|manualthreads-mode

Enables automatic updating of the thread listing.  

threads-mode

Echoes the current modes. Any of the previous forms can be followed by a thread or LWP ID to get the traceback for the specified entity.