aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1995-06-21 21:47:06 +0000
committerSteve Chamberlain <sac@cygnus>1995-06-21 21:47:06 +0000
commit45993f6118fb8065ed70d448f4e741763cb8fe4d (patch)
tree5d0efb4afc2f3a4edde351181b04a8dd37a1fad4 /gdb/utils.c
parent65b175c5e61b058aa7de9660c720371b11b95c45 (diff)
downloadgdb-45993f6118fb8065ed70d448f4e741763cb8fe4d.zip
gdb-45993f6118fb8065ed70d448f4e741763cb8fe4d.tar.gz
gdb-45993f6118fb8065ed70d448f4e741763cb8fe4d.tar.bz2
Hmm.. The ChangeLog went in, but not the code....
* monitor.c: Turn on caching. (monitor_printf): If a ^C was sent, don't expect to see its echo. (monitor_open): Enable caching. (monitor_resume, monitor_load): Flush cache. (monitor_xfer_memory): Call cache routine. (monitor_dump_regs): New. (monitor_fetch_registers): If monitor_dump_regs available then use it. (monitor_load): Don't ref exec_bfd if it's NULL. (monitor_load_srec): Use new monitor_make_srec calling convention. (monitor_make_srec): Rewrite to cope with two, three and four byte addresses. * remote-hms.c (hms_cmds): Initialze end-of-command delim. * dcache.h, dcache.h: Rewritten. * remote.c: Reenable caching. (getpkt): Reduce MAX_TRIES to 3. (remote_xfer_memory): Use dcache_xfer_memory. * defs.h (error_hook): New. * top.c (error_hook): New definition. * utils.c (error): Use error_hook if initialized. * sparcl-tdep.c (HAVE_SOCKETS): Don't define if GO32 or WIN32. Use HAVE_SOCKETS in place of #ifndef GO32.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c73
1 files changed, 40 insertions, 33 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index c11e15f..ed764e5 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -23,7 +23,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <sys/param.h>
#include <pwd.h>
#endif
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
@@ -254,7 +254,7 @@ warning_begin ()
/* VARARGS */
void
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
warning (char *string, ...)
#else
warning (va_alist)
@@ -262,7 +262,7 @@ warning (va_alist)
#endif
{
va_list args;
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
va_start (args, string);
#else
char *string;
@@ -300,31 +300,39 @@ error_begin ()
The first argument STRING is the error message, used as a fprintf string,
and the remaining args are passed as arguments to it. */
-/* VARARGS */
+#ifdef ANSI_PROTOTYPES
NORETURN void
-#ifdef __STDC__
error (char *string, ...)
#else
error (va_alist)
va_dcl
#endif
{
+#ifdef ANSI_PROTOTYPES
va_list args;
-#ifdef __STDC__
va_start (args, string);
#else
- char *string;
-
va_start (args);
- string = va_arg (args, char *);
#endif
- error_begin ();
- vfprintf_filtered (gdb_stderr, string, args);
- fprintf_filtered (gdb_stderr, "\n");
- va_end (args);
- return_to_top_level (RETURN_ERROR);
+ if (error_hook)
+ error_hook();
+ else
+ {
+ char *string1;
+ error_begin ();
+#ifdef ANSI_PROTOTYPES
+ vfprintf_filtered (gdb_stderr, string, args);
+#else
+ string1 = va_arg (args, char *);
+ vfprintf_filtered (gdb_stderr, string1, args);
+#endif
+ fprintf_filtered (gdb_stderr, "\n");
+ va_end (args);
+ return_to_top_level (RETURN_ERROR);
+ }
}
+
/* Print an error message and exit reporting failure.
This is for a error that we cannot continue from.
The arguments are printed a la printf.
@@ -334,7 +342,7 @@ error (va_alist)
/* VARARGS */
NORETURN void
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
fatal (char *string, ...)
#else
fatal (va_alist)
@@ -342,11 +350,10 @@ fatal (va_alist)
#endif
{
va_list args;
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
va_start (args, string);
#else
char *string;
-
va_start (args);
string = va_arg (args, char *);
#endif
@@ -362,7 +369,7 @@ fatal (va_alist)
/* VARARGS */
static void
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
fatal_dump_core (char *string, ...)
#else
fatal_dump_core (va_alist)
@@ -370,7 +377,7 @@ fatal_dump_core (va_alist)
#endif
{
va_list args;
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
va_start (args, string);
#else
char *string;
@@ -875,7 +882,7 @@ gdb_print_address (addr, stream)
/* VARARGS */
int
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
query (char *ctlstr, ...)
#else
query (va_alist)
@@ -887,7 +894,7 @@ query (va_alist)
register int ans2;
int retval;
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
va_start (args, ctlstr);
#else
char *ctlstr;
@@ -1539,7 +1546,7 @@ vprintf_unfiltered (format, args)
/* VARARGS */
void
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
fprintf_filtered (FILE *stream, char *format, ...)
#else
fprintf_filtered (va_alist)
@@ -1547,7 +1554,7 @@ fprintf_filtered (va_alist)
#endif
{
va_list args;
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
FILE *stream;
@@ -1563,7 +1570,7 @@ fprintf_filtered (va_alist)
/* VARARGS */
void
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
fprintf_unfiltered (FILE *stream, char *format, ...)
#else
fprintf_unfiltered (va_alist)
@@ -1571,7 +1578,7 @@ fprintf_unfiltered (va_alist)
#endif
{
va_list args;
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
FILE *stream;
@@ -1590,7 +1597,7 @@ fprintf_unfiltered (va_alist)
/* VARARGS */
void
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
fprintfi_filtered (int spaces, FILE *stream, char *format, ...)
#else
fprintfi_filtered (va_alist)
@@ -1598,7 +1605,7 @@ fprintfi_filtered (va_alist)
#endif
{
va_list args;
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
int spaces;
@@ -1619,7 +1626,7 @@ fprintfi_filtered (va_alist)
/* VARARGS */
void
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
printf_filtered (char *format, ...)
#else
printf_filtered (va_alist)
@@ -1627,7 +1634,7 @@ printf_filtered (va_alist)
#endif
{
va_list args;
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
char *format;
@@ -1642,7 +1649,7 @@ printf_filtered (va_alist)
/* VARARGS */
void
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
printf_unfiltered (char *format, ...)
#else
printf_unfiltered (va_alist)
@@ -1650,7 +1657,7 @@ printf_unfiltered (va_alist)
#endif
{
va_list args;
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
char *format;
@@ -1667,7 +1674,7 @@ printf_unfiltered (va_alist)
/* VARARGS */
void
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
printfi_filtered (int spaces, char *format, ...)
#else
printfi_filtered (va_alist)
@@ -1675,7 +1682,7 @@ printfi_filtered (va_alist)
#endif
{
va_list args;
-#ifdef __STDC__
+#ifdef ANSI_PROTOTYPES
va_start (args, format);
#else
int spaces;