Fix test names starting with uppercase using multi-line gdb_test_no_output
[deliverable/binutils-gdb.git] / gdb / break-catch-sig.c
index 158ce036ac4186cbfb9255bff6c49042e4406c48..e869a83d3608c242ccaa1de2644d6de9cbedb16a 100644 (file)
@@ -1,6 +1,6 @@
 /* Everything about signal catchpoints, for GDB.
 
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-2016 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -28,7 +28,8 @@
 #include "valprint.h"
 #include "cli/cli-utils.h"
 #include "completer.h"
-#include "gdb_obstack.h"
+
+#include <string>
 
 #define INTERNAL_SIGNAL(x) ((x) == GDB_SIGNAL_TRAP || (x) == GDB_SIGNAL_INT)
 
@@ -137,7 +138,8 @@ signal_catchpoint_insert_location (struct bp_location *bl)
    catchpoints.  */
 
 static int
-signal_catchpoint_remove_location (struct bp_location *bl)
+signal_catchpoint_remove_location (struct bp_location *bl,
+                                  enum remove_bp_reason reason)
 {
   struct signal_catchpoint *c = (struct signal_catchpoint *) bl->owner;
   int i;
@@ -220,14 +222,16 @@ signal_catchpoint_print_it (bpstat bs)
   ptid_t ptid;
   struct target_waitstatus last;
   const char *signal_name;
+  struct ui_out *uiout = current_uiout;
 
   get_last_target_status (&ptid, &last);
 
   signal_name = signal_to_name_or_int (last.value.sig);
 
   annotate_catchpoint (b->number);
+  maybe_print_thread_hit_breakpoint (uiout);
 
-  printf_filtered (_("\nCatchpoint %d (signal %s), "), b->number, signal_name);
+  printf_filtered (_("Catchpoint %d (signal %s), "), b->number, signal_name);
 
   return PRINT_SRC_AND_LOC;
 }
@@ -262,11 +266,7 @@ signal_catchpoint_print_one (struct breakpoint *b,
     {
       int i;
       gdb_signal_type iter;
-      struct obstack text;
-      struct cleanup *cleanup;
-
-      obstack_init (&text);
-      cleanup = make_cleanup_obstack_free (&text);
+      std::string text;
 
       for (i = 0;
            VEC_iterate (gdb_signal_type, c->signals_to_be_caught, i, iter);
@@ -275,12 +275,10 @@ signal_catchpoint_print_one (struct breakpoint *b,
          const char *name = signal_to_name_or_int (iter);
 
          if (i > 0)
-           obstack_grow (&text, " ", 1);
-         obstack_grow (&text, name, strlen (name));
+           text += " ";
+         text += name;
         }
-      obstack_grow (&text, "", 1);
-      ui_out_field_string (uiout, "what", (const char *) obstack_base (&text));
-      do_cleanups (cleanup);
+      ui_out_field_string (uiout, "what", text.c_str ());
     }
   else
     ui_out_field_string (uiout, "what",
@@ -373,7 +371,7 @@ create_signal_catchpoint (int tempflag, VEC (gdb_signal_type) *filter,
   struct signal_catchpoint *c;
   struct gdbarch *gdbarch = get_current_arch ();
 
-  c = XNEW (struct signal_catchpoint);
+  c = new signal_catchpoint ();
   init_catchpoint (&c->base, gdbarch, tempflag, NULL, &signal_catchpoint_ops);
   c->signals_to_be_caught = filter;
   c->catch_all = catch_all;
This page took 0.024452 seconds and 4 git commands to generate.