From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Hicham Mouline <hicham@mouline.org>
Cc: gdb@sourceware.org
Subject: Re: gomp status
Date: Tue, 31 Aug 2010 03:42:00 -0000 [thread overview]
Message-ID: <20100831034147.GA26924@host1.dyn.jankratochvil.net> (raw)
In-Reply-To: <000d01cb489a$0b8c2b10$22a48130$@org>
On Tue, 31 Aug 2010 01:21:15 +0200, Hicham Mouline wrote:
> I've used gdb 7.1.26 to debug a binary built with g++4.3.3 (C++) and the
> libgomp that comes with it.
> but I can't display/watch variables inside it. It says "symbol unavailable"
> or something like that.
You haven't provided a problem reproducer. It works for me for example for:
https://computing.llnl.gov/tutorials/openMP/samples/C/omp_hello.c
gcc (GCC) 4.5.2 20100830 (prerelease)
GNU gdb (GDB) 7.2.50.20100831-cvs
This GDB was configured as "x86_64-unknown-linux-gnu".
(gdb) b 27
Breakpoint 1 at 0x4006dc: file omp-hello.c, line 27.
(gdb) r
Breakpoint 1, main.omp_fn.0 (.omp_data_i=0x0) at omp-hello.c:27
27 printf("Hello World from thread = %d\n", tid);
(gdb) p tid
$1 = 2
(gdb) c
Continuing.
[Switching to Thread 0x7ffff3ffc710 (LWP 19165)]
Breakpoint 1, main.omp_fn.0 (.omp_data_i=0x0) at omp-hello.c:27
27 printf("Hello World from thread = %d\n", tid);
(gdb) p tid
$2 = 6
(gdb) bt
#0 main.omp_fn.0 (.omp_data_i=0x0) at omp-hello.c:27
#1 0x00007ffff7bd8062 in gomp_thread_start (xdata=<value optimized out>) at ../../../libgomp/team.c:115
#2 0x00007ffff79b9d5b in start_thread (arg=0x7ffff3ffc710) at pthread_create.c:301
#3 0x00007ffff76ff85d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115
(gdb) _
> > There is fix of OMP stepping:
> > http://cvs.fedoraproject.org/viewvc/rpms/gdb/devel/gdb-bz533176-fortran-omp-step.patch?content-type=text%2Fplain&view=co
>
> I can step in/over properly inside a parallel block
With FSF GDB:
(gdb) start
[...]
Temporary breakpoint 1, main (argc=1, argv=0x7fffffffe028) at omp-hello.c:22
22 #pragma omp parallel private(nthreads, tid)
(gdb) next
[New Thread 0x7ffff7201710 (LWP 30723)]
[New Thread 0x7ffff6800710 (LWP 30730)]
[New Thread 0x7ffff5dff710 (LWP 30740)]
[New Thread 0x7ffff53fe710 (LWP 30741)]
[New Thread 0x7ffff49fd710 (LWP 30742)]
[New Thread 0x7ffff3ffc710 (LWP 30744)]
[New Thread 0x7ffff35fb710 (LWP 30748)]
Hello World from thread = 6
Hello World from thread = 7
Hello World from thread = 4
Hello World from thread = 2
Hello World from thread = 3
Hello World from thread = 1
Hello World from thread = 0
Number of threads = 8
Hello World from thread = 5
38 }
(gdb)
With patched GDB (gdb-7.1.90.20100721-6.fc14.x86_64):
(gdb) start
[...]
Temporary breakpoint 1, main (argc=1, argv=0x7fffffffe028) at omp-hello.c:22
22 #pragma omp parallel private(nthreads, tid)
(gdb) next
[New Thread 0x7ffff7201710 (LWP 11368)]
[New Thread 0x7ffff6800710 (LWP 11369)]
[New Thread 0x7ffff5dff710 (LWP 11370)]
[New Thread 0x7ffff53fe710 (LWP 11371)]
[New Thread 0x7ffff49fd710 (LWP 11372)]
[New Thread 0x7ffff3ffc710 (LWP 11373)]
[New Thread 0x7ffff35fb710 (LWP 11374)]
Hello World from thread = 7
main.omp_fn.0 (.omp_data_i=0x0) at omp-hello.c:26
26 tid = omp_get_thread_num();
(gdb)
> Is the fix you mention above fortran-specific?
No.
> Is it in 7.1.x?
No, this is not in FSF GDB, it is only a hack, there should be some proper
DWARF annotation instead.
Regards,
Jan
prev parent reply other threads:[~2010-08-31 3:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-27 15:28 Hicham Mouline
2010-08-30 17:50 ` Michael Snyder
2010-08-30 17:57 ` Jan Kratochvil
2010-08-30 23:21 ` Hicham Mouline
2010-08-31 3:42 ` Jan Kratochvil [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100831034147.GA26924@host1.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb@sourceware.org \
--cc=hicham@mouline.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox