gdb/
[deliverable/binutils-gdb.git] / gdb / mi / mi-main.c
index 787d2475de2d186a98c01af90a80d2b802c4e2ac..f1d21bcf6eb8f98b4105c866b34f3ab1667e2be6 100644 (file)
@@ -210,7 +210,7 @@ proceed_thread (struct thread_info *thread, int pid)
 
   switch_to_thread (thread->ptid);
   clear_proceed_status ();
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
+  proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT, 0);
 }
 
 static int
@@ -1131,13 +1131,8 @@ get_register (struct frame_info *frame, int regnum, int format)
 {
   struct gdbarch *gdbarch = get_frame_arch (frame);
   struct ui_out *uiout = current_uiout;
-  CORE_ADDR addr;
-  enum lval_type lval;
-  struct ui_stream *stb;
   struct value *val;
 
-  stb = ui_out_stream_new (uiout);
-
   if (format == 'N')
     format = 0;
 
@@ -1167,15 +1162,20 @@ get_register (struct frame_info *frame, int regnum, int format)
   else
     {
       struct value_print_options opts;
+      struct ui_file *stb;
+      struct cleanup *old_chain;
+
+      stb = mem_fileopen ();
+      old_chain = make_cleanup_ui_file_delete (stb);
 
       get_formatted_print_options (&opts, format);
       opts.deref_ref = 1;
       val_print (value_type (val),
                 value_contents_for_printing (val),
                 value_embedded_offset (val), 0,
-                stb->stream, 0, val, &opts, current_language);
+                stb, 0, val, &opts, current_language);
       ui_out_field_stream (uiout, "value", stb);
-      ui_out_stream_delete (stb);
+      do_cleanups (old_chain);
     }
 }
 
@@ -1247,34 +1247,31 @@ void
 mi_cmd_data_evaluate_expression (char *command, char **argv, int argc)
 {
   struct expression *expr;
-  struct cleanup *old_chain = NULL;
+  struct cleanup *old_chain;
   struct value *val;
-  struct ui_stream *stb = NULL;
+  struct ui_file *stb;
   struct value_print_options opts;
   struct ui_out *uiout = current_uiout;
 
-  stb = ui_out_stream_new (uiout);
+  stb = mem_fileopen ();
+  old_chain = make_cleanup_ui_file_delete (stb);
 
   if (argc != 1)
-    {
-      ui_out_stream_delete (stb);
-      error (_("-data-evaluate-expression: "
-              "Usage: -data-evaluate-expression expression"));
-    }
+    error (_("-data-evaluate-expression: "
+            "Usage: -data-evaluate-expression expression"));
 
   expr = parse_expression (argv[0]);
 
-  old_chain = make_cleanup (free_current_contents, &expr);
+  make_cleanup (free_current_contents, &expr);
 
   val = evaluate_expression (expr);
 
   /* Print the result of the expression evaluation.  */
   get_user_print_options (&opts);
   opts.deref_ref = 0;
-  common_val_print (val, stb->stream, 0, &opts, current_language);
+  common_val_print (val, stb, 0, &opts, current_language);
 
   ui_out_field_stream (uiout, "value", stb);
-  ui_out_stream_delete (stb);
 
   do_cleanups (old_chain);
 }
@@ -1420,12 +1417,15 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
 
   /* Build the result as a two dimentional table.  */
   {
-    struct ui_stream *stream = ui_out_stream_new (uiout);
-    struct cleanup *cleanup_list_memory;
+    struct ui_file *stream;
+    struct cleanup *cleanup_stream;
     int row;
     int row_byte;
 
-    cleanup_list_memory = make_cleanup_ui_out_list_begin_end (uiout, "memory");
+    stream = mem_fileopen ();
+    cleanup_stream = make_cleanup_ui_file_delete (stream);
+
+    make_cleanup_ui_out_list_begin_end (uiout, "memory");
     for (row = 0, row_byte = 0;
         row < nr_rows;
         row++, row_byte += nr_cols * word_size)
@@ -1452,9 +1452,9 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
              }
            else
              {
-               ui_file_rewind (stream->stream);
+               ui_file_rewind (stream);
                print_scalar_formatted (mbuf + col_byte, word_type, &opts,
-                                       word_asize, stream->stream);
+                                       word_asize, stream);
                ui_out_field_stream (uiout, NULL, stream);
              }
          }
@@ -1463,23 +1463,22 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
          {
            int byte;
 
-           ui_file_rewind (stream->stream);
+           ui_file_rewind (stream);
            for (byte = row_byte;
                 byte < row_byte + word_size * nr_cols; byte++)
              {
                if (byte >= nr_bytes)
-                 fputc_unfiltered ('X', stream->stream);
+                 fputc_unfiltered ('X', stream);
                else if (mbuf[byte] < 32 || mbuf[byte] > 126)
-                 fputc_unfiltered (aschar, stream->stream);
+                 fputc_unfiltered (aschar, stream);
                else
-                 fputc_unfiltered (mbuf[byte], stream->stream);
+                 fputc_unfiltered (mbuf[byte], stream);
              }
            ui_out_field_stream (uiout, "ascii", stream);
          }
        do_cleanups (cleanup_tuple);
       }
-    ui_out_stream_delete (stream);
-    do_cleanups (cleanup_list_memory);
+    do_cleanups (cleanup_stream);
   }
   do_cleanups (cleanups);
 }
@@ -2029,9 +2028,6 @@ mi_execute_command (char *cmd, int from_tty)
 
       mi_parse_free (command);
     }
-
-  fputs_unfiltered ("(gdb) \n", raw_stdout);
-  gdb_flush (raw_stdout);
 }
 
 static void
@@ -2068,7 +2064,7 @@ mi_cmd_execute (struct mi_parse *parse)
         provide --thread if it wishes to operate on a specific
         thread.  */
       if (inf->pid != 0)
-       tp = any_thread_of_process (inf->pid);
+       tp = any_live_thread_of_process (inf->pid);
       switch_to_thread (tp ? tp->ptid : null_ptid);
       set_current_program_space (inf->pspace);
     }
@@ -2101,10 +2097,10 @@ mi_cmd_execute (struct mi_parse *parse)
 
   current_context = parse;
 
-  if (strncmp (parse->command, "break-", sizeof ("break-") - 1 ) == 0)
+  if (parse->cmd->suppress_notification != NULL)
     {
-      make_cleanup_restore_integer (&mi_suppress_breakpoint_notifications);
-      mi_suppress_breakpoint_notifications = 1;
+      make_cleanup_restore_integer (parse->cmd->suppress_notification);
+      *parse->cmd->suppress_notification = 1;
     }
 
   if (parse->cmd->argv_func != NULL)
@@ -2440,7 +2436,8 @@ mi_cmd_trace_find (char *command, char **argv, int argc)
       if (argc != 2)
        error (_("Line is required"));
 
-      sals = decode_line_spec (argv[1], DECODE_LINE_FUNFIRSTLINE);
+      sals = decode_line_with_current_source (argv[1],
+                                             DECODE_LINE_FUNFIRSTLINE);
       back_to = make_cleanup (xfree, sals.sals);
 
       sal = sals.sals[0];
This page took 0.026636 seconds and 4 git commands to generate.