* Re: [RFA] Wrappers again.
[not found] <Pine.GSO.4.33.0110252354180.23990-100000@makita.cygnus.com>
@ 2001-10-30 18:10 ` Andrew Cagney
2001-10-30 19:16 ` Keith Seitz
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cagney @ 2001-10-30 18:10 UTC (permalink / raw)
To: Keith Seitz; +Cc: gdb-patches
> Hi,
>
> Resubmitting this for (dis?)aprroval.
>
> Keith
>
> ---------- Forwarded message ----------
> Date: Fri, 19 Oct 2001 11:41:43 -0700 (PDT)
> From: Keith Seitz <keiths@makita.cygnus.com>
> To: gdb-patches@sources.redhat.com
> Subject: Re: [RFA] More wrappers in varobj
>
> Sorry for the delay. I got a little caught up in debugging some
> other stuff...
>
> On Mon, 15 Oct 2001, Andrew Cagney wrote:
>
>
>> have a look at breakpoint.c:gdb_breakpoint for a more robust / current
>> way of implementing these wrappers.
>
>
> Is this better?
Yes, much better - no casts. Thanks for the effort.
> Slightly off-topic: We are going to be calling externally visible
> functions something like "gdb_FOO", right? Example: gdb_breakpoint and
> gdb_breakpoint_query. How are we going to name internal functions? Leading
> "_" or something?
>
> I ask because I don't really want to have this patch introduce
> internal variations of gdb functions into the "libgdb" namespace.
Good question, I don't know. A leading ``_'' isn't valid though.
Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFA] Wrappers again.
2001-10-30 18:10 ` [RFA] Wrappers again Andrew Cagney
@ 2001-10-30 19:16 ` Keith Seitz
0 siblings, 0 replies; 2+ messages in thread
From: Keith Seitz @ 2001-10-30 19:16 UTC (permalink / raw)
To: gdb-patches
On Tue, 30 Oct 2001, Andrew Cagney wrote:
> Keith wrote:
> >
> > Is this better?
>
> Yes, much better - no casts. Thanks for the effort.
Committed.
Thank you for reviewing this code, Andrew.
Keith
For the record:
ChangeLog
2001-10-30 Keith Seitz <keiths@redhat.com>
* wrapper.h (gdb_value_struct_elt): New function.
* wrapper.c (gdb_value_struct_elt): Ditto.
(do_captured_value_struct_elt): Ditto.
Patch
Index: wrapper.c
===================================================================
RCS file: /cvs/src/src/gdb/wrapper.c,v
retrieving revision 1.13
diff -u -p -r1.13 wrapper.c
--- wrapper.c 2001/10/20 22:43:26 1.13
+++ wrapper.c 2001/10/31 03:14:04
@@ -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;
+}
+
Index: wrapper.h
===================================================================
RCS file: /cvs/src/src/gdb/wrapper.h,v
retrieving revision 1.11
diff -u -p -r1.11 wrapper.h
--- wrapper.h 2001/10/20 22:43:26 1.11
+++ wrapper.h 2001/10/31 03:14:04
@@ -18,6 +18,7 @@
#ifndef WRAPPER_H
#define WRAPPER_H 1
+#include "gdb.h"
struct value;
@@ -36,6 +37,10 @@ extern int gdb_value_equal (struct value
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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-10-30 19:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <Pine.GSO.4.33.0110252354180.23990-100000@makita.cygnus.com>
2001-10-30 18:10 ` [RFA] Wrappers again Andrew Cagney
2001-10-30 19:16 ` Keith Seitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox