diff options
author | Joel Brobecker <brobecker@adacore.com> | 2015-03-26 19:14:03 +0100 |
---|---|---|
committer | Joel Brobecker <brobecker@adacore.com> | 2015-03-26 13:56:51 -0700 |
commit | 429e1e811b400f07b5a514ea6b8a70b28e2d7ee9 (patch) | |
tree | 639c6a7f54874d5b4e9bf2142a6b55f9b8209104 /gdb/parse.c | |
parent | 4593441bc5bcb7ec2e04b28591707cdebedd2e85 (diff) | |
download | gdb-429e1e811b400f07b5a514ea6b8a70b28e2d7ee9.zip gdb-429e1e811b400f07b5a514ea6b8a70b28e2d7ee9.tar.gz gdb-429e1e811b400f07b5a514ea6b8a70b28e2d7ee9.tar.bz2 |
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.
Diffstat (limited to 'gdb/parse.c')
-rw-r--r-- | gdb/parse.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/parse.c b/gdb/parse.c index ec23dbb..6b59c4f 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -1268,6 +1268,28 @@ parse_expression (const char *string) return exp; } +/* Same as parse_expression, but using the given language (LANG) + to parse the expression. */ + +struct expression * +parse_expression_with_language (const char *string, enum language lang) +{ + struct cleanup *old_chain = NULL; + struct expression *expr; + + if (current_language->la_language != lang) + { + old_chain = make_cleanup_restore_current_language (); + set_language (lang); + } + + expr = parse_expression (string); + + if (old_chain != NULL) + do_cleanups (old_chain); + return expr; +} + /* Parse STRING as an expression. If parsing ends in the middle of a field reference, return the type of the left-hand-side of the reference; furthermore, if the parsing ends in the field name, |