aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1995-06-20 19:13:20 +0000
committerStan Shebs <shebs@codesourcery.com>1995-06-20 19:13:20 +0000
commit4a4307947e623d46d9641e7e9ae519272f646649 (patch)
tree68fe58a6f93217fd705778c4b95de723a5a79897
parent34308df7a356a049c3bbd396ed5852810991857e (diff)
downloadgdb-4a4307947e623d46d9641e7e9ae519272f646649.zip
gdb-4a4307947e623d46d9641e7e9ae519272f646649.tar.gz
gdb-4a4307947e623d46d9641e7e9ae519272f646649.tar.bz2
* monitor.c (monitor_wait): Don't use the watchdog timeout
if its value is 0. * w89k-rom.c (w89k_open): Define to be static.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/monitor.c30
-rw-r--r--gdb/w89k-rom.c2
3 files changed, 33 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 83e8dff..e72ec9d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+Tue Jun 20 12:03:36 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * monitor.c (monitor_wait): Don't use the watchdog timeout
+ if its value is 0.
+ * w89k-rom.c (w89k_open): Define to be static.
+
+start-sanitize-gdbtk
Tue Jun 20 10:19:40 1995 Stu Grossman (grossman@cygnus.com)
* gdbtk.c: Add functions Tcl_Malloc, Tcl_Realloc, and Tcl_Free.
@@ -12,6 +19,7 @@ Tue Jun 20 10:19:40 1995 Stu Grossman (grossman@cygnus.com)
* (build_framework): Turn on breakpoint menu.
* (create_command_window): Implement tab completion. Add binding
for ^C to stop target.
+end-sanitize-gdbtk
Sat Jun 17 10:17:16 1995 Jeff Law (law@snake.cs.utah.edu)
diff --git a/gdb/monitor.c b/gdb/monitor.c
index ba54719..83073ff 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -32,7 +32,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "gdbcore.h"
#include "target.h"
#include "wait.h"
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
@@ -89,6 +89,8 @@ static int hashmark; /* flag set by "set hash" */
static int timeout = 30;
+static int in_monitor_wait = 0; /* Non-zero means we are in monitor_wait() */
+
static void (*ofunc)(); /* Old SIGINT signal handler */
/* Descriptor for I/O to remote machine. Initialize it to NULL so
@@ -115,7 +117,7 @@ static int dump_reg_flag; /* Non-zero means do a dump_registers cmd when
Works just like printf. */
void
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
monitor_printf_noecho (char *pattern, ...)
#else
monitor_printf_noecho (va_alist)
@@ -126,7 +128,7 @@ monitor_printf_noecho (va_alist)
char sndbuf[2000];
int len;
-#if __STDC__
+#if ANSI_PROTOTYPES
va_start (args, pattern);
#else
char *pattern;
@@ -152,7 +154,7 @@ monitor_printf_noecho (va_alist)
printf. */
void
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
monitor_printf (char *pattern, ...)
#else
monitor_printf (va_alist)
@@ -164,7 +166,7 @@ monitor_printf (va_alist)
int len;
int i, c;
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
va_start (args, pattern);
#else
char *pattern;
@@ -221,7 +223,15 @@ readchar (timeout)
return c & 0x7f;
if (c == SERIAL_TIMEOUT)
- error ("Timeout reading from remote system.");
+#ifdef MAINTENANCE_CMDS
+ if (in_monitor_wait) /* Watchdog went off */
+ {
+ target_mourn_inferior ();
+ error ("Watchdog has expired. Target detached.\n");
+ }
+ else
+#endif
+ error ("Timeout reading from remote system.");
perror_with_name ("remote-monitor");
}
@@ -603,6 +613,7 @@ monitor_wait_cleanup (old_timeout)
{
timeout = old_timeout;
signal (SIGINT, ofunc);
+ in_monitor_wait = 0;
}
/* Wait until the remote machine stops, then return, storing status in
@@ -623,7 +634,12 @@ monitor_wait (pid, status)
old_chain = make_cleanup (monitor_wait_cleanup, old_timeout);
+#ifdef MAINTENANCE_CMDS
+ in_monitor_wait = 1;
+ timeout = watchdog > 0 ? watchdog : -1;
+#else
timeout = -1; /* Don't time out -- user program is running. */
+#endif
ofunc = (void (*)()) signal (SIGINT, monitor_interrupt);
@@ -656,6 +672,8 @@ monitor_wait (pid, status)
discard_cleanups (old_chain);
+ in_monitor_wait = 0;
+
return inferior_pid;
}
diff --git a/gdb/w89k-rom.c b/gdb/w89k-rom.c
index 9eaf25c..e9cb2f9 100644
--- a/gdb/w89k-rom.c
+++ b/gdb/w89k-rom.c
@@ -298,7 +298,7 @@ static struct monitor_ops w89k_cmds =
MONITOR_OPS_MAGIC /* magic */
};
-void
+static void
w89k_open(args, from_tty)
char *args;
int from_tty;