aboutsummaryrefslogtreecommitdiff
path: root/gdb/monitor.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-08-09 21:36:23 +0000
committerJason Molenda <jmolenda@apple.com>1999-08-09 21:36:23 +0000
commit96baa820df8126165bd3c4a33c561556b21203af (patch)
tree60cf1938a2c0aaae5d3aab73b553f031138ec99c /gdb/monitor.c
parent10e80b41455f1a386485631b7c170cafe341dcd6 (diff)
downloadgdb-96baa820df8126165bd3c4a33c561556b21203af.zip
gdb-96baa820df8126165bd3c4a33c561556b21203af.tar.gz
gdb-96baa820df8126165bd3c4a33c561556b21203af.tar.bz2
import gdb-1999-08-09 snapshot
Diffstat (limited to 'gdb/monitor.c')
-rw-r--r--gdb/monitor.c48
1 files changed, 8 insertions, 40 deletions
diff --git a/gdb/monitor.c b/gdb/monitor.c
index 306b783..01fda27 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -42,11 +42,6 @@
#include "gdbcore.h"
#include "target.h"
#include "wait.h"
-#ifdef ANSI_PROTOTYPES
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include <signal.h>
#include <ctype.h>
#include "gdb_string.h"
@@ -67,8 +62,6 @@ static void monitor_vsprintf PARAMS ((char *sndbuf, char *pattern, va_list args)
static int readchar PARAMS ((int timeout));
-static void monitor_command PARAMS ((char *args, int fromtty));
-
static void monitor_fetch_register PARAMS ((int regno));
static void monitor_store_register PARAMS ((int regno));
@@ -322,24 +315,13 @@ monitor_vsprintf (sndbuf, pattern, args)
Works just like printf. */
void
-#ifdef ANSI_PROTOTYPES
monitor_printf_noecho (char *pattern,...)
-#else
-monitor_printf_noecho (va_alist)
- va_dcl
-#endif
{
va_list args;
char sndbuf[2000];
int len;
-#if ANSI_PROTOTYPES
va_start (args, pattern);
-#else
- char *pattern;
- va_start (args);
- pattern = va_arg (args, char *);
-#endif
monitor_vsprintf (sndbuf, pattern, args);
@@ -366,24 +348,13 @@ monitor_printf_noecho (va_alist)
printf. */
void
-#ifdef ANSI_PROTOTYPES
monitor_printf (char *pattern,...)
-#else
-monitor_printf (va_alist)
- va_dcl
-#endif
{
va_list args;
char sndbuf[2000];
int len;
-#ifdef ANSI_PROTOTYPES
va_start (args, pattern);
-#else
- char *pattern;
- va_start (args);
- pattern = va_arg (args, char *);
-#endif
monitor_vsprintf (sndbuf, pattern, args);
@@ -2261,14 +2232,13 @@ monitor_stop ()
monitor_printf_noecho (current_monitor->stop);
}
-/* Put a command string, in args, out to MONITOR. Output from MONITOR
- is placed on the users terminal until the prompt is seen. FIXME: We
- read the characters ourseleves here cause of a nasty echo. */
+/* Put a COMMAND string out to MONITOR. Output from MONITOR is placed
+ in OUTPUT until the prompt is seen. FIXME: We read the characters
+ ourseleves here cause of a nasty echo. */
static void
-monitor_command (args, from_tty)
- char *args;
- int from_tty;
+monitor_rcmd (char *command,
+ struct gdb_file *outbuf)
{
char *p;
int resp_len;
@@ -2282,11 +2252,11 @@ monitor_command (args, from_tty)
/* Send the command. Note that if no args were supplied, then we're
just sending the monitor a newline, which is sometimes useful. */
- monitor_printf ("%s\r", (args ? args : ""));
+ monitor_printf ("%s\r", (command ? command : ""));
resp_len = monitor_expect_prompt (buf, sizeof buf);
- fputs_unfiltered (buf, gdb_stdout); /* Output the response */
+ fputs_unfiltered (buf, outbuf); /* Output the response */
}
/* Convert hex digit A to a number. */
@@ -2369,6 +2339,7 @@ init_base_monitor_ops (void)
monitor_ops.to_notice_signals = 0;
monitor_ops.to_thread_alive = 0;
monitor_ops.to_stop = monitor_stop;
+ monitor_ops.to_rcmd = monitor_rcmd;
monitor_ops.to_pid_to_exec_file = NULL;
monitor_ops.to_core_file_to_sym_file = NULL;
monitor_ops.to_stratum = process_stratum;
@@ -2407,7 +2378,4 @@ _initialize_remote_monitors ()
When enabled, a hashmark \'#\' is displayed.",
&setlist),
&showlist);
-
- add_com ("monitor", class_obscure, monitor_command,
- "Send a command to the debug monitor.");
}