Make exceptions use std::string and be self-managing
[deliverable/binutils-gdb.git] / gdb / mi / mi-cmd-stack.c
index 119e887e6b3873241651e13bf6fe8b6b34c03d10..0cec856b8375852adb5fe2ca8e2a6c9df580205f 100644 (file)
@@ -527,10 +527,8 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
 
   if (arg->val || arg->error)
     {
-      const char *error_message = NULL;
-
       if (arg->error)
-       error_message = arg->error;
+       stb.printf (_("<error reading variable: %s>"), arg->error);
       else
        {
          TRY
@@ -544,12 +542,11 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
            }
          CATCH (except, RETURN_MASK_ERROR)
            {
-             error_message = except.message;
+             stb.printf (_("<error reading variable: %s>"),
+                         except.what ());
            }
          END_CATCH
        }
-      if (error_message != NULL)
-       stb.printf (_("<error reading variable: %s>"), error_message);
       uiout->field_stream ("value", stb);
     }
 }
This page took 0.028496 seconds and 4 git commands to generate.