From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17797 invoked by alias); 29 Jan 2003 00:15: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 17741 invoked from network); 29 Jan 2003 00:15:28 -0000 Received: from unknown (HELO rwcrmhc52.attbi.com) (216.148.227.88) by 172.16.49.205 with SMTP; 29 Jan 2003 00:15:28 -0000 Received: from rwcrwbc72 ([204.127.198.102]) by rwcrmhc52.attbi.com (rwcrmhc52) with SMTP id <2003012900152705200dr8m4e>; Wed, 29 Jan 2003 00:15:27 +0000 Received: from [129.188.33.221] by rwcrwbc72; Wed, 29 Jan 2003 00:15:26 +0000 From: yuming5@attbi.com To: gdb@sources.redhat.com Subject: Help: cannot break into shared libraries on LinuxPPC Date: Wed, 29 Jan 2003 00:15:00 -0000 X-Authenticated-Sender: eXVtaW5nNUBhdHRiaS5jb20= X-SW-Source: 2003-01/txt/msg00469.txt.bz2 Message-ID: <20030129001500.-zEl0GOCfy_VBpZIV_3rGljhhMnuotoZU71et_9zfKk@z> Hello, 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? Thanks, Yuming 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 (gdb) Single stepping until exit from function libErrPrint, which has no line number information. >>>libErrPrint, 3 main () at main.c:14 14 return(0); /* now returned back to main */ ---------------------------------------------------------------- The example shell script used to create the shared library and executable (ttt): ---------------------------------------------------------------------- LIBPRE3=/home/mark/test/sharedlib gcc -g -fPIC -c -o printlib.o printlib.c ar r libfp_shr.a printlib.o #create the shared library libmp_shr.so ld -shared -soname libmp_shr.so -o libmp_shr.so -L$LIBPRE3 --whole-archive - lfp_shr ldconfig -l ../sharedlib/libmp_shr.so #create executable ttt gcc -g -I../sharedlib -L../sharedlib -o ttt main.c -lmp_shr ----------------------------------------------------------------