From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2453 invoked by alias); 15 Nov 2001 16:55:12 -0000 Mailing-List: contact gdb-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 2414 invoked from network); 15 Nov 2001 16:55:09 -0000 Received: from unknown (HELO ocean.lucon.org) (24.176.137.160) by sourceware.cygnus.com with SMTP; 15 Nov 2001 16:55:09 -0000 Received: by ocean.lucon.org (Postfix, from userid 1000) id BECD7125C0; Thu, 15 Nov 2001 08:55:08 -0800 (PST) Date: Sat, 03 Nov 2001 16:54:00 -0000 From: "H . J . Lu" To: GDB Subject: Re: PATCH: Re: [RFHelp] Linux, threads, and regsets in thread_db Message-ID: <20011115085508.D10945@lucon.org> References: <20010924212808.A20851@nevyn.them.org> <20011003170848.A30843@lucon.org> <20011003211007.A12210@nevyn.them.org> <20011114134521.A25645@lucon.org> <20011115114841.A5118@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011115114841.A5118@nevyn.them.org>; from drow@mvista.com on Thu, Nov 15, 2001 at 11:48:41AM -0500 X-SW-Source: 2001-11/txt/msg00054.txt.bz2 On Thu, Nov 15, 2001 at 11:48:41AM -0500, Daniel Jacobowitz wrote: > On Wed, Nov 14, 2001 at 01:45:21PM -0800, H . J . Lu wrote: > > On Wed, Oct 03, 2001 at 09:10:07PM -0400, Daniel Jacobowitz wrote: > > > > > > > > > > > > > How far have you gone on Linux/mips? I know gdb 5.1 doesn't work with > > > > threads on Linux/mips. Does your change fix it? I'd like to clean up > > > > glibc for mips on this. > > > > > > Yes. Debugging threads works reasonably well. I'm going to do more > > > work about this in the next couple of months too, I think; after I go > > > back to gdbserver for a little while. > > > > I am still having problems with threads on mips. I cannot set break > > point after target has run: > > > > (gdb) run > > ... > > (gdb) b main > > reading register sp (#29): No such process. > > > > The problem is gdb tries to read sp register in thread mode. This patch > > seems to work for me. > > This should not be a problem. It works fine for me. I'll step through > it later tonight and try to figure out what the difference is from what > you're seeing. In my case, gdb in thread mode will cal "fetch_register" in infptrace.c. Since nothing is running, I got reading register sp (#29): No such process. I don't know why it works for you. > > > Another problem is when I set a break point in a thread function, only > > the first thread stops. I got > > > > (gdb) b process > > Breakpoint 1 at 0x400a38: file Examples/ex1.c, line 14. > > (gdb) r > > Starting program: /export/build/gnu/glibc/build-mipsel-linux/linuxthreads/ex1 > > [New Thread 1024 (LWP 26552)] > > [New Thread 2049 (LWP 26569)] > > [New Thread 1026 (LWP 26570)] > > [Switching to Thread 1026 (LWP 26570)] > > > > Breakpoint 1, process (arg=0x1000) at Examples/ex1.c:14 > > 14 fprintf (stderr, "Starting process %s\n", (char *) arg); > > ... > > Program received signal SIGTRAP, Trace/breakpoint trap. > > [Switching to Thread 1024 (LWP 26552)] > > 0x2ab8de24 in __syscall_rt_sigsuspend () at soinit.c:56 > > 56 soinit.c: No such file or directory. > > > > But it may be a kernel bug. > > Something is suspicious here. The process in sigsuspend should have > been stopped with SIGSTOP, not SIGTRAP... is this an example program > from glibc? Yes, linuxthreads/ex1 from glibc. > > > H.J. > > --- > > 2001-11-14 H.J. Lu (hjl@gnu.org) > > > > * mips-tdep.c (heuristic_proc_desc): Read register only when > > target is running. > > I can't see why this changes behavior in the way you're seeing. I'm Why do you think that? Why does anyone want to read a register when nothing is running? > pretty sure it isn't right. H.J.