From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15516 invoked by alias); 7 Mar 2002 01:56:01 -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 15431 invoked from network); 7 Mar 2002 01:55:57 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 7 Mar 2002 01:55:57 -0000 Received: from redhat.com (notinuse.cygnus.com [205.180.231.12]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id RAA03667; Wed, 6 Mar 2002 17:55:54 -0800 (PST) Message-ID: <3C86C67D.D5D9D9A0@redhat.com> Date: Wed, 06 Mar 2002 17:56:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2smp i686) X-Accept-Language: en MIME-Version: 1.0 To: "H . J . Lu" CC: GDB Subject: Re: break doesn't work with thread on mips References: <20020306010500.A12030@lucon.org> <3C86C062.3E0F29D2@redhat.com> <20020306173224.C26643@lucon.org> <3C86C1D6.5AF7706F@redhat.com> <20020306174711.A26867@lucon.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-03/txt/msg00029.txt.bz2 "H . J . Lu" wrote: > > 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. Oh. Well, from the log you've shown above, I don't see any indication that the process is dead. Why is it dead? How does gdb know that it's dead?