* inftarg.c (child_thread_alive): New function to see if a
[deliverable/binutils-gdb.git] / gdb / maint.c
index 479ee6b5959fb51235fba8dfa327b8d35dabbc1c..7f822ecfd9c8163ab18ddfacfa4165d556e6811f 100644 (file)
@@ -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 */
 }
This page took 0.023592 seconds and 4 git commands to generate.