From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18091 invoked by alias); 12 Jul 2006 18:12:58 -0000 Received: (qmail 18073 invoked by uid 22791); 12 Jul 2006 18:12:57 -0000 X-Spam-Check-By: sourceware.org Received: from 203.197.88.2.ILL-PUNE.static.vsnl.net.in (HELO marvin.codito.net) (203.197.88.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 12 Jul 2006 18:12:51 +0000 Received: from [192.168.100.141] ([220.225.32.98]) (authenticated bits=0) by marvin.codito.net (8.13.5/8.13.5/Debian-3) with ESMTP id k6CIHis5008055 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 12 Jul 2006 23:47:46 +0530 Message-ID: <44B53A5D.7090505@codito.com> Date: Wed, 12 Jul 2006 18:12:00 -0000 From: Kunal Parmar Reply-To: kunal.parmar@codito.com User-Agent: Thunderbird 1.5.0.4 (X11/20060615) MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: shared library symbols not loaded automatically Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Status: Clean X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00054.txt.bz2 Hello, I am trying to debug a program which uses shared libraries. My host is i386-linux and target is arm-linux. While debugging, gdb shows me the shared libraries used by my program but it does not load the symbols automatically (auto-solib-add is set). I have to explicitly use the sharedlibrary command after which the shared library symbols are read in. Here is the GDB session - > GNU gdb 6.3 > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and > you are > welcome to change it and/or distribute copies of it under certain > conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for > details. > This GDB was configured as "--host=i686-pc-linux-gnu > --target=arm-linux"... > (gdb) target remote 192.168.100.226:7777 > Remote debugging using 192.168.100.226:7777 > 0x40000b10 in ?? () > (gdb) b main > Breakpoint 1 at 0x85f4: file foo.c, line 5. > (gdb) c > Continuing. > > Breakpoint 1, main () at foo.c:5 > 5 printf("%d\n", add(3,4)); > (gdb) info sharedlibrary > From To Syms Read Shared Object Library > 0x4001e66c 0x4001e810 No ./libadd.so > 0x40027640 0x400277d0 No ./libsub.so > 0x40045170 0x40122328 No /lib/libc.so.6 > 0x40157800 0x4015e3ec No /lib/libgcc_s.so.1 > 0x40000770 0x4001117f No /lib/ld-linux.so.2 > (gdb) show auto-solib-add > Autoloading of shared library symbols is on. > (gdb) sharedlibrary > Reading symbols from /home/kunal/tmp/overflow/libadd.so...done. > Loaded symbols for ./libadd.so > Reading symbols from /home/kunal/tmp/overflow/libsub.so...done. > Loaded symbols for ./libsub.so > Reading symbols from /lib/libc.so.6...done. > Loaded symbols for /lib/libc.so.6 > Reading symbols from /lib/libgcc_s.so.1...done. > Loaded symbols for /lib/libgcc_s.so.1 > Reading symbols from /lib/ld-linux.so.2...done. > Loaded symbols for /lib/ld-linux.so.2 > (gdb) info sharedlibrary > From To Syms Read Shared Object Library > 0x4001e66c 0x4001e810 Yes ./libadd.so > 0x40027640 0x400277d0 Yes ./libsub.so > 0x40045170 0x40122328 Yes /lib/libc.so.6 > 0x40157800 0x4015e3ec Yes /lib/libgcc_s.so.1 > 0x40000770 0x4001117f Yes /lib/ld-linux.so.2 > (gdb) I want the shared library symbols to be read in automatically. Any help will be appreciated. Regards, Kunal Parmar