Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* "No registers" or "No inferior to debug"?
@ 2003-10-20 21:28 Andrew Cagney
  2003-10-20 21:43 ` Kevin Buettner
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2003-10-20 21:28 UTC (permalink / raw)
  To: gdb

Hello,

	Ref: default.exp

At present get_selected_frame(), when there is no inferior(1), throws 
the error:

	No registers

Except for the case where the user types:

	(gdb) info registers
	No registers

this message won't be very enlightening.  For instance, a user trying to 
do a return when there is no process to debug would (theoretically) 
encounter the error:

	(gdb) return
	No registers

I'm wondering if the error message should be standardized vis:

	(gdb) info registers
	No inferior to debug
	(gdb) return
	No inferior to debug

Looking through default.exp I see plenty of alternatives vis:

	The program is not being run.
	No stack
	No frame selected
	No registers
	No frame selected

Thoughts?  Suggestions?

Andrew

(1) I'm treating a core file as an inferior here (reasonable?).


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

* Re: "No registers" or "No inferior to debug"?
  2003-10-20 21:28 "No registers" or "No inferior to debug"? Andrew Cagney
@ 2003-10-20 21:43 ` Kevin Buettner
  0 siblings, 0 replies; 8+ messages in thread
From: Kevin Buettner @ 2003-10-20 21:43 UTC (permalink / raw)
  To: Andrew Cagney, gdb

On Oct 20,  5:28pm, Andrew Cagney wrote:

> I'm wondering if the error message should be standardized vis:
> 
> 	(gdb) info registers
> 	No inferior to debug
> 	(gdb) return
> 	No inferior to debug

This sounds reasonable to me.  It is certainly better than seeing the
"No registers" message.

Kevin


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

* Re: "No registers" or "No inferior to debug"?
  2003-10-21 18:55       ` Eli Zaretskii
@ 2003-10-21 19:56         ` Andrew Cagney
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Cagney @ 2003-10-21 19:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Andrew Cagney, mec, gdb

> Date: Tue, 21 Oct 2003 11:26:32 -0400
>> From: Andrew Cagney <ac131313@redhat.com>
> 
>> > 
>> >    (gdb) info registers
>> >    No program or core file to debug, so no registers.
> 
>> 
>> The point at which the error is detected and thrown is a long way from 
>> "info registers" so customizing it to mention ", so no registers" will 
>> be painful.
> 
> 
> Is it possible to add "No registers." on a separate line after the
> thread of execution comes back to "info registers"?  That would
> produce

>     (gdb) info registers
>     No program or core file to debug.
>     No registers.

The error throws gdb out of the info registers function, so no, not 
without other changes.

Having seen michael's comments, I also suspect that "No registers" isn't 
that helpful.  I'd expect a user to fix this problem by looking for a 
program or core file, and not by looking for registers :-)

Anyway, for the immediate problem at hand ("return" and return_command), 
I tweaked toe code so that it directly checked that there was a target 
before doing anything and then issued the existing response.

Andrew



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

* Re: "No registers" or "No inferior to debug"?
  2003-10-21 15:26     ` Andrew Cagney
@ 2003-10-21 18:55       ` Eli Zaretskii
  2003-10-21 19:56         ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2003-10-21 18:55 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: mec, gdb

> Date: Tue, 21 Oct 2003 11:26:32 -0400
> From: Andrew Cagney <ac131313@redhat.com>
> > 
> >    (gdb) info registers
> >    No program or core file to debug, so no registers.
> 
> The point at which the error is detected and thrown is a long way from 
> "info registers" so customizing it to mention ", so no registers" will 
> be painful.

Is it possible to add "No registers." on a separate line after the
thread of execution comes back to "info registers"?  That would
produce

    (gdb) info registers
    No program or core file to debug.
    No registers.


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

* Re: "No registers" or "No inferior to debug"?
  2003-10-21  5:50   ` Eli Zaretskii
@ 2003-10-21 15:26     ` Andrew Cagney
  2003-10-21 18:55       ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2003-10-21 15:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: mec, gdb

> 
> Right.  So how about
> 
>    (gdb) info registers
>    No program or core file to debug, so no registers.

The point at which the error is detected and thrown is a long way from 
"info registers" so customizing it to mention ", so no registers" will 
be painful.

Explicit mention of both program and core file would be helpful though.

Andrew



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

* Re: "No registers" or "No inferior to debug"?
  2003-10-20 22:39 ` Andrew Cagney
@ 2003-10-21  5:50   ` Eli Zaretskii
  2003-10-21 15:26     ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2003-10-21  5:50 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: mec, gdb

> Date: Mon, 20 Oct 2003 18:39:06 -0400
> From: Andrew Cagney <ac131313@redhat.com>
> > 
> >   (gdb) info registers
> >   The program is not being run
> >   User: "Oh, okay, I guess I can't see the registers right now."
> > 
> > So I like "The program is not being run."
> > "The inferior program is not being run." would be okay too.
> 
> Info registers works with a core file.  And that is definitly not being run.

Right.  So how about

   (gdb) info registers
   No program or core file to debug, so no registers.


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

* Re: "No registers" or "No inferior to debug"?
  2003-10-20 21:56 Michael Elizabeth Chastain
@ 2003-10-20 22:39 ` Andrew Cagney
  2003-10-21  5:50   ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2003-10-20 22:39 UTC (permalink / raw)
  To: Michael Elizabeth Chastain; +Cc: gdb

> Look at your use case:
> 
>   (gdb) info registers
>   No registers
>   User: "Huh?  How come there aren't any registers?  Wha?"
> 
>   (gdb) info registers
>   The program is not being run
>   User: "Oh, okay, I guess I can't see the registers right now."
> 
> So I like "The program is not being run."
> "The inferior program is not being run." would be okay too.

Info registers works with a core file.  And that is definitly not being run.

Andrew



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

* Re: "No registers" or "No inferior to debug"?
@ 2003-10-20 21:56 Michael Elizabeth Chastain
  2003-10-20 22:39 ` Andrew Cagney
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Elizabeth Chastain @ 2003-10-20 21:56 UTC (permalink / raw)
  To: ac131313, gdb

Look at your use case:

  (gdb) info registers
  No registers
  User: "Huh?  How come there aren't any registers?  Wha?"

  (gdb) info registers
  The program is not being run
  User: "Oh, okay, I guess I can't see the registers right now."

So I like "The program is not being run."
"The inferior program is not being run." would be okay too.

Michael C


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

end of thread, other threads:[~2003-10-21 19:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-20 21:28 "No registers" or "No inferior to debug"? Andrew Cagney
2003-10-20 21:43 ` Kevin Buettner
2003-10-20 21:56 Michael Elizabeth Chastain
2003-10-20 22:39 ` Andrew Cagney
2003-10-21  5:50   ` Eli Zaretskii
2003-10-21 15:26     ` Andrew Cagney
2003-10-21 18:55       ` Eli Zaretskii
2003-10-21 19:56         ` Andrew Cagney

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