[PATCH] Reject ambiguous C++ field accesses

Gary Benson gbenson@redhat.com
Fri Aug 28 14:35:56 GMT 2020


Luis Machado wrote:
> On 8/27/20 3:02 PM, Pedro Alves wrote:
> > diff --git a/gdb/valops.c b/gdb/valops.c
> > index 0eb2b096211..0e030a03ecd 100644
> > --- a/gdb/valops.c
> > +++ b/gdb/valops.c
> > @@ -1766,25 +1766,105 @@ typecmp (int staticp, int varargs, int nargs,
> >     return i + 1;
> >   }
> > -/* Helper class for do_search_struct_field that updates *RESULT_PTR
> > -   and *LAST_BOFFSET, and possibly throws an exception if the field
> > -   search has yielded ambiguous results.  */
> > +/* Helper class for search_struct_field that keeps track of found
> > +   results.  See search_struct_field for description of
> > +   LOOKING_FOR_BASECLASS.  If LOOKING_FOR_BASECLASS is true, possibly
> > +   throws an exception if the base class search has yielded ambiguous
> 
> "throw" an exception instead?

I think remove "possibly" and "has" also.

"If LOOKING_FOR_BASECLASS is true, throw an exception if the base
class search yielded ambiguous results."

Thanks,
Gary



More information about the Gdb-patches mailing list