From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26786 invoked by alias); 29 Jan 2003 01:58:29 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 26769 invoked from network); 29 Jan 2003 01:58:29 -0000 Received: from unknown (HELO mx1.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 29 Jan 2003 01:58:29 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h0T1T9f04728 for ; Tue, 28 Jan 2003 20:29:09 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h0T1wSa29939; Tue, 28 Jan 2003 20:58:28 -0500 Received: from localhost.localdomain (vpn50-39.rdu.redhat.com [172.16.50.39]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h0T1wSG24815; Tue, 28 Jan 2003 20:58:28 -0500 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h0T1wMR08300; Tue, 28 Jan 2003 18:58:22 -0700 Date: Wed, 29 Jan 2003 01:58:00 -0000 From: Kevin Buettner Message-Id: <1030129015821.ZM8299@localhost.localdomain> In-Reply-To: yuming5@attbi.com "Help: cannot break into shared libraries on LinuxPPC" (Jan 29, 12:15am) References: <200301290009.h0T09w123901@mx2.redhat.com> To: yuming5@attbi.com, gdb@sources.redhat.com Subject: Re: Help: cannot break into shared libraries on LinuxPPC MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-01/txt/msg00471.txt.bz2 On Jan 29, 12:15am, yuming5@attbi.com wrote: > I have a problem that the gdb cannot break into the shared library -- actually, > it successfully breaks into the very first function defined in the shared > library source file(i.e. libPrint() in printlib.c, see the following example), > but failed to break into the other functions in that same source file (i.e. > libErrPrint() in printlib.c). > > This was run with Linux2.2.17 on PowerPC. Other information: > gcc version 2.95.3, GNU ld and ar version 2.10.91. > > Please see below the gdb output and the shell script used to create the > executable and shared library. > > Any idea what went wrong? [...] > The gdb output: > it didn't break into libErrPrint(). > ------------------------------------------------------------------ > ... ... > Breakpoint 1, libPrint (a=3) at printlib.c:9 > 9 b = a; > (gdb) n > 10 printf(">>>libPrint, %d\n",b); > (gdb) > >>>libPrint, 3 > 11 } > (gdb) > main () at main.c:13 > 13 libErrPrint(3); > (gdb) step > 0x30025fc4 in .LC0 () from /lib/ld.so.1 > (gdb) n > Single stepping until exit from function .LC0, > which has no line number information. > > Breakpoint 2, 0x0ffdf4ac in libErrPrint (a=268367100) > from /home/mark/test/sharedlib/libmp_shr.so I'm not sure what's going on. You've hit the breakpoint in libErrPrint(), but there's no line number information associated with it. I'm don't how this can be since (you say) libPrint() and libErrPrint() are in the same source file and libPrint() clearly does have line number information associated with it. Try using objdump to look at the contents of the object files and libraries to make sure that they contain everything they should. Kevin