This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA] More wrappers in varobj


> 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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]