From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28211 invoked by alias); 7 Mar 2002 01:47:13 -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 28153 invoked from network); 7 Mar 2002 01:47:12 -0000 Received: from unknown (HELO rwcrmhc51.attbi.com) (204.127.198.38) by sources.redhat.com with SMTP; 7 Mar 2002 01:47:12 -0000 Received: from ocean.lucon.org ([12.234.143.38]) by rwcrmhc51.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020307014712.XISX2626.rwcrmhc51.attbi.com@ocean.lucon.org>; Thu, 7 Mar 2002 01:47:12 +0000 Received: by ocean.lucon.org (Postfix, from userid 1000) id 6CCEC125C3; Wed, 6 Mar 2002 17:47:11 -0800 (PST) Date: Wed, 06 Mar 2002 17:47:00 -0000 From: "H . J . Lu" To: Michael Snyder Cc: GDB Subject: Re: break doesn't work with thread on mips Message-ID: <20020306174711.A26867@lucon.org> References: <20020306010500.A12030@lucon.org> <3C86C062.3E0F29D2@redhat.com> <20020306173224.C26643@lucon.org> <3C86C1D6.5AF7706F@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3C86C1D6.5AF7706F@redhat.com>; from msnyder@redhat.com on Wed, Mar 06, 2002 at 05:26:46PM -0800 X-SW-Source: 2002-03/txt/msg00028.txt.bz2 On Wed, Mar 06, 2002 at 05:26:46PM -0800, Michael Snyder wrote: > "H . J . Lu" wrote: > > > > On Wed, Mar 06, 2002 at 05:20:34PM -0800, Michael Snyder wrote: > > > "H . J . Lu" wrote: > > > > > > > > When I do > > > > > > > > # gdb a.out > > > > (gdb) b main > > > > Breakpoint 1 at 0x400910: file x.c, line 25. > > > > (gdb) r > > > > (gdb) del 1 > > > > (gdb) b main > > > > reading register sp (#29): No such process. > > > > > > > > That is break no longer works after the program runs if thread is used. > > > > Why does gdb want to read sp anyway? > > > > > > Probably because it has to analyze the prologue of main, > > > to place the breakpoint after the prologue. Many prologue > > > analyzers will poke around at the stack. > > > > Why does gdb do that? The program has stopped. > > You gave it a symbol, "main". It knows that you don't really want > to set a breakpoint at the address corresponding to that symbol > (the label or entry-point of main), but instead you would really > like to set a breakpoint at the first instruction after the prologue > of main. It's not really useful to set a breakpoint before that. > > The fact that you happen to be sitting at that exact address is > irrelevant -- gdb doesn't know that. My question is why gdb pokes a dead process. There is nothing to poke with. FYI, it only happens with thread. H.J.