From 429e1e811b400f07b5a514ea6b8a70b28e2d7ee9 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 26 Mar 2015 19:14:03 +0100 Subject: dtrace-probe: Handle error while parsing probe argument. The debugger on Solaris has been broken since the introduction of DTrace probe support: (gdb) start Temporary breakpoint 1 at 0x80593bc: file simple_main.adb, line 4. Starting program: /[...]/simple_main [Thread debugging using libthread_db enabled] No definition of "mutex_t" in current context. The problem occurs while trying to parse a probe's argument, and the exception propagates all the way to the top. This patch fixes the issue by containing the exception and falling back on using the "long" builtin type if the argument's type could not be determined. Also, the parsing should be done using the C language parser. gdb/ChangeLog: * dtrace-probe.c (dtrace_process_dof_probe): Contain any exception raised while parsing the probe arguments. Force parsing to be done using the C language parser. * expression.h (parse_expression_with_language): Declare. * parse.c (parse_expression_with_language): New function. --- gdb/dtrace-probe.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'gdb/dtrace-probe.c') diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c index 491d853..ff7ce7d 100644 --- a/gdb/dtrace-probe.c +++ b/gdb/dtrace-probe.c @@ -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); -- cgit v1.1