Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* break doesn't work with thread on mips
@ 2002-03-06  1:05 H . J . Lu
  2002-03-06 17:29 ` Michael Snyder
  2002-03-06 19:35 ` Daniel Jacobowitz
  0 siblings, 2 replies; 8+ messages in thread
From: H . J . Lu @ 2002-03-06  1:05 UTC (permalink / raw)
  To: GDB

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? It sounds like the old bug:

http://sources.redhat.com/ml/gdb/2001-11/msg00156.html

Has it been fixed?


H.J.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: break doesn't work with thread on mips
  2002-03-06  1:05 break doesn't work with thread on mips H . J . Lu
@ 2002-03-06 17:29 ` Michael Snyder
  2002-03-06 17:32   ` H . J . Lu
  2002-03-06 19:35 ` Daniel Jacobowitz
  1 sibling, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2002-03-06 17:29 UTC (permalink / raw)
  To: H . J . Lu; +Cc: GDB

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: break doesn't work with thread on mips
  2002-03-06 17:29 ` Michael Snyder
@ 2002-03-06 17:32   ` H . J . Lu
  2002-03-06 17:36     ` Michael Snyder
  0 siblings, 1 reply; 8+ messages in thread
From: H . J . Lu @ 2002-03-06 17:32 UTC (permalink / raw)
  To: Michael Snyder; +Cc: GDB

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.


H.J.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: break doesn't work with thread on mips
  2002-03-06 17:32   ` H . J . Lu
@ 2002-03-06 17:36     ` Michael Snyder
  2002-03-06 17:47       ` H . J . Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2002-03-06 17:36 UTC (permalink / raw)
  To: H . J . Lu; +Cc: GDB

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: break doesn't work with thread on mips
  2002-03-06 17:36     ` Michael Snyder
@ 2002-03-06 17:47       ` H . J . Lu
  2002-03-06 17:56         ` Michael Snyder
  0 siblings, 1 reply; 8+ messages in thread
From: H . J . Lu @ 2002-03-06 17:47 UTC (permalink / raw)
  To: Michael Snyder; +Cc: GDB

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: break doesn't work with thread on mips
  2002-03-06 17:47       ` H . J . Lu
@ 2002-03-06 17:56         ` Michael Snyder
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Snyder @ 2002-03-06 17:56 UTC (permalink / raw)
  To: H . J . Lu; +Cc: GDB

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: break doesn't work with thread on mips
  2002-03-06  1:05 break doesn't work with thread on mips H . J . Lu
  2002-03-06 17:29 ` Michael Snyder
@ 2002-03-06 19:35 ` Daniel Jacobowitz
  2002-03-06 23:02   ` H . J . Lu
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2002-03-06 19:35 UTC (permalink / raw)
  To: H . J . Lu; +Cc: GDB

On Wed, Mar 06, 2002 at 01:05:00AM -0800, 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? It sounds like the old bug:
> 
> http://sources.redhat.com/ml/gdb/2001-11/msg00156.html
> 
> Has it been fixed?

Are you using current GDB?

Program exited normally.
(gdb) del 1
(gdb) b main
Breakpoint 2 at 0x4009f4: file twothreads.c, line 16.


It works for me.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: break doesn't work with thread on mips
  2002-03-06 19:35 ` Daniel Jacobowitz
@ 2002-03-06 23:02   ` H . J . Lu
  0 siblings, 0 replies; 8+ messages in thread
From: H . J . Lu @ 2002-03-06 23:02 UTC (permalink / raw)
  To: GDB

On Wed, Mar 06, 2002 at 10:35:07PM -0500, Daniel Jacobowitz wrote:
> On Wed, Mar 06, 2002 at 01:05:00AM -0800, 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? It sounds like the old bug:
> > 
> > http://sources.redhat.com/ml/gdb/2001-11/msg00156.html
> > 
> > Has it been fixed?
> 
> Are you using current GDB?
> 
> Program exited normally.
> (gdb) del 1
> (gdb) b main
> Breakpoint 2 at 0x4009f4: file twothreads.c, line 16.
> 

It seems fixed in 5.2.


H.J.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-03-07  7:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-06  1:05 break doesn't work with thread on mips H . J . Lu
2002-03-06 17:29 ` Michael Snyder
2002-03-06 17:32   ` H . J . Lu
2002-03-06 17:36     ` Michael Snyder
2002-03-06 17:47       ` H . J . Lu
2002-03-06 17:56         ` Michael Snyder
2002-03-06 19:35 ` Daniel Jacobowitz
2002-03-06 23:02   ` H . J . Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox