From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Keith Seitz Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] More wrappers in varobj Date: Mon, 15 Oct 2001 15:42:00 -0000 Message-id: <3BCB662E.7080108@cygnus.com> References: X-SW-Source: 2001-10/msg00225.html > 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