This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] More wrappers in varobj
- To: Keith Seitz <keiths at cygnus dot com>
- Subject: Re: [RFA] More wrappers in varobj
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Mon, 15 Oct 2001 18:41:50 -0400
- Cc: gdb-patches at sources dot redhat dot com
- References: <Pine.GSO.4.33.0110151334560.11434-100000@makita.cygnus.com>
> 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.
>
>
> Am I to presume that we are deprecating wrapper.[ch] in favor of this new
> mechanism? If so, I could just work to get rid of wrapper.[ch]
> altogether...
>
> Just say the word.
> Keith
Should the code live in wrapper.[hc]? It can for now.
While it is a hack (the code it calls should always unwind the stack
cleanly) it, or something like it, is going to remain around for a long
time. It is also an internal interface (varobj | core-gdb) rather than
a libgdb interface.
Regarding the problems, the worst is the cast in:
catch_errors ((catch_errors_ftype*)wrap_function, ...)
with
wrap_function (char *a)
it isn't valid C - you can't assume that a ()(void*) function is called
the same way as a ()(char*) function.
The other two are not so much of a concern (although I must admit a
desire to avoid the unions and use structs so that the compiler can be
used to check that parameter passing). catch_exceptions() makes it
possible for the wrapped functions to return well defined values -
something not possible with catch_errors().
Andrew