* Re: [RFC/RFA] New 'to' command
@ 2003-01-12 20:50 Michael Elizabeth Chastain
2003-01-12 21:15 ` Elena Zannoni
0 siblings, 1 reply; 17+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-12 20:50 UTC (permalink / raw)
To: drow, gdb-patches
I'm pretty much in Dan J's camp, up to the point where he doesn't
think of checking in 'help'. Although 'to' without an argument might
possibly provide some useful text.
Michael C
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC/RFA] New 'to' command
2003-01-12 20:50 [RFC/RFA] New 'to' command Michael Elizabeth Chastain
@ 2003-01-12 21:15 ` Elena Zannoni
0 siblings, 0 replies; 17+ messages in thread
From: Elena Zannoni @ 2003-01-12 21:15 UTC (permalink / raw)
To: Michael Elizabeth Chastain; +Cc: drow, gdb-patches
Michael Elizabeth Chastain writes:
> I'm pretty much in Dan J's camp, up to the point where he doesn't
> think of checking in 'help'. Although 'to' without an argument might
> possibly provide some useful text.
>
> Michael C
Aehm..., right not it doesn't.... fixed it:
(gdb) b main
Breakpoint 1 at 0x804852e: file /home/ezannoni/sources/src/gdb/testsuite/gdb.base/break.c, line 75.
(gdb) r
Starting program: /home/ezannoni/sources/native/gdb/testsuite/gdb.base/break
Breakpoint 1, main (argc=1, argv=0xbffff0f4, envp=0xbffff0fc)
at /home/ezannoni/sources/src/gdb/testsuite/gdb.base/break.c:75
75 if (argc == 12345) { /* an unlikely value < 2^16, in case uninited */
(gdb) to
Argument required (a location).
(gdb)
Updated diff attached:
2003-01-12 Elena Zannoni <ezannoni@redhat.com>
* breakpoint.c (until_break_command): Add new argument. Use it to
decide whether to stop only at the current frame or not.
* breakpoint.h (until_break_command): Update prototype.
* infcmd.c (until_command): Add new argument to until_break_command
call.
(to_command): New function.
(_initialize_infcmd): Update help string for 'until' command.
Add new 'to' command.
Index: breakpoint.c
===================================================================
RCS file: /cvs/uberbaum/gdb/breakpoint.c,v
retrieving revision 1.105
diff -u -p -r1.105 breakpoint.c
--- breakpoint.c 4 Jan 2003 23:07:24 -0000 1.105
+++ breakpoint.c 12 Jan 2003 19:08:07 -0000
@@ -5576,7 +5576,7 @@ until_break_command_continuation (struct
/* ARGSUSED */
void
-until_break_command (char *arg, int from_tty)
+until_break_command (char *arg, int from_tty, int anywhere)
{
struct symtabs_and_lines sals;
struct symtab_and_line sal;
@@ -5609,9 +5609,16 @@ until_break_command (char *arg, int from
resolve_sal_pc (&sal);
- breakpoint =
- set_momentary_breakpoint (sal,get_frame_id (deprecated_selected_frame),
- bp_until);
+ if (anywhere)
+ /* If the user told us to continue until a specified location,
+ we don't specify a frame at which we need to stop. */
+ breakpoint = set_momentary_breakpoint (sal, null_frame_id, bp_until);
+ else
+ /* Otherwise, specify the current frame, because we want to stop only
+ at the very same frame. */
+ breakpoint = set_momentary_breakpoint (sal,
+ get_frame_id (deprecated_selected_frame),
+ bp_until);
if (!event_loop_p || !target_can_async_p ())
old_chain = make_cleanup_delete_breakpoint (breakpoint);
@@ -5639,8 +5646,8 @@ until_break_command (char *arg, int from
add_continuation (until_break_command_continuation, arg1);
}
- /* Keep within the current frame */
-
+ /* Keep within the current frame, or in frames called by the current
+ one. */
if (prev_frame)
{
sal = find_pc_line (get_frame_pc (prev_frame), 0);
Index: breakpoint.h
===================================================================
RCS file: /cvs/uberbaum/gdb/breakpoint.h,v
retrieving revision 1.16
diff -u -p -r1.16 breakpoint.h
--- breakpoint.h 11 Dec 2002 22:34:47 -0000 1.16
+++ breakpoint.h 12 Jan 2003 19:08:50 -0000
@@ -534,7 +534,7 @@ extern int deprecated_frame_in_dummy (st
extern int breakpoint_thread_match (CORE_ADDR, ptid_t);
-extern void until_break_command (char *, int);
+extern void until_break_command (char *, int, int);
extern void breakpoint_re_set (void);
Index: infcmd.c
===================================================================
RCS file: /cvs/uberbaum/gdb/infcmd.c,v
retrieving revision 1.69
diff -u -p -r1.69 infcmd.c
--- infcmd.c 13 Dec 2002 16:26:02 -0000 1.69
+++ infcmd.c 12 Jan 2003 21:07:14 -0000
@@ -1140,10 +1140,41 @@ until_command (char *arg, int from_tty)
}
if (arg)
- until_break_command (arg, from_tty);
+ until_break_command (arg, from_tty, 0);
else
until_next_command (from_tty);
}
+
+static void
+to_command (char *arg, int from_tty)
+{
+ int async_exec = 0;
+
+ if (!target_has_execution)
+ error ("The program is not running.");
+
+ if (arg == NULL)
+ error_no_arg ("a location");
+
+ /* Find out whether we must run in the background. */
+ if (arg != NULL)
+ async_exec = strip_bg_char (&arg);
+
+ /* If we must run in the background, but the target can't do it,
+ error out. */
+ if (event_loop_p && async_exec && !target_can_async_p ())
+ error ("Asynchronous execution not supported on this target.");
+
+ /* If we are not asked to run in the bg, then prepare to run in the
+ foreground, synchronously. */
+ if (event_loop_p && !async_exec && target_can_async_p ())
+ {
+ /* Simulate synchronous execution */
+ async_disable_stdin ();
+ }
+
+ until_break_command (arg, from_tty, 1);
+}
/* Print the result of a function at the end of a 'finish' command. */
@@ -2130,10 +2161,14 @@ Argument N means do this N times (or til
c = add_com ("until", class_run, until_command,
"Execute until the program reaches a source line greater than the current\n\
-or a specified line or address or function (same args as break command).\n\
-Execution will also stop upon exit from the current stack frame.");
+or a specified location (same args as break command) within the current frame.");
set_cmd_completer (c, location_completer);
add_com_alias ("u", "until", class_run, 1);
+
+ c = add_com ("to", class_run, to_command,
+ "Continue the program up to the given location (same args as break command).\n\
+Execution will also stop upon exit from the current stack frame.");
+ set_cmd_completer (c, location_completer);
c = add_com ("jump", class_run, jump_command,
"Continue program being debugged at specified line or address.\n\
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC/RFA] New 'to' command
@ 2003-01-14 21:14 Michael Elizabeth Chastain
2003-01-14 21:17 ` Elena Zannoni
0 siblings, 1 reply; 17+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-14 21:14 UTC (permalink / raw)
To: ezannoni, fnasser; +Cc: gdb-patches
'advance' sounds fine to me.
Michael C
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC/RFA] New 'to' command
2003-01-14 21:14 Michael Elizabeth Chastain
@ 2003-01-14 21:17 ` Elena Zannoni
2003-01-14 22:11 ` Fernando Nasser
0 siblings, 1 reply; 17+ messages in thread
From: Elena Zannoni @ 2003-01-14 21:17 UTC (permalink / raw)
To: Michael Elizabeth Chastain; +Cc: ezannoni, fnasser, gdb-patches
Michael Elizabeth Chastain writes:
> 'advance' sounds fine to me.
>
> Michael C
all right!
Elena
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC/RFA] New 'to' command
2003-01-14 21:17 ` Elena Zannoni
@ 2003-01-14 22:11 ` Fernando Nasser
2003-01-15 0:07 ` Elena Zannoni
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: Fernando Nasser @ 2003-01-14 22:11 UTC (permalink / raw)
To: Elena Zannoni; +Cc: Michael Elizabeth Chastain, gdb-patches
Elena Zannoni wrote:> Michael Elizabeth Chastain writes:
> > 'advance' sounds fine to me.
> >
> > Michael C
>
> all right!
>
> Elena
>
That was quick. I was afraid I had started another long long thread :-)
Regards to all,
Fernando
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [RFC/RFA] New 'to' command
2003-01-14 22:11 ` Fernando Nasser
@ 2003-01-15 0:07 ` Elena Zannoni
2003-01-15 7:48 ` Eli Zaretskii
2003-01-15 19:16 ` Michael Snyder
2 siblings, 0 replies; 17+ messages in thread
From: Elena Zannoni @ 2003-01-15 0:07 UTC (permalink / raw)
To: Fernando Nasser; +Cc: Elena Zannoni, Michael Elizabeth Chastain, gdb-patches
Fernando Nasser writes:
> Elena Zannoni wrote:> Michael Elizabeth Chastain writes:
> > > 'advance' sounds fine to me.
> > >
> > > Michael C
> >
> > all right!
> >
> > Elena
> >
>
> That was quick. I was afraid I had started another long long thread :-)
>
> Regards to all,
> Fernando
>
> --
> Fernando Nasser
> Red Hat - Toronto E-Mail: fnasser@redhat.com
> 2323 Yonge Street, Suite #300
> Toronto, Ontario M4P 2C9
This is what I am checking in.
2003-01-14 Elena Zannoni <ezannoni@redhat.com>
* breakpoint.c (until_break_command): Add new argument. Use it to
decide whether to stop only at the current frame or not.
* breakpoint.h (until_break_command): Update prototype.
* infcmd.c (until_command): Add new argument to until_break_command
call.
(advance_command): New function.
(_initialize_infcmd): Update help string for 'until' command.
Add new 'advance' command.
Index: breakpoint.c
===================================================================
RCS file: /cvs/uberbaum/gdb/breakpoint.c,v
retrieving revision 1.105
diff -u -p -r1.105 breakpoint.c
--- breakpoint.c 4 Jan 2003 23:07:24 -0000 1.105
+++ breakpoint.c 15 Jan 2003 00:02:46 -0000
@@ -5576,7 +5576,7 @@ until_break_command_continuation (struct
/* ARGSUSED */
void
-until_break_command (char *arg, int from_tty)
+until_break_command (char *arg, int from_tty, int anywhere)
{
struct symtabs_and_lines sals;
struct symtab_and_line sal;
@@ -5609,9 +5609,16 @@ until_break_command (char *arg, int from
resolve_sal_pc (&sal);
- breakpoint =
- set_momentary_breakpoint (sal,get_frame_id (deprecated_selected_frame),
- bp_until);
+ if (anywhere)
+ /* If the user told us to continue until a specified location,
+ we don't specify a frame at which we need to stop. */
+ breakpoint = set_momentary_breakpoint (sal, null_frame_id, bp_until);
+ else
+ /* Otherwise, specify the current frame, because we want to stop only
+ at the very same frame. */
+ breakpoint = set_momentary_breakpoint (sal,
+ get_frame_id (deprecated_selected_frame),
+ bp_until);
if (!event_loop_p || !target_can_async_p ())
old_chain = make_cleanup_delete_breakpoint (breakpoint);
@@ -5639,8 +5646,8 @@ until_break_command (char *arg, int from
add_continuation (until_break_command_continuation, arg1);
}
- /* Keep within the current frame */
-
+ /* Keep within the current frame, or in frames called by the current
+ one. */
if (prev_frame)
{
sal = find_pc_line (get_frame_pc (prev_frame), 0);
@@ -5659,7 +5666,7 @@ until_break_command (char *arg, int from
if (!event_loop_p || !target_can_async_p ())
do_cleanups (old_chain);
}
-
+
#if 0
/* These aren't used; I don't konw what they were for. */
/* Set a breakpoint at the catch clause for NAME. */
Index: infcmd.c
===================================================================
RCS file: /cvs/uberbaum/gdb/infcmd.c,v
retrieving revision 1.69
diff -u -p -r1.69 infcmd.c
--- infcmd.c 13 Dec 2002 16:26:02 -0000 1.69
+++ infcmd.c 15 Jan 2003 00:04:10 -0000
@@ -1140,10 +1140,41 @@ until_command (char *arg, int from_tty)
}
if (arg)
- until_break_command (arg, from_tty);
+ until_break_command (arg, from_tty, 0);
else
until_next_command (from_tty);
}
+
+static void
+advance_command (char *arg, int from_tty)
+{
+ int async_exec = 0;
+
+ if (!target_has_execution)
+ error ("The program is not running.");
+
+ if (arg == NULL)
+ error_no_arg ("a location");
+
+ /* Find out whether we must run in the background. */
+ if (arg != NULL)
+ async_exec = strip_bg_char (&arg);
+
+ /* If we must run in the background, but the target can't do it,
+ error out. */
+ if (event_loop_p && async_exec && !target_can_async_p ())
+ error ("Asynchronous execution not supported on this target.");
+
+ /* If we are not asked to run in the bg, then prepare to run in the
+ foreground, synchronously. */
+ if (event_loop_p && !async_exec && target_can_async_p ())
+ {
+ /* Simulate synchronous execution. */
+ async_disable_stdin ();
+ }
+
+ until_break_command (arg, from_tty, 1);
+}
\f
/* Print the result of a function at the end of a 'finish' command. */
@@ -2130,10 +2161,14 @@ Argument N means do this N times (or til
c = add_com ("until", class_run, until_command,
"Execute until the program reaches a source line greater than the current\n\
-or a specified line or address or function (same args as break command).\n\
-Execution will also stop upon exit from the current stack frame.");
+or a specified location (same args as break command) within the current frame.");
set_cmd_completer (c, location_completer);
add_com_alias ("u", "until", class_run, 1);
+
+ c = add_com ("advance", class_run, advance_command,
+ "Continue the program up to the given location (same form as args for break command).\n\
+Execution will also stop upon exit from the current stack frame.");
+ set_cmd_completer (c, location_completer);
c = add_com ("jump", class_run, jump_command,
"Continue program being debugged at specified line or address.\n\
Index: breakpoint.h
===================================================================
RCS file: /cvs/uberbaum/gdb/breakpoint.h,v
retrieving revision 1.16
diff -u -p -r1.16 breakpoint.h
--- breakpoint.h 11 Dec 2002 22:34:47 -0000 1.16
+++ breakpoint.h 15 Jan 2003 00:05:35 -0000
@@ -534,7 +534,7 @@ extern int deprecated_frame_in_dummy (st
extern int breakpoint_thread_match (CORE_ADDR, ptid_t);
-extern void until_break_command (char *, int);
+extern void until_break_command (char *, int, int);
extern void breakpoint_re_set (void);
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [RFC/RFA] New 'to' command
2003-01-14 22:11 ` Fernando Nasser
2003-01-15 0:07 ` Elena Zannoni
@ 2003-01-15 7:48 ` Eli Zaretskii
2003-01-15 19:16 ` Michael Snyder
2 siblings, 0 replies; 17+ messages in thread
From: Eli Zaretskii @ 2003-01-15 7:48 UTC (permalink / raw)
To: fnasser; +Cc: ezannoni, mec, gdb-patches
> Date: Tue, 14 Jan 2003 17:11:01 -0500
> From: Fernando Nasser <fnasser@redhat.com>
>
> That was quick. I was afraid I had started another long long thread :-)
Come on now, we all know that there's nothing like one of Fernando's
good ideas to solve a problem and end a prolonged discussion ;-)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC/RFA] New 'to' command
2003-01-14 22:11 ` Fernando Nasser
2003-01-15 0:07 ` Elena Zannoni
2003-01-15 7:48 ` Eli Zaretskii
@ 2003-01-15 19:16 ` Michael Snyder
2003-01-16 14:29 ` Fernando Nasser
2 siblings, 1 reply; 17+ messages in thread
From: Michael Snyder @ 2003-01-15 19:16 UTC (permalink / raw)
To: Fernando Nasser; +Cc: Elena Zannoni, Michael Elizabeth Chastain, gdb-patches
Fernando Nasser wrote:
>
> Elena Zannoni wrote:> Michael Elizabeth Chastain writes:
> > > 'advance' sounds fine to me.
> > >
> > > Michael C
> >
> > all right!
> >
> > Elena
> >
>
> That was quick. I was afraid I had started another long long thread :-)
Sometimes it takes a non-native-english-speaker. ;-)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC/RFA] New 'to' command
2003-01-15 19:16 ` Michael Snyder
@ 2003-01-16 14:29 ` Fernando Nasser
0 siblings, 0 replies; 17+ messages in thread
From: Fernando Nasser @ 2003-01-16 14:29 UTC (permalink / raw)
To: Michael Snyder; +Cc: Elena Zannoni, Michael Elizabeth Chastain, gdb-patches
Michael Snyder wrote:> Fernando Nasser wrote:
>
>>Elena Zannoni wrote:> Michael Elizabeth Chastain writes:
>>
>>> > 'advance' sounds fine to me.
>>> >
>>> > Michael C
>>>
>>>all right!
>>>
>>>Elena
>>>
>>
>>That was quick. I was afraid I had started another long long thread :-)
>
>
> Sometimes it takes a non-native-english-speaker. ;-)
>
Yeah, specially when the word has a Latin root ;-)
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 17+ messages in thread
* [RFC/RFA] New 'to' command
@ 2003-01-12 19:16 Elena Zannoni
2003-01-12 19:41 ` Daniel Jacobowitz
2003-01-14 20:21 ` Fernando Nasser
0 siblings, 2 replies; 17+ messages in thread
From: Elena Zannoni @ 2003-01-12 19:16 UTC (permalink / raw)
To: gdb-patches
Following up from the long long long thread:
http://sources.redhat.com/ml/gdb-patches/2002-12/msg00584.html
Here is a new command called 'to', which takes a location (any
location) specified like for the break command, and simply continues
to it, with the restriction that the current frame is not exited.
I have left the current 'until' command alone, except for a modification
of the help string.
If this is agreed upon, I'll submit doco changes and testsuite.
2003-01-12 Elena Zannoni <ezannoni@redhat.com>
* breakpoint.c (until_break_command): Add new argument. Use it to
decide whether to stop only at the current frame or not.
* breakpoint.h (until_break_command): Update prototype.
* infcmd.c (until_command): Add new argument to until_break_command
call.
(to_command): New function.
(_initialize_infcmd): Update help string for 'until' command.
Add new 'to' command.
Index: breakpoint.c
===================================================================
RCS file: /cvs/uberbaum/gdb/breakpoint.c,v
retrieving revision 1.105
diff -u -p -r1.105 breakpoint.c
--- breakpoint.c 4 Jan 2003 23:07:24 -0000 1.105
+++ breakpoint.c 12 Jan 2003 19:08:07 -0000
@@ -5576,7 +5576,7 @@ until_break_command_continuation (struct
/* ARGSUSED */
void
-until_break_command (char *arg, int from_tty)
+until_break_command (char *arg, int from_tty, int anywhere)
{
struct symtabs_and_lines sals;
struct symtab_and_line sal;
@@ -5609,9 +5609,16 @@ until_break_command (char *arg, int from
resolve_sal_pc (&sal);
- breakpoint =
- set_momentary_breakpoint (sal,get_frame_id (deprecated_selected_frame),
- bp_until);
+ if (anywhere)
+ /* If the user told us to continue until a specified location,
+ we don't specify a frame at which we need to stop. */
+ breakpoint = set_momentary_breakpoint (sal, null_frame_id, bp_until);
+ else
+ /* Otherwise, specify the current frame, because we want to stop only
+ at the very same frame. */
+ breakpoint = set_momentary_breakpoint (sal,
+ get_frame_id (deprecated_selected_frame),
+ bp_until);
if (!event_loop_p || !target_can_async_p ())
old_chain = make_cleanup_delete_breakpoint (breakpoint);
@@ -5639,8 +5646,8 @@ until_break_command (char *arg, int from
add_continuation (until_break_command_continuation, arg1);
}
- /* Keep within the current frame */
-
+ /* Keep within the current frame, or in frames called by the current
+ one. */
if (prev_frame)
{
sal = find_pc_line (get_frame_pc (prev_frame), 0);
Index: breakpoint.h
===================================================================
RCS file: /cvs/uberbaum/gdb/breakpoint.h,v
retrieving revision 1.16
diff -u -p -r1.16 breakpoint.h
--- breakpoint.h 11 Dec 2002 22:34:47 -0000 1.16
+++ breakpoint.h 12 Jan 2003 19:08:50 -0000
@@ -534,7 +534,7 @@ extern int deprecated_frame_in_dummy (st
extern int breakpoint_thread_match (CORE_ADDR, ptid_t);
-extern void until_break_command (char *, int);
+extern void until_break_command (char *, int, int);
extern void breakpoint_re_set (void);
Index: infcmd.c
===================================================================
RCS file: /cvs/uberbaum/gdb/infcmd.c,v
retrieving revision 1.69
diff -u -p -r1.69 infcmd.c
--- infcmd.c 13 Dec 2002 16:26:02 -0000 1.69
+++ infcmd.c 12 Jan 2003 19:09:05 -0000
@@ -1140,10 +1140,38 @@ until_command (char *arg, int from_tty)
}
if (arg)
- until_break_command (arg, from_tty);
+ until_break_command (arg, from_tty, 0);
else
until_next_command (from_tty);
}
+
+static void
+to_command (char *arg, int from_tty)
+{
+ int async_exec = 0;
+
+ if (!target_has_execution)
+ error ("The program is not running.");
+
+ /* Find out whether we must run in the background. */
+ if (arg != NULL)
+ async_exec = strip_bg_char (&arg);
+
+ /* If we must run in the background, but the target can't do it,
+ error out. */
+ if (event_loop_p && async_exec && !target_can_async_p ())
+ error ("Asynchronous execution not supported on this target.");
+
+ /* If we are not asked to run in the bg, then prepare to run in the
+ foreground, synchronously. */
+ if (event_loop_p && !async_exec && target_can_async_p ())
+ {
+ /* Simulate synchronous execution */
+ async_disable_stdin ();
+ }
+
+ until_break_command (arg, from_tty, 1);
+}
/* Print the result of a function at the end of a 'finish' command. */
@@ -2130,10 +2158,14 @@ Argument N means do this N times (or til
c = add_com ("until", class_run, until_command,
"Execute until the program reaches a source line greater than the current\n\
-or a specified line or address or function (same args as break command).\n\
-Execution will also stop upon exit from the current stack frame.");
+or a specified location (same args as break command) within the current frame.");
set_cmd_completer (c, location_completer);
add_com_alias ("u", "until", class_run, 1);
+
+ c = add_com ("to", class_run, to_command,
+ "Continue the program up to the given location (same args as break command).\n\
+Execution will also stop upon exit from the current stack frame.");
+ set_cmd_completer (c, location_completer);
c = add_com ("jump", class_run, jump_command,
"Continue program being debugged at specified line or address.\n\
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [RFC/RFA] New 'to' command
2003-01-12 19:16 Elena Zannoni
@ 2003-01-12 19:41 ` Daniel Jacobowitz
2003-01-12 21:15 ` Elena Zannoni
2003-01-14 20:21 ` Fernando Nasser
1 sibling, 1 reply; 17+ messages in thread
From: Daniel Jacobowitz @ 2003-01-12 19:41 UTC (permalink / raw)
To: gdb-patches
On Sun, Jan 12, 2003 at 02:20:40PM -0500, Elena Zannoni wrote:
>
> Following up from the long long long thread:
> http://sources.redhat.com/ml/gdb-patches/2002-12/msg00584.html
>
> Here is a new command called 'to', which takes a location (any
> location) specified like for the break command, and simply continues
> to it, with the restriction that the current frame is not exited.
>
> I have left the current 'until' command alone, except for a modification
> of the help string.
>
> If this is agreed upon, I'll submit doco changes and testsuite.
Well, I like it just because it's nice to see us moving forwards... and
"to" is as good a name as any, I guess. I'm worried that it doesn't
pass the obviousness test:
- Hypothesize a forgetful Dan. This is easy; I can provide one any
time you need one.
- He remembers a long thread about until and to
- But he's forgotten which one does which!
- And he didn't think of checking in "help"!
- So, how does he figure out which does which?
I think that the names of two commands should suggest logically
different behaviors, or we're just setting up more confusion. I don't
see how given "until 900" and "to 900" the user could figure out which
wants the current frame.
That said, I don't mind this solution. I'll get used to it; I suspect
anyone else who wants to use it can too. Let's see if you satisfy
everyone else :)
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC/RFA] New 'to' command
2003-01-12 19:41 ` Daniel Jacobowitz
@ 2003-01-12 21:15 ` Elena Zannoni
2003-01-13 21:14 ` Michael Snyder
0 siblings, 1 reply; 17+ messages in thread
From: Elena Zannoni @ 2003-01-12 21:15 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz writes:
> On Sun, Jan 12, 2003 at 02:20:40PM -0500, Elena Zannoni wrote:
> >
> > Following up from the long long long thread:
> > http://sources.redhat.com/ml/gdb-patches/2002-12/msg00584.html
> >
> > Here is a new command called 'to', which takes a location (any
> > location) specified like for the break command, and simply continues
> > to it, with the restriction that the current frame is not exited.
> >
> > I have left the current 'until' command alone, except for a modification
> > of the help string.
> >
> > If this is agreed upon, I'll submit doco changes and testsuite.
>
> Well, I like it just because it's nice to see us moving forwards... and
> "to" is as good a name as any, I guess. I'm worried that it doesn't
> pass the obviousness test:
>
> - Hypothesize a forgetful Dan. This is easy; I can provide one any
> time you need one.
> - He remembers a long thread about until and to
> - But he's forgotten which one does which!
> - And he didn't think of checking in "help"!
> - So, how does he figure out which does which?
>
> I think that the names of two commands should suggest logically
> different behaviors, or we're just setting up more confusion. I don't
> see how given "until 900" and "to 900" the user could figure out which
> wants the current frame.
>
I am not attached to either name, I just couldn't come up with better
ones. My main rationale was to leave 'until' untouched.
> That said, I don't mind this solution. I'll get used to it; I suspect
> anyone else who wants to use it can too. Let's see if you satisfy
> everyone else :)
>
Let's hope...
Elena
> --
> Daniel Jacobowitz
> MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC/RFA] New 'to' command
2003-01-12 21:15 ` Elena Zannoni
@ 2003-01-13 21:14 ` Michael Snyder
0 siblings, 0 replies; 17+ messages in thread
From: Michael Snyder @ 2003-01-13 21:14 UTC (permalink / raw)
To: Elena Zannoni; +Cc: Daniel Jacobowitz, gdb-patches
Elena Zannoni wrote:
>
> Daniel Jacobowitz writes:
> > On Sun, Jan 12, 2003 at 02:20:40PM -0500, Elena Zannoni wrote:
> > >
> > > Following up from the long long long thread:
> > > http://sources.redhat.com/ml/gdb-patches/2002-12/msg00584.html
> > >
> > > Here is a new command called 'to', which takes a location (any
> > > location) specified like for the break command, and simply continues
> > > to it, with the restriction that the current frame is not exited.
> > >
> > > I have left the current 'until' command alone, except for a modification
> > > of the help string.
> > >
> > > If this is agreed upon, I'll submit doco changes and testsuite.
> >
> > Well, I like it just because it's nice to see us moving forwards... and
> > "to" is as good a name as any, I guess. I'm worried that it doesn't
> > pass the obviousness test:
> >
> > - Hypothesize a forgetful Dan. This is easy; I can provide one any
> > time you need one.
> > - He remembers a long thread about until and to
> > - But he's forgotten which one does which!
> > - And he didn't think of checking in "help"!
> > - So, how does he figure out which does which?
> >
> > I think that the names of two commands should suggest logically
> > different behaviors, or we're just setting up more confusion. I don't
> > see how given "until 900" and "to 900" the user could figure out which
> > wants the current frame.
> >
>
> I am not attached to either name, I just couldn't come up with better
> ones. My main rationale was to leave 'until' untouched.
>
> > That said, I don't mind this solution. I'll get used to it; I suspect
> > anyone else who wants to use it can too. Let's see if you satisfy
> > everyone else :)
> >
>
> Let's hope...
I have no complaints. Only -- wasn't "until" broken?
Is it still broken?
Should we make "until" and "to" mutually exclusive, ie.
should "until" reject locations outside the current frame?
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC/RFA] New 'to' command
2003-01-12 19:16 Elena Zannoni
2003-01-12 19:41 ` Daniel Jacobowitz
@ 2003-01-14 20:21 ` Fernando Nasser
2003-01-14 21:05 ` Elena Zannoni
1 sibling, 1 reply; 17+ messages in thread
From: Fernando Nasser @ 2003-01-14 20:21 UTC (permalink / raw)
To: Elena Zannoni; +Cc: gdb-patches
Sorry to get back to the name thing. But I believe the discussion concentrated
more on the semantics of the two commands and how until would be implemented --
nobody was specifically fond of the names that came up in any case.
What about "advance-to"? You can add "to" as an alias, I don't mind (although I
don't thing we need/should as typing "adv" will suffice)..
I believe it captures the idea of what the user is trying to do in this case.
Regards to all,
Fernando
Elena Zannoni wrote:> Following up from the long long long thread:
> http://sources.redhat.com/ml/gdb-patches/2002-12/msg00584.html
>
> Here is a new command called 'to', which takes a location (any
> location) specified like for the break command, and simply continues
> to it, with the restriction that the current frame is not exited.
>
> I have left the current 'until' command alone, except for a modification
> of the help string.
>
> If this is agreed upon, I'll submit doco changes and testsuite.
>
> 2003-01-12 Elena Zannoni <ezannoni@redhat.com>
>
> * breakpoint.c (until_break_command): Add new argument. Use it to
> decide whether to stop only at the current frame or not.
> * breakpoint.h (until_break_command): Update prototype.
> * infcmd.c (until_command): Add new argument to until_break_command
> call.
> (to_command): New function.
> (_initialize_infcmd): Update help string for 'until' command.
> Add new 'to' command.
>
>
> Index: breakpoint.c
> ===================================================================
> RCS file: /cvs/uberbaum/gdb/breakpoint.c,v
> retrieving revision 1.105
> diff -u -p -r1.105 breakpoint.c
> --- breakpoint.c 4 Jan 2003 23:07:24 -0000 1.105
> +++ breakpoint.c 12 Jan 2003 19:08:07 -0000
> @@ -5576,7 +5576,7 @@ until_break_command_continuation (struct
>
> /* ARGSUSED */
> void
> -until_break_command (char *arg, int from_tty)
> +until_break_command (char *arg, int from_tty, int anywhere)
> {
> struct symtabs_and_lines sals;
> struct symtab_and_line sal;
> @@ -5609,9 +5609,16 @@ until_break_command (char *arg, int from
>
> resolve_sal_pc (&sal);
>
> - breakpoint =
> - set_momentary_breakpoint (sal,get_frame_id (deprecated_selected_frame),
> - bp_until);
> + if (anywhere)
> + /* If the user told us to continue until a specified location,
> + we don't specify a frame at which we need to stop. */
> + breakpoint = set_momentary_breakpoint (sal, null_frame_id, bp_until);
> + else
> + /* Otherwise, specify the current frame, because we want to stop only
> + at the very same frame. */
> + breakpoint = set_momentary_breakpoint (sal,
> + get_frame_id (deprecated_selected_frame),
> + bp_until);
>
> if (!event_loop_p || !target_can_async_p ())
> old_chain = make_cleanup_delete_breakpoint (breakpoint);
> @@ -5639,8 +5646,8 @@ until_break_command (char *arg, int from
> add_continuation (until_break_command_continuation, arg1);
> }
>
> - /* Keep within the current frame */
> -
> + /* Keep within the current frame, or in frames called by the current
> + one. */
> if (prev_frame)
> {
> sal = find_pc_line (get_frame_pc (prev_frame), 0);
>
> Index: breakpoint.h
> ===================================================================
> RCS file: /cvs/uberbaum/gdb/breakpoint.h,v
> retrieving revision 1.16
> diff -u -p -r1.16 breakpoint.h
> --- breakpoint.h 11 Dec 2002 22:34:47 -0000 1.16
> +++ breakpoint.h 12 Jan 2003 19:08:50 -0000
> @@ -534,7 +534,7 @@ extern int deprecated_frame_in_dummy (st
>
> extern int breakpoint_thread_match (CORE_ADDR, ptid_t);
>
> -extern void until_break_command (char *, int);
> +extern void until_break_command (char *, int, int);
>
> extern void breakpoint_re_set (void);
>
> Index: infcmd.c
> ===================================================================
> RCS file: /cvs/uberbaum/gdb/infcmd.c,v
> retrieving revision 1.69
> diff -u -p -r1.69 infcmd.c
> --- infcmd.c 13 Dec 2002 16:26:02 -0000 1.69
> +++ infcmd.c 12 Jan 2003 19:09:05 -0000
> @@ -1140,10 +1140,38 @@ until_command (char *arg, int from_tty)
> }
>
> if (arg)
> - until_break_command (arg, from_tty);
> + until_break_command (arg, from_tty, 0);
> else
> until_next_command (from_tty);
> }
> +
> +static void
> +to_command (char *arg, int from_tty)
> +{
> + int async_exec = 0;
> +
> + if (!target_has_execution)
> + error ("The program is not running.");
> +
> + /* Find out whether we must run in the background. */
> + if (arg != NULL)
> + async_exec = strip_bg_char (&arg);
> +
> + /* If we must run in the background, but the target can't do it,
> + error out. */
> + if (event_loop_p && async_exec && !target_can_async_p ())
> + error ("Asynchronous execution not supported on this target.");
> +
> + /* If we are not asked to run in the bg, then prepare to run in the
> + foreground, synchronously. */
> + if (event_loop_p && !async_exec && target_can_async_p ())
> + {
> + /* Simulate synchronous execution */
> + async_disable_stdin ();
> + }
> +
> + until_break_command (arg, from_tty, 1);
> +}
>
>
> /* Print the result of a function at the end of a 'finish' command. */
> @@ -2130,10 +2158,14 @@ Argument N means do this N times (or til
>
> c = add_com ("until", class_run, until_command,
> "Execute until the program reaches a source line greater than the current\n\
> -or a specified line or address or function (same args as break command).\n\
> -Execution will also stop upon exit from the current stack frame.");
> +or a specified location (same args as break command) within the current frame.");
> set_cmd_completer (c, location_completer);
> add_com_alias ("u", "until", class_run, 1);
> +
> + c = add_com ("to", class_run, to_command,
> + "Continue the program up to the given location (same args as break command).\n\
> +Execution will also stop upon exit from the current stack frame.");
> + set_cmd_completer (c, location_completer);
>
> c = add_com ("jump", class_run, jump_command,
> "Continue program being debugged at specified line or address.\n\
>
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [RFC/RFA] New 'to' command
2003-01-14 20:21 ` Fernando Nasser
@ 2003-01-14 21:05 ` Elena Zannoni
2003-01-14 21:07 ` Daniel Jacobowitz
0 siblings, 1 reply; 17+ messages in thread
From: Elena Zannoni @ 2003-01-14 21:05 UTC (permalink / raw)
To: Fernando Nasser; +Cc: Elena Zannoni, gdb-patches
Fernando Nasser writes:
> Sorry to get back to the name thing. But I believe the discussion concentrated
> more on the semantics of the two commands and how until would be implemented --
> nobody was specifically fond of the names that came up in any case.
>
> What about "advance-to"? You can add "to" as an alias, I don't mind (although I
> don't thing we need/should as typing "adv" will suffice)..
>
> I believe it captures the idea of what the user is trying to do in this case.
I like it.
going once, going twice, sold ?
Elena
>
> Regards to all,
> Fernando
>
>
>
> Elena Zannoni wrote:> Following up from the long long long thread:
> > http://sources.redhat.com/ml/gdb-patches/2002-12/msg00584.html
> >
> > Here is a new command called 'to', which takes a location (any
> > location) specified like for the break command, and simply continues
> > to it, with the restriction that the current frame is not exited.
> >
> > I have left the current 'until' command alone, except for a modification
> > of the help string.
> >
> > If this is agreed upon, I'll submit doco changes and testsuite.
> >
> > 2003-01-12 Elena Zannoni <ezannoni@redhat.com>
> >
> > * breakpoint.c (until_break_command): Add new argument. Use it to
> > decide whether to stop only at the current frame or not.
> > * breakpoint.h (until_break_command): Update prototype.
> > * infcmd.c (until_command): Add new argument to until_break_command
> > call.
> > (to_command): New function.
> > (_initialize_infcmd): Update help string for 'until' command.
> > Add new 'to' command.
> >
> >
> > Index: breakpoint.c
> > ===================================================================
> > RCS file: /cvs/uberbaum/gdb/breakpoint.c,v
> > retrieving revision 1.105
> > diff -u -p -r1.105 breakpoint.c
> > --- breakpoint.c 4 Jan 2003 23:07:24 -0000 1.105
> > +++ breakpoint.c 12 Jan 2003 19:08:07 -0000
> > @@ -5576,7 +5576,7 @@ until_break_command_continuation (struct
> >
> > /* ARGSUSED */
> > void
> > -until_break_command (char *arg, int from_tty)
> > +until_break_command (char *arg, int from_tty, int anywhere)
> > {
> > struct symtabs_and_lines sals;
> > struct symtab_and_line sal;
> > @@ -5609,9 +5609,16 @@ until_break_command (char *arg, int from
> >
> > resolve_sal_pc (&sal);
> >
> > - breakpoint =
> > - set_momentary_breakpoint (sal,get_frame_id (deprecated_selected_frame),
> > - bp_until);
> > + if (anywhere)
> > + /* If the user told us to continue until a specified location,
> > + we don't specify a frame at which we need to stop. */
> > + breakpoint = set_momentary_breakpoint (sal, null_frame_id, bp_until);
> > + else
> > + /* Otherwise, specify the current frame, because we want to stop only
> > + at the very same frame. */
> > + breakpoint = set_momentary_breakpoint (sal,
> > + get_frame_id (deprecated_selected_frame),
> > + bp_until);
> >
> > if (!event_loop_p || !target_can_async_p ())
> > old_chain = make_cleanup_delete_breakpoint (breakpoint);
> > @@ -5639,8 +5646,8 @@ until_break_command (char *arg, int from
> > add_continuation (until_break_command_continuation, arg1);
> > }
> >
> > - /* Keep within the current frame */
> > -
> > + /* Keep within the current frame, or in frames called by the current
> > + one. */
> > if (prev_frame)
> > {
> > sal = find_pc_line (get_frame_pc (prev_frame), 0);
> >
> > Index: breakpoint.h
> > ===================================================================
> > RCS file: /cvs/uberbaum/gdb/breakpoint.h,v
> > retrieving revision 1.16
> > diff -u -p -r1.16 breakpoint.h
> > --- breakpoint.h 11 Dec 2002 22:34:47 -0000 1.16
> > +++ breakpoint.h 12 Jan 2003 19:08:50 -0000
> > @@ -534,7 +534,7 @@ extern int deprecated_frame_in_dummy (st
> >
> > extern int breakpoint_thread_match (CORE_ADDR, ptid_t);
> >
> > -extern void until_break_command (char *, int);
> > +extern void until_break_command (char *, int, int);
> >
> > extern void breakpoint_re_set (void);
> >
> > Index: infcmd.c
> > ===================================================================
> > RCS file: /cvs/uberbaum/gdb/infcmd.c,v
> > retrieving revision 1.69
> > diff -u -p -r1.69 infcmd.c
> > --- infcmd.c 13 Dec 2002 16:26:02 -0000 1.69
> > +++ infcmd.c 12 Jan 2003 19:09:05 -0000
> > @@ -1140,10 +1140,38 @@ until_command (char *arg, int from_tty)
> > }
> >
> > if (arg)
> > - until_break_command (arg, from_tty);
> > + until_break_command (arg, from_tty, 0);
> > else
> > until_next_command (from_tty);
> > }
> > +
> > +static void
> > +to_command (char *arg, int from_tty)
> > +{
> > + int async_exec = 0;
> > +
> > + if (!target_has_execution)
> > + error ("The program is not running.");
> > +
> > + /* Find out whether we must run in the background. */
> > + if (arg != NULL)
> > + async_exec = strip_bg_char (&arg);
> > +
> > + /* If we must run in the background, but the target can't do it,
> > + error out. */
> > + if (event_loop_p && async_exec && !target_can_async_p ())
> > + error ("Asynchronous execution not supported on this target.");
> > +
> > + /* If we are not asked to run in the bg, then prepare to run in the
> > + foreground, synchronously. */
> > + if (event_loop_p && !async_exec && target_can_async_p ())
> > + {
> > + /* Simulate synchronous execution */
> > + async_disable_stdin ();
> > + }
> > +
> > + until_break_command (arg, from_tty, 1);
> > +}
> >
> >
> > /* Print the result of a function at the end of a 'finish' command. */
> > @@ -2130,10 +2158,14 @@ Argument N means do this N times (or til
> >
> > c = add_com ("until", class_run, until_command,
> > "Execute until the program reaches a source line greater than the current\n\
> > -or a specified line or address or function (same args as break command).\n\
> > -Execution will also stop upon exit from the current stack frame.");
> > +or a specified location (same args as break command) within the current frame.");
> > set_cmd_completer (c, location_completer);
> > add_com_alias ("u", "until", class_run, 1);
> > +
> > + c = add_com ("to", class_run, to_command,
> > + "Continue the program up to the given location (same args as break command).\n\
> > +Execution will also stop upon exit from the current stack frame.");
> > + set_cmd_completer (c, location_completer);
> >
> > c = add_com ("jump", class_run, jump_command,
> > "Continue program being debugged at specified line or address.\n\
> >
>
>
>
> --
> Fernando Nasser
> Red Hat - Toronto E-Mail: fnasser@redhat.com
> 2323 Yonge Street, Suite #300
> Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [RFC/RFA] New 'to' command
2003-01-14 21:05 ` Elena Zannoni
@ 2003-01-14 21:07 ` Daniel Jacobowitz
2003-01-14 21:17 ` Elena Zannoni
0 siblings, 1 reply; 17+ messages in thread
From: Daniel Jacobowitz @ 2003-01-14 21:07 UTC (permalink / raw)
To: gdb-patches
On Tue, Jan 14, 2003 at 04:09:51PM -0500, Elena Zannoni wrote:
> Fernando Nasser writes:
> > Sorry to get back to the name thing. But I believe the discussion concentrated
> > more on the semantics of the two commands and how until would be implemented --
> > nobody was specifically fond of the names that came up in any case.
> >
> > What about "advance-to"? You can add "to" as an alias, I don't mind (although I
> > don't thing we need/should as typing "adv" will suffice)..
> >
> > I believe it captures the idea of what the user is trying to do in this case.
>
> I like it.
> going once, going twice, sold ?
Until stays in this stack frame, advance-to goes to anything as long as
the frame doesn't exit? Sold to me. Thanks for the name, Fernando!
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [RFC/RFA] New 'to' command
2003-01-14 21:07 ` Daniel Jacobowitz
@ 2003-01-14 21:17 ` Elena Zannoni
0 siblings, 0 replies; 17+ messages in thread
From: Elena Zannoni @ 2003-01-14 21:17 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz writes:
> On Tue, Jan 14, 2003 at 04:09:51PM -0500, Elena Zannoni wrote:
> > Fernando Nasser writes:
> > > Sorry to get back to the name thing. But I believe the discussion concentrated
> > > more on the semantics of the two commands and how until would be implemented --
> > > nobody was specifically fond of the names that came up in any case.
> > >
> > > What about "advance-to"? You can add "to" as an alias, I don't mind (although I
> > > don't thing we need/should as typing "adv" will suffice)..
> > >
> > > I believe it captures the idea of what the user is trying to do in this case.
> >
> > I like it.
> > going once, going twice, sold ?
>
> Until stays in this stack frame, advance-to goes to anything as long as
> the frame doesn't exit? Sold to me. Thanks for the name, Fernando!
>
yes, until is untouched. Same as it was. Advance is for the new command.
Ok. Phew!
Elena
>
> --
> Daniel Jacobowitz
> MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2003-01-16 14:29 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-12 20:50 [RFC/RFA] New 'to' command Michael Elizabeth Chastain
2003-01-12 21:15 ` Elena Zannoni
-- strict thread matches above, loose matches on Subject: below --
2003-01-14 21:14 Michael Elizabeth Chastain
2003-01-14 21:17 ` Elena Zannoni
2003-01-14 22:11 ` Fernando Nasser
2003-01-15 0:07 ` Elena Zannoni
2003-01-15 7:48 ` Eli Zaretskii
2003-01-15 19:16 ` Michael Snyder
2003-01-16 14:29 ` Fernando Nasser
2003-01-12 19:16 Elena Zannoni
2003-01-12 19:41 ` Daniel Jacobowitz
2003-01-12 21:15 ` Elena Zannoni
2003-01-13 21:14 ` Michael Snyder
2003-01-14 20:21 ` Fernando Nasser
2003-01-14 21:05 ` Elena Zannoni
2003-01-14 21:07 ` Daniel Jacobowitz
2003-01-14 21:17 ` Elena Zannoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox