2005-01-13 Andrew Cagney <cagney@gnu.org>
[deliverable/binutils-gdb.git] / gdb / mi / mi-main.c
index e373554621c46fa0c90b1e09f742d322ec1f2655..33ba1be9ff9b44bd2e0e7cb57c59e98f4ce1e9e2 100644 (file)
@@ -28,6 +28,7 @@
 #include "target.h"
 #include "inferior.h"
 #include "gdb_string.h"
+#include "exceptions.h"
 #include "top.h"
 #include "gdbthread.h"
 #include "mi-cmds.h"
@@ -181,7 +182,7 @@ mi_cmd_exec_return (char *args, int from_tty)
 
   /* Because we have called return_command with from_tty = 0, we need
      to print the frame here. */
-  print_stack_frame (get_selected_frame (), 1, LOC_AND_ADDRESS);
+  print_stack_frame (get_selected_frame (NULL), 1, LOC_AND_ADDRESS);
 
   return MI_CMD_DONE;
 }
@@ -327,7 +328,7 @@ mi_cmd_data_list_changed_registers (char *command, char **argv, int argc)
      case, some entries of REGISTER_NAME will change depending upon
      the particular processor being debugged.  */
 
-  numregs = NUM_REGS;
+  numregs = NUM_REGS + NUM_PSEUDO_REGS;
 
   cleanup = make_cleanup_ui_out_list_begin_end (uiout, "changed-registers");
 
@@ -423,7 +424,7 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc)
      case, some entries of REGISTER_NAME will change depending upon
      the particular processor being debugged.  */
 
-  numregs = NUM_REGS;
+  numregs = NUM_REGS + NUM_PSEUDO_REGS;
 
   if (argc == 0)
     {
@@ -563,7 +564,7 @@ mi_cmd_data_write_register_values (char *command, char **argv, int argc)
      case, some entries of REGISTER_NAME will change depending upon
      the particular processor being debugged.  */
 
-  numregs = NUM_REGS;
+  numregs = NUM_REGS + NUM_PSEUDO_REGS;
 
   if (argc == 0)
     {
@@ -679,7 +680,7 @@ mi_cmd_data_evaluate_expression (char *command, char **argv, int argc)
   val = evaluate_expression (expr);
 
   /* Print the result of the expression evaluation. */
-  val_print (VALUE_TYPE (val), VALUE_CONTENTS (val),
+  val_print (value_type (val), VALUE_CONTENTS (val),
             VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val),
             stb->stream, 0, 0, 0, 0);
 
@@ -1039,7 +1040,7 @@ mi_cmd_data_write_memory (char *command, char **argv, int argc)
    to perfrom after the given command has executed (display/supress
    prompt, display error). */
 
-static int
+static void
 captured_mi_execute_command (struct ui_out *uiout, void *data)
 {
   struct captured_mi_execute_command_args *args =
@@ -1094,7 +1095,7 @@ captured_mi_execute_command (struct ui_out *uiout, void *data)
            {
              mi_out_rewind (uiout);
              args->action = EXECUTE_COMMAND_DISPLAY_ERROR;
-             return 1;
+             return;
            }
          else
            mi_out_rewind (uiout);
@@ -1104,7 +1105,7 @@ captured_mi_execute_command (struct ui_out *uiout, void *data)
          /* Don't print the prompt. We are executing the target in
             synchronous mode. */
          args->action = EXECUTE_COMMAND_SUPRESS_PROMPT;
-         return 1;
+         return;
        }
       break;
 
@@ -1136,7 +1137,7 @@ captured_mi_execute_command (struct ui_out *uiout, void *data)
 
     }
 
-  return 1;
+  return;
 }
 
 
@@ -1146,7 +1147,6 @@ mi_execute_command (char *cmd, int from_tty)
   struct mi_parse *command;
   struct captured_mi_execute_command_args args;
   struct ui_out *saved_uiout = uiout;
-  int result;
 
   /* This is to handle EOF (^D). We just quit gdb. */
   /* FIXME: we should call some API function here. */
@@ -1157,11 +1157,12 @@ mi_execute_command (char *cmd, int from_tty)
 
   if (command != NULL)
     {
+      struct exception result;
       /* FIXME: cagney/1999-11-04: Can this use of catch_exceptions either
          be pushed even further down or even eliminated? */
       args.command = command;
-      result = catch_exceptions (uiout, captured_mi_execute_command, &args, "",
-                                RETURN_MASK_ALL);
+      result = catch_exception (uiout, captured_mi_execute_command, &args,
+                               RETURN_MASK_ALL);
 
       if (args.action == EXECUTE_COMMAND_SUPRESS_PROMPT)
        {
@@ -1170,9 +1171,10 @@ mi_execute_command (char *cmd, int from_tty)
          mi_parse_free (command);
          return;
        }
-      if (args.action == EXECUTE_COMMAND_DISPLAY_ERROR || result < 0)
+      if (args.action == EXECUTE_COMMAND_DISPLAY_ERROR
+         || result.reason < 0)
        {
-         char *msg = error_last_message ();
+         char *msg = result.message;
          struct cleanup *cleanup = make_cleanup (xfree, msg);
          /* The command execution failed and error() was called
             somewhere */
This page took 0.025565 seconds and 4 git commands to generate.