Bug 11964 - support for debugging multithreaded openmp
Summary: support for debugging multithreaded openmp
Status: RESOLVED OBSOLETE
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 7.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-01 03:47 UTC by Hicham Mouline
Modified: 2014-09-12 23:18 UTC (History)
3 users (show)

See Also:
Host: Linux 2.6.33.3 x86_64
Target: 7.1-33.fc13
Build: x86_64-redhat-linux-gnu
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hicham Mouline 2010-09-01 03:47:43 UTC
Hello,
While debugging this program
https://computing.llnl.gov/tutorials/openMP/samples/C/omp_hello.c
under emacs/GUD with gdb, putting a breakpoint inside the parallel region, line 
30, triggers a stop at that point.
However, stepping over generates this error
"Cannot find bounds of current function", when the cursor hits line 22 (the 
pragma line)

The program was built with gcc (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10), and its 
associated libgomp library.

A fix is proposed by jan.kratochvil@redhat.com though I'm not sure it's related 
to this particular point:
http://cvs.fedoraproject.org/viewvc/rpms/gdb/devel/gdb-bz533176-fortran-omp-
step.patch?content-type=text%2Fplain&view=co


regards,
Comment 1 Hicham Mouline 2010-09-01 03:55:36 UTC
I forgot to say that:

Jan Kratochvil [jan.kratochvil@redhat.com] says
"it is only a hack, there should be some proper DWARF annotation instead."

regards,
Comment 2 Jan Kratochvil 2010-09-03 06:14:25 UTC
Using
GNU gdb (GDB) 7.2.50.20100903-cvs
gcc-4.4.4-10.fc13.x86_64

(gdb) start
Temporary breakpoint 1 at 0x4006a3: file omp_hello.c, line 22.
Starting program: /home/jkratoch/t/omp_hello 
[Thread debugging using libthread_db enabled]

Temporary breakpoint 1, main (argc=1, argv=0x7fffffffded8) at omp_hello.c:22
22	#pragma omp parallel private(nthreads, tid)
(gdb) step
[New Thread 0x7ffff7fd8710 (LWP 15656)]
[New Thread 0x7ffff75d7710 (LWP 15657)]
[New Thread 0x7ffff6bd6710 (LWP 15658)]
[New Thread 0x7ffff61d5710 (LWP 15659)]
[New Thread 0x7ffff57d4710 (LWP 15660)]
[New Thread 0x7ffff4dd3710 (LWP 15661)]
[New Thread 0x7ffff43d2710 (LWP 15662)]
Hello World from thread = 3
main.omp_fn.0 (.omp_data_i=0x0) at omp_hello.c:26
26	  tid = omp_get_thread_num();
(gdb) 

which seems to be correct.  There is a bit problem it stops earlier if you have
installed gcc-debuginfo:

(gdb) start
Temporary breakpoint 1 at 0x4006a3: file omp_hello.c, line 22.
Starting program: /home/jkratoch/t/omp_hello 
[Thread debugging using libthread_db enabled]

Temporary breakpoint 1, main (argc=1, argv=0x7fffffffded8) at omp_hello.c:22
22	#pragma omp parallel private(nthreads, tid)
(gdb) step
GOMP_parallel_start (fn=0x4006c8 <main.omp_fn.0>, data=0x0, num_threads=0) at
../../../libgomp/parallel.c:106
106	{
(gdb) _

But that happens even with all the system libraries.

I cannot reproduce the "Cannot find bounds of current function" case.
Comment 3 Sergio Durigan Junior 2014-09-12 23:18:53 UTC
Closing as OBSOLETE due to inactivity.  Feel free to reopen if still valid.