Make sure terminal settings are restored before exiting
[deliverable/binutils-gdb.git] / gdb / dtrace-probe.c
index 491d8538e62b8325f417f00495eac968bfd6d391..3f2548ddc4c2796c2e898ceb80639b94c1ed378f 100644 (file)
@@ -413,7 +413,7 @@ dtrace_process_dof_probe (struct objfile *objfile,
       for (j = 0; j < ret->probe_argc; j++)
        {
          struct dtrace_probe_arg arg;
-         struct expression *expr;
+         struct expression *expr = NULL;
 
          /* Set arg.expr to ensure all fields in expr are initialized and
             the compiler will not warn when arg is used.  */
@@ -427,8 +427,18 @@ dtrace_process_dof_probe (struct objfile *objfile,
             this does not work then we set the type to `long
             int'.  */
           arg.type = builtin_type (gdbarch)->builtin_long;
-         expr = parse_expression (arg.type_str);
-         if (expr->elts[0].opcode == OP_TYPE)
+
+         TRY
+           {
+             expr = parse_expression_with_language (arg.type_str, language_c);
+           }
+         CATCH (ex, RETURN_MASK_ERROR)
+           {
+             expr = NULL;
+           }
+         END_CATCH
+
+         if (expr != NULL && expr->elts[0].opcode == OP_TYPE)
            arg.type = expr->elts[1].type;
 
          VEC_safe_push (dtrace_probe_arg_s, ret->args, &arg);
This page took 0.024026 seconds and 4 git commands to generate.