aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2003-01-15 00:48:38 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2003-01-15 00:48:38 +0000
commitae66c1fc9b50b1f51662edc9a2358069a2502fc3 (patch)
treeae4b7b91f4fe4a9693de354f2c784919bc204a3a /gdb/infcmd.c
parent4abbaa29de2f88d2d40338298393d224def78312 (diff)
downloadgdb-ae66c1fc9b50b1f51662edc9a2358069a2502fc3.zip
gdb-ae66c1fc9b50b1f51662edc9a2358069a2502fc3.tar.gz
gdb-ae66c1fc9b50b1f51662edc9a2358069a2502fc3.tar.bz2
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.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c41
1 files changed, 38 insertions, 3 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 56bd75d..c0889ac 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -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);
+}
/* Print the result of a function at the end of a 'finish' command. */
@@ -2130,11 +2161,15 @@ Argument N means do this N times (or till program stops for another reason).");
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\
Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\