Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Elena Zannoni <ezannoni@redhat.com>
To: gdb@sources.redhat.com
Subject: Behavior of 'until' command
Date: Wed, 13 Nov 2002 11:26:00 -0000	[thread overview]
Message-ID: <15826.42439.877628.972525@localhost.redhat.com> (raw)


The documenation says that 'until' does this:

"@item until
Continue running until a source line past the current line, in the
current stack frame, is reached. [...]@code{until} always stops your
program if it attempts to exit the current stack frame.
[...]

@item until @var{location} 
Continue running your program until either the specified location is
reached, or the current stack frame returns.  @var{location} is any of
the forms of argument acceptable to @code{break}.  This form of the
command uses breakpoints, and hence is quicker than @code{until}
without an argument."

Note the 'will not exit the current stak frame' business.

However, nobody forbids you from saying "until foo" (since that's an
OK argument for break as well).  And foo can be any function, called
by the current frame or not.

It is not clear to me what the doco describes as gdb's
behavior. Concrete example below:

1	static int x;
2	
3	int fun ()
4	{
5	   x = 1;
6	}
7	
8	int fun2 ()
9	{
10	   x = 4;
11	}
12	
13	void foo()
14	{
15	  x = x + 5;
16	  fun2 ();
17	}
18	int main (int ac, char **av)
19	{
20	  x = 3;
21	  foo ();
22	  fun ();
23	  x = 3;
24	  return 0;
25	}


If I am in 'foo' at line 15,and enter the command 'until fun', I
would expect to end up ... where? At line 22?  Or should I end up at
line 5? Right now gdb ends up at 22, i.e. doesn't enter 'fun'. I think
it is consistent with the doco.

Similarly from foo line 15 where should 'until fun2' take me? Inside
fun2, at line 10? Or at line 16? Currently I end up at line 22 which
is in main. This seems clearly wrong either way.

Any thoughts?

Elena


             reply	other threads:[~2002-11-13 19:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-13 11:26 Elena Zannoni [this message]
2002-11-13 11:33 ` Daniel Jacobowitz
2002-11-13 11:42   ` Andrew Cagney
2002-11-13 12:35     ` Elena Zannoni
2002-11-14  0:19       ` Pierre Muller
2002-11-14  8:59         ` Elena Zannoni
2002-11-14 11:58       ` Eli Zaretskii
2002-11-13 12:34   ` Elena Zannoni
2002-11-13 12:40     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15826.42439.877628.972525@localhost.redhat.com \
    --to=ezannoni@redhat.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox