This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Fix calling of static C++ member functions
On Sun, May 12, 2002 at 09:48:56PM +0200, Peter.Schauer wrote:
> > I had to make some substantial changes to this. First of all, I wanted
> > to kill the now-obsolete static_memfuncp argument to find_method_list.
> > Secondly, the way you were skipping THIS in typecmp caused segfaults
> > for some methods which only expected one argument. Here's what I
> > checked in.
> >
> > I -think- I'm caught up on all the patches you sent me now, Peter.
>
> Yes you are, thank you very much.
>
> Thanks also for fixing the segfaults, but I'd be interested in an example
> where this happened. I tried to simplify the typcmp logic as much as possible,
> but obviously failed.
You incremented t1 after the check for whether the next type was VOID.
If it was, the following type could be a garbage pointer. I got
segfaults in userdef.exp, I believe.
>
> One minor nit, the comments should reflect the elimination of static_memfuncp:
>
> --- ./valops.c.orig Sun May 12 17:16:37 2002
> +++ ./valops.c Sun May 12 17:55:37 2002
> @@ -2515,7 +2516,6 @@ value_struct_elt (struct value **argp, s
> * ARGP is a pointer to a pointer to a value (the object)
> * METHOD is a string containing the method name
> * OFFSET is the offset within the value
> - * STATIC_MEMFUNCP is set if the method is static
> * TYPE is the assumed type of the object
> * NUM_FNS is the number of overloaded instances
> * BASETYPE is set to the actual type of the subobject where the method is found
> @@ -2606,7 +2606,6 @@ find_method_list (struct value **argp, c
> * ARGP is a pointer to a pointer to a value (the object)
> * METHOD is the method name
> * OFFSET is the offset within the value contents
> - * STATIC_MEMFUNCP is set if the method is static
> * NUM_FNS is the number of overloaded instances
> * BASETYPE is set to the type of the base subobject that defines the method
> * BOFFSET is the offset of the base subobject which defines the method */
>
> Thanks again,
Quite right. Would you please commit that update?
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer