From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28379 invoked by alias); 31 Oct 2005 19:55:34 -0000 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 Received: (qmail 28326 invoked by uid 22791); 31 Oct 2005 19:55:26 -0000 Received: from elbarto.betaversion.net (HELO elbarto.betaversion.net) (82.165.28.81) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 31 Oct 2005 19:55:26 +0000 Received: by elbarto.betaversion.net (Postfix, from userid 8) id E7674A3705; Mon, 31 Oct 2005 20:55:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by elbarto.betaversion.net (Postfix) with ESMTP id 4182CA3729; Mon, 31 Oct 2005 20:55:18 +0100 (CET) Received: from elbarto.betaversion.net ([127.0.0.1]) by localhost (elbarto.betaversion.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23409-01; Mon, 31 Oct 2005 20:55:17 +0100 (CET) Received: from [217.185.95.215] (bens-d9b95fd7.pool.mediaWays.net [217.185.95.215]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by elbarto.betaversion.net (Postfix) with ESMTP id CCD50A3705; Mon, 31 Oct 2005 20:55:16 +0100 (CET) Message-ID: <436676B4.9030603@betaversion.net> Date: Mon, 31 Oct 2005 19:55:00 -0000 From: Frank Meerkoetter User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050727) MIME-Version: 1.0 To: Daniel Jacobowitz CC: gdb@sources.redhat.com Subject: Re: Remote debugging and dynamic libraries References: <20051027105200.0cya97mnpnwo84sg@admin.betaversion.net> <20051027143943.GA23938@nevyn.them.org> <20051027144115.GA24055@nevyn.them.org> In-Reply-To: <20051027144115.GA24055@nevyn.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-10/txt/msg00234.txt.bz2 Daniel Jacobowitz wrote: >>i'm trying to remote debug a program running on an arm system running >>linux but i ran into various problems. If i interrupt the >>debugged program i can't get symbolic information where it stopped. >>Also backtraces don't seem to work. >> >>frank@linux:~/> /usr/local/bin/arm-linux-gdb >>GNU gdb 6.3 >>This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-linux". >>(gdb) target remote 192.168.1.133:5555 >>Remote debugging using 192.168.1.133:5555 >>0x400028b0 in ?? () >>(gdb) symbol-file test >> >> > >Don't do this. Use "file", not "symbol-file". > >Can you tell me where you found anything which suggested that you >should use symbol-file? This bug is reported several times a year, and >I still don't know where the incorrect documentation is - I don't think >it's part of GDB. > > You're right. I picked it up in some mailinglist archive while searching for a solution to my problem. >Without an "exec file" loaded, which symbol-file does not do, GDB won't >find the dynamic loader or be able to load shared libraries. > > >>1) >> set solib-absolute-prefix /usr/local/arm/arm-linux/ >> >> > >This is the correct way - IFF the directory under that path looks like >a root filesystem. If it's laid out like an old-style cross toolchain, >this may not work. Paths should match the paths on the target. > > I gave it a try using "file test" and "set solib-absolute-prefix /usr/local/arm/arm-linux/" but had no success so far. frank@linux:~/uclibc_kram/apdf> arm-linux-gdb GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-linux". (gdb) file test Reading symbols from /home/frank/test...done. (gdb) set solib-absolute-prefix /usr/local/arm/arm-linux/ (gdb) target remote 192.168.1.133:5555 Remote debugging using 192.168.1.133:5555 0x000080e0 in ?? () (gdb) l 1 int main() { 2 while(1) 3 { 4 printf("bla"); 5 6 } 7 8 } (gdb) b 1 Breakpoint 1 at 0x8428: file main.c, line 1. (gdb) c Continuing. Breakpoint 1, main () at main.c:1 1 int main() { (gdb) n 2 while(1) (gdb) n 0x0001a12c in ?? () (gdb) n Cannot find bounds of current function (gdb) n Cannot find bounds of current function (gdb) n Cannot find bounds of current function (gdb) The program is running. Exit anyway? (y or n) y frank@linux:~/uclibc_kram/apdf> arm-linux-gdb GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-linux". (gdb) file test Reading symbols from /home/frank/test...done. (gdb) set solib-absolute-prefix /usr/local/arm/arm-linux/ (gdb) target remote 192.168.1.133:5555 Remote debugging using 192.168.1.133:5555 0x000080e0 in ?? () (gdb) c Continuing. Program received signal SIGINT, Interrupt. 0x000080e0 in ?? () (gdb) c Continuing. Program received signal SIGINT, Interrupt. 0x000282b4 in ?? () (gdb) bt #0 0x000282b4 in ?? () test depends only on the libc and the dynamic linker. On the target these files are installed in /lib. The GDB should be able to found them in /usr/local/arm/arm-linux/lib. Any ideas how i can solve this problem? Regards, Frank