* mips-tdep.c (mips_pdr_data): New.
[deliverable/binutils-gdb.git] / gdb / top.c
index 0e22c1fa3e8fa6fe502d0299319cdbdb9613a3e3..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
@@ -147,7 +147,7 @@ int baud_rate = -1;
    In mid-1996, remote_timeout was moved from remote.c to top.c and 
    it began being used in other remote-* targets.  It appears that the
    default was changed to 20 seconds at that time, perhaps because the
-   Hitachi E7000 ICE didn't always respond in a timely manner.
+   Renesas E7000 ICE didn't always respond in a timely manner.
 
    But if 5 seconds is a long time to sit and wait for retransmissions,
    20 seconds is far worse.  This demonstrates the difficulty of using 
@@ -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;
@@ -669,10 +696,10 @@ execute_command (char *p, int from_tty)
       /* If the target is running, we allow only a limited set of
          commands. */
       if (event_loop_p && target_can_async_p () && target_executing)
-       if (!strcmp (c->name, "help")
-           && !strcmp (c->name, "pwd")
-           && !strcmp (c->name, "show")
-           && !strcmp (c->name, "stop"))
+       if (strcmp (c->name, "help") != 0
+           && strcmp (c->name, "pwd") != 0
+           && strcmp (c->name, "show") != 0
+           && strcmp (c->name, "stop") != 0)
          error ("Cannot execute this command while the target is running.");
 
       /* Pass null arg rather than an empty one.  */
@@ -1266,7 +1293,7 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
 #define SERVER_COMMAND_LENGTH 7
   server_command =
     (p - linebuffer > SERVER_COMMAND_LENGTH)
-    && STREQN (linebuffer, "server ", SERVER_COMMAND_LENGTH);
+    && strncmp (linebuffer, "server ", SERVER_COMMAND_LENGTH) == 0;
   if (server_command)
     {
       /* Note that we don't set `line'.  Between this and the check in
@@ -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
@@ -1375,7 +1402,7 @@ There is absolutely no warranty for GDB.  Type \"show warranty\" for details.\n"
   /* After the required info we print the configuration information. */
 
   fprintf_filtered (stream, "This GDB was configured as \"");
-  if (!STREQ (host_name, target_name))
+  if (strcmp (host_name, target_name) != 0)
     {
       fprintf_filtered (stream, "--host=%s --target=%s", host_name, target_name);
     }
@@ -1461,7 +1488,7 @@ quit_target (void *arg)
     }
 
   /* UDI wants this, to kill the TIP.  */
-  target_close (1);
+  target_close (&current_target, 1);
 
   /* Save the history information if it is appropriate to do so.  */
   if (write_history_p && history_filename)
This page took 0.027633 seconds and 4 git commands to generate.