From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30650 invoked by alias); 17 Jan 2003 14:56:10 -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 30639 invoked from network); 17 Jan 2003 14:56:08 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 17 Jan 2003 14:56:08 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18ZZnW-0008C2-00; Fri, 17 Jan 2003 10:56:50 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18ZXuh-0008Mh-00; Fri, 17 Jan 2003 09:56:07 -0500 Date: Fri, 17 Jan 2003 14:56:00 -0000 From: Daniel Jacobowitz To: Frank van Eijkelenburg Cc: Gnu Debugger mailing list Subject: Re: multithreaded remote debugging Message-ID: <20030117145607.GA29639@nevyn.them.org> Mail-Followup-To: Frank van Eijkelenburg , Gnu Debugger mailing list References: <20030117141359.GA20241@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i X-SW-Source: 2003-01/txt/msg00306.txt.bz2 On Fri, Jan 17, 2003 at 03:51:48PM +0100, Frank van Eijkelenburg wrote: > > > > > Hi, I'm new to gdb. I try to remote debug an application: > > > > > > > > > > I have a linux machine with redhat installed (2.4.7-10), this > > > > is the host. > > > > > On the target an ARM processor is running with linux kernel > > 2.4.16. I > > > > > compiled gdb on the host (with target arm-linux). I also > > cross-compiled > > > > > gdbserver. My application (which I want to debug) is compiled > > > > with compiler > > > > > option -g. I can start the gdbserver on the target and gdb on > > > > the host and > > > > > have a connection by tcp/ip. The application is multithreaded > > > > and uses the > > > > > libpthread library. If I ignore the SIG32 signal (with "handle > > > > SIG32 nostop" > > > > > and "handle SIG32 noprint") I can run the application. However, > > > > if I try to > > > > > execute "info threads" I only get information about one > > thread (the main > > > > > thread??). I can put breakpoints in the main thread and > > step through the > > > > > code, but if I put a breakpoint in another thread, the debugger > > > > will stop, > > > > > but I cannot step through the code: > > > > > > > > > > Program received signal SIGTRAP, Trace/breakpoint trap. > > > > > 0x400ab2e4 in ?? () > > > > > (gdb) n > > > > > Cannot find bounds of current function > > > > > > > > > > What do I wrong or is it not possible to step through the > > code of other > > > > > threads beside the main thread? > > > > > > > > You neglected to say what version you're using. We only got support > > > > for remote thread debugging between GDB 5.2 and 5.3; if you aren't > > > > using 5.3, you should try it. > > > > > > > > > > Sorry about that. I am using GDB version 5.3 with the above described > > > problems. > > > > Do you have libthread_db installed on your target, and on your cross > > development system so that gdbserver can link to it? Look at the > > output of "configure" in the gdbserver directory, or at config.log. > > > > I think the problem is in the libraries. I tried some simple sample code and > debugged this on the host machine (it was linking /lib/libpthread.so.0). > This worked like I expected (I could see multiple threads with the "info > threads" command). > Gdbserver is crosscompiled with the libthread_db.so.1, which is also > installed at the target. But the application is linked against a > libpthread.a. In order to do remote thread debugging, you need: - libthread_db.so.1 on the target - a copy of the application and any dynamically linked libraries on the host where GDB can access them The copy on the host must not be stripped, because it must contain certain symbols which libthread_db.so.1 looks up. If those are both the case, could you post a session log; use "set debug remote 1" before connecting and run until a SIG32. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer