Use ui_file_as_string throughout more
[deliverable/binutils-gdb.git] / gdb / break-catch-throw.c
index cfec33b101c4e58ad19e7eda611470908e9db5f1..6136a573c6319ddec54c4102cffdcd0e71c598a5 100644 (file)
@@ -162,7 +162,7 @@ check_status_exception_catchpoint (struct bpstats *bs)
 {
   struct exception_catchpoint *self
     = (struct exception_catchpoint *) bs->breakpoint_at;
-  char *type_name = NULL;
+  std::string type_name;
 
   bkpt_breakpoint_ops.check_status (bs);
   if (bs->stop == 0)
@@ -174,17 +174,14 @@ check_status_exception_catchpoint (struct bpstats *bs)
   TRY
     {
       struct value *typeinfo_arg;
-      char *canon;
+      std::string canon;
 
       fetch_probe_arguments (NULL, &typeinfo_arg);
       type_name = cplus_typename_from_type_info (typeinfo_arg);
 
-      canon = cp_canonicalize_string (type_name);
-      if (canon != NULL)
-       {
-         xfree (type_name);
-         type_name = canon;
-       }
+      canon = cp_canonicalize_string (type_name.c_str ());
+      if (!canon.empty ())
+       std::swap (type_name, canon);
     }
   CATCH (e, RETURN_MASK_ERROR)
     {
@@ -192,12 +189,10 @@ check_status_exception_catchpoint (struct bpstats *bs)
     }
   END_CATCH
 
-  if (type_name != NULL)
+  if (!type_name.empty ())
     {
-      if (regexec (self->pattern, type_name, 0, NULL, 0) != 0)
+      if (regexec (self->pattern, type_name.c_str (), 0, NULL, 0) != 0)
        bs->stop = 0;
-
-      xfree (type_name);
     }
 }
 
This page took 0.024807 seconds and 4 git commands to generate.