aboutsummaryrefslogtreecommitdiff
path: root/gdb/maint.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1995-06-08 22:42:36 +0000
committerStu Grossman <grossman@cygnus>1995-06-08 22:42:36 +0000
commit4887063b3ce78e39fac8a79d01fa01234ab95174 (patch)
tree0c715153cace5669953c7feca4a67d1a3d010651 /gdb/maint.c
parent311f7c4b6a19b0e4376e8985491a832cfd28a315 (diff)
downloadgdb-4887063b3ce78e39fac8a79d01fa01234ab95174.zip
gdb-4887063b3ce78e39fac8a79d01fa01234ab95174.tar.gz
gdb-4887063b3ce78e39fac8a79d01fa01234ab95174.tar.bz2
* defs.h maint.c monitor.c remote-mips.c remote.c: Add support
for `watchdog' variable. This allows the user to put an upper limit on the amount of time that GDB will wait for the target to return from a step or continue operation. This will primarily be used for the testsuite, where it is difficult to come up with a reasonable timeout for things like function calls, which can take as long as three minutes under some circumstances. If the watchdog timer expires, GDB will generate an error that looks like `Watchdog has expired.', and will detach from the target. * remote-mips.c (mips_open): Setup initial frame from target. Print it out so that user is told where the program is stopped when they attach. * remote-nrom.c: Loads of cleanups. Use serial code to open network connections. Use expect() to wait for response to download command. * ser-tcp.c (tcp_open): Retry connection if we get ECONNREFUSED. * serial.c serial.h (serial_open serial_fdopen serial_close): Allow users to open the same device multiple times. They all get to share the same serial_t. This is about the only way to have multiple active targets use the same device (for download and debug). * sparcl-tdep.c: Keep #include <unistd.h> away from GO32. * target.c: Add `targetdebug' variable. If this is non-zero, then a special target is put at the top of the target stack which will cause all calls through the target vector to have their args and results printed out.
Diffstat (limited to 'gdb/maint.c')
-rw-r--r--gdb/maint.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/maint.c b/gdb/maint.c
index 479ee6b..7f822ec 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -43,6 +43,14 @@ static void maintenance_time_display PARAMS ((char *, int));
static void maintenance_space_display PARAMS ((char *, int));
+/* Set this to the maximum number of seconds to wait instead of waiting forever
+ in target_wait(). If this timer times out, then it generates an error and
+ the command is aborted. This replaces most of the need for timeouts in the
+ GDB test suite, and makes it possible to distinguish between a hung target
+ and one with slow communications. */
+
+int watchdog = 0;
+
/*
LOCAL FUNCTION
@@ -330,5 +338,13 @@ If a SOURCE file is specified, dump only that file's partial symbols.",
add_cmd ("check-symtabs", class_maintenance, maintenance_check_symtabs,
"Check consistency of psymtabs and symtabs.",
&maintenancelist);
+
+ add_show_from_set (
+ add_set_cmd ("watchdog", class_maintenance, var_zinteger, (char *)&watchdog,
+ "Set watchdog timer.\n\
+When non-zero, this timeout is used instead of waiting forever for a target to\n\
+finish a low-level step or continue operation. If the specified amount of time\n\
+passes without a response from the target, an error occurs.", &setlist),
+ &showlist);
#endif /* MAINTENANCE_CMDS */
}