From ddc5429238ae0aded9207981b02d65c6e954f2fa Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Wed, 31 Oct 2001 03:16:04 +0000 Subject: [PATCH] * wrapper.h (gdb_value_struct_elt): New function. * wrapper.c (gdb_value_struct_elt): Ditto. (do_captured_value_struct_elt): Ditto. --- gdb/ChangeLog | 6 ++++++ gdb/wrapper.c | 38 ++++++++++++++++++++++++++++++++++++++ gdb/wrapper.h | 5 +++++ 3 files changed, 49 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d22084be080..93632ffd8ab 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2001-10-30 Keith Seitz + + * wrapper.h (gdb_value_struct_elt): New function. + * wrapper.c (gdb_value_struct_elt): Ditto. + (do_captured_value_struct_elt): Ditto. + 2001-10-30 Andrew Cagney * README, NEWS: Update for 5.1. diff --git a/gdb/wrapper.c b/gdb/wrapper.c index e99378fbdba..6c9c6d60cef 100644 --- a/gdb/wrapper.c +++ b/gdb/wrapper.c @@ -41,6 +41,16 @@ struct gdb_wrapper_arguments } args[10]; }; +struct captured_value_struct_elt_args +{ + struct value **argp; + struct value **args; + char *name; + int *static_memfuncp; + char *err; + struct value **result_ptr; +}; + static int wrap_parse_exp_1 (char *); static int wrap_evaluate_expression (char *); @@ -55,6 +65,8 @@ static int wrap_value_subscript (char *); static int wrap_value_ind (char *opaque_arg); +static int do_captured_value_struct_elt (struct ui_out *uiout, void *data); + static int wrap_parse_and_eval_type (char *); int @@ -293,3 +305,29 @@ wrap_parse_and_eval_type (char *a) return 1; } + +enum gdb_rc +gdb_value_struct_elt (struct ui_out *uiout, struct value **result, struct value **argp, + struct value **args, char *name, int *static_memfuncp, + char *err) +{ + struct captured_value_struct_elt_args cargs; + cargs.argp = argp; + cargs.args = args; + cargs.name = name; + cargs.static_memfuncp = static_memfuncp; + cargs.err = err; + cargs.result_ptr = result; + return catch_exceptions (uiout, do_captured_value_struct_elt, &cargs, + NULL, RETURN_MASK_ALL); +} + +static int +do_captured_value_struct_elt (struct ui_out *uiout, void *data) +{ + struct captured_value_struct_elt_args *cargs = data; + *cargs->result_ptr = value_struct_elt (cargs->argp, cargs->args, cargs->name, + cargs->static_memfuncp, cargs->err); + return GDB_RC_OK; +} + diff --git a/gdb/wrapper.h b/gdb/wrapper.h index bfe11001ffa..977a77d04cd 100644 --- a/gdb/wrapper.h +++ b/gdb/wrapper.h @@ -18,6 +18,7 @@ #ifndef WRAPPER_H #define WRAPPER_H 1 +#include "gdb.h" struct value; @@ -37,6 +38,10 @@ extern int gdb_value_assign (struct value *, struct value *, struct value **); extern int gdb_value_subscript (struct value *, struct value *, struct value **); +extern enum gdb_rc gdb_value_struct_elt (struct ui_out *uiout, struct value **result_ptr, + struct value **argp, struct value **args, + char *name, int *static_memfuncp, char *err); + extern int gdb_value_ind (struct value *val, struct value ** rval); extern int gdb_parse_and_eval_type (char *, int, struct type **); -- 2.30.2