This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: break doesn't work with thread on mips


"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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]