* mips-tdep.c (mips_pdr_data): New.
[deliverable/binutils-gdb.git] / gdb / top.c
index c52c1765d68aa8cee05908fabe4bf3570ffe71fe..d6bdfd0928410dfd79b9a8f8acb73a09d4fa04e5 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1,7 +1,7 @@
 /* Top level stuff for GDB, the GNU debugger.
 
    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
-   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -47,8 +47,8 @@
 #include "gdb_assert.h"
 
 /* readline include files */
-#include <readline/readline.h>
-#include <readline/history.h>
+#include "readline/readline.h"
+#include "readline/history.h"
 
 /* readline defines this.  */
 #undef savestring
@@ -383,6 +383,7 @@ catcher (catch_exceptions_ftype *func,
         int *func_val,
         enum return_reason *func_caught,
         char *errstring,
+        char **gdberrmsg,
         return_mask mask)
 {
   SIGJMP_BUF *saved_catch;
@@ -428,7 +429,14 @@ catcher (catch_exceptions_ftype *func,
   if (!caught)
     val = (*func) (func_uiout, func_args);
   else
-    val = 0;
+    {
+      val = 0;
+      /* If caller wants a copy of the low-level error message, make one.  
+         This is used in the case of a silent error whereby the caller
+         may optionally want to issue the message.  */
+      if (gdberrmsg)
+       *gdberrmsg = error_last_message ();
+    }
   catch_return = saved_catch;
 
   /* FIXME: cagney/1999-11-05: A correct FUNC implementation will
@@ -476,7 +484,25 @@ catch_exceptions (struct ui_out *uiout,
 {
   int val;
   enum return_reason caught;
-  catcher (func, uiout, func_args, &val, &caught, errstring, mask);
+  catcher (func, uiout, func_args, &val, &caught, errstring, NULL, mask);
+  gdb_assert (val >= 0);
+  gdb_assert (caught <= 0);
+  if (caught < 0)
+    return caught;
+  return val;
+}
+
+int
+catch_exceptions_with_msg (struct ui_out *uiout,
+                          catch_exceptions_ftype *func,
+                          void *func_args,
+                          char *errstring,
+                          char **gdberrmsg,
+                          return_mask mask)
+{
+  int val;
+  enum return_reason caught;
+  catcher (func, uiout, func_args, &val, &caught, errstring, gdberrmsg, mask);
   gdb_assert (val >= 0);
   gdb_assert (caught <= 0);
   if (caught < 0)
@@ -506,7 +532,8 @@ catch_errors (catch_errors_ftype *func, void *func_args, char *errstring,
   struct catch_errors_args args;
   args.func = func;
   args.func_args = func_args;
-  catcher (do_catch_errors, uiout, &args, &val, &caught, errstring, mask);
+  catcher (do_catch_errors, uiout, &args, &val, &caught, errstring, 
+          NULL, mask);
   if (caught != 0)
     return 0;
   return val;
@@ -1359,7 +1386,7 @@ print_gdb_version (struct ui_file *stream)
 
   /* Second line is a copyright notice. */
 
-  fprintf_filtered (stream, "Copyright 2003 Free Software Foundation, Inc.\n");
+  fprintf_filtered (stream, "Copyright 2004 Free Software Foundation, Inc.\n");
 
   /* Following the copyright is a brief statement that the program is
      free software, that users are free to copy and change it on
This page took 0.027096 seconds and 4 git commands to generate.