diff options
author | Nicholas Duffek <nsd@redhat.com> | 2000-04-03 03:39:09 +0000 |
---|---|---|
committer | Nicholas Duffek <nsd@redhat.com> | 2000-04-03 03:39:09 +0000 |
commit | c91ecb25c3d04094aafd260522f8d85e2286ff87 (patch) | |
tree | fd5eb6d3a6c6a2e5da10b43f1fecafa6158b842f /gdb/wrapper.c | |
parent | f9e73361c87cb43b864ae542a5e1a1dd7669de86 (diff) | |
download | gdb-c91ecb25c3d04094aafd260522f8d85e2286ff87.zip gdb-c91ecb25c3d04094aafd260522f8d85e2286ff87.tar.gz gdb-c91ecb25c3d04094aafd260522f8d85e2286ff87.tar.bz2 |
* gdbtypes.c (safe_parse_type): New wrapper function to ignore
error() during parse_and_eval_type().
(check_stub_method): Call safe_parse_type instead of
parse_and_eval_type().
* wrapper.c (gdb_parse_and_eval_type): New wrapper function.
(wrap_parse_and_eval_type): New support function.
* wrapper.h (gdb_parse_and_eval_type): Prototype.
(wrap_parse_and_eval_type): Prototype.
Diffstat (limited to 'gdb/wrapper.c')
-rw-r--r-- | gdb/wrapper.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/wrapper.c b/gdb/wrapper.c index 83405e5..7ee26a7 100644 --- a/gdb/wrapper.c +++ b/gdb/wrapper.c @@ -61,6 +61,9 @@ int wrap_value_subscript PARAMS ((char *)); int gdb_value_ind PARAMS ((value_ptr val, value_ptr * rval)); int wrap_value_ind PARAMS ((char *opaque_arg)); +int gdb_parse_and_eval_type (char *, int, struct type **); +int wrap_parse_and_eval_type (char *); + int gdb_parse_exp_1 (stringptr, block, comma, expression) char **stringptr; @@ -252,3 +255,33 @@ wrap_value_ind (opaque_arg) return 1; } +int +gdb_parse_and_eval_type (char *p, int length, struct type **type) +{ + struct gdb_wrapper_arguments args; + args.args[0].pointer = p; + args.args[1].integer = length; + + if (!catch_errors ((catch_errors_ftype *) wrap_parse_and_eval_type, &args, + "", RETURN_MASK_ALL)) + { + /* An error occurred */ + return 0; + } + + *type = (struct type *) args.result.pointer; + return 1; +} + +int +wrap_parse_and_eval_type (char *a) +{ + struct gdb_wrapper_arguments *args = (struct gdb_wrapper_arguments *) a; + + char *p = (char *) args->args[0].pointer; + int length = args->args[1].integer; + + args->result.pointer = (char *) parse_and_eval_type (p, length); + + return 1; +} |