Oracle® Solaris Studio 12.4: Debugging a Program With dbx

Exit Print View

Updated: January 2015
 
 

Using Stack Traces

When execution is stopped in a parallel region, a where command shows a stack trace that contains the outlined subroutine.

(dbx) where
current thread: t@4
=>[1] _$d1E48.main(), line 52 in "test.c"
  [2] _$p1I46.main(), line 48 in "test.c"

--- frames from parent thread ---
current thread: t@1
  [7] main(argc = 1, argv = 0xffffffff7fffec98), line 46 in "test.c"

The top frame on the stack is the frame of the outlined function. Even though the code is outlined, the source line number still maps back to 15.

When execution is stopped in a parallel region, a where command from a slave thread prints the master thread's stack trace if the relevant frames are still active. A where command from the master thread has a full traceback.

You can also determine how execution reached the breakpoint in a slave thread by first using the omp_team command to list all the threads in the current team, and then switching to the master thread (the thread with the OpenMP thread ID 0) and getting a stack trace from that thread.