From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31376 invoked by alias); 31 Aug 2010 03:42:00 -0000 Received: (qmail 31364 invoked by uid 22791); 31 Aug 2010 03:41:59 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 31 Aug 2010 03:41:54 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7V3fpEe010810 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 30 Aug 2010 23:41:52 -0400 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7V3fncG013141 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 30 Aug 2010 23:41:51 -0400 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o7V3fmld019331; Tue, 31 Aug 2010 05:41:48 +0200 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o7V3fmM7019326; Tue, 31 Aug 2010 05:41:48 +0200 Date: Tue, 31 Aug 2010 03:42:00 -0000 From: Jan Kratochvil To: Hicham Mouline Cc: gdb@sourceware.org Subject: Re: gomp status Message-ID: <20100831034147.GA26924@host1.dyn.jankratochvil.net> References: <20100827112846.6745@web001.roc2.bluetie.com> <20100830175734.GA11759@host1.dyn.jankratochvil.net> <000d01cb489a$0b8c2b10$22a48130$@org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000d01cb489a$0b8c2b10$22a48130$@org> User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00171.txt.bz2 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=) 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