This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH PR c++/17132] Add new argument NOSIDE to find_overload_match
- From: Siva Chandra <sivachandra at google dot com>
- To: gdb-patches <gdb-patches at sourceware dot org>
- Date: Fri, 1 Aug 2014 07:38:36 -0700
- Subject: Re: [PATCH PR c++/17132] Add new argument NOSIDE to find_overload_match
- Authentication-results: sourceware.org; auth=none
- References: <CAGyQ6gwjpbYWoT7xki0tNQF7vq9mA_d+zMrnCDxXGUbU6gn1=A at mail dot gmail dot com> <CAGyQ6gwKSgvFxb_DF44Fj3cphKunbNxFuQF5pdRiSMSMw4CcVQ at mail dot gmail dot com>
Ping.
On Wed, Jul 16, 2014 at 6:34 AM, Siva Chandra <sivachandra@google.com> wrote:
> Ping.
>
> On Wed, Jul 9, 2014 at 11:52 AM, Siva Chandra <sivachandra@google.com> wrote:
>> The bug with examples where it manifests is detailed on the bug page.
>> To summarize here:
>>
>> When expressions involving calls to virtual methods are evaluated
>> under EVAL_AVOID_SIDE_EFFECTS, the intermediate objects could be
>> zeroed values. In which case, when find_overload_match tries to
>> (indirectly) lookup the method for the most derived type of the object
>> via its vptr, GDB trips with "Cannot access memory at address 0x0."
>> This patch adds an additional argument NOSIDE to find_overload_match
>> which serves as a flag to indicate whether method resolution should be
>> performed by looking up the most derived object via the vptr. When
>> NOSIDE is EVAL_AVOID_SIDE_EFFECTS, the method for the compile time
>> type (instead of the most derived type) of the object is returned by
>> find_overload_match. This will not affect the functionality as all
>> that is important when evaluating under EVAL_AVOID_SIDE_EFFECTS is the
>> return type of the method.
>>
>> Regression tested testsuite/gdb.cp. But, am I simplifying the problem somewhere?
>>
>> ChangeLog
>> 2014-07-09 Siva Chandra Reddy <sivachandra@google.com>
>>
>> gdb/
>>
>> * eval.c: Update all calls to find_overload_match.
>> * valarith.c: Update calls to find_overload_match.
>> (value_user_defined_cpp_op, value_user_defined_op): New
>> argument NOSIDE. Update all callers.
>> * valops.c (find_overload_match): New argument NOSIDE.
>> * value.h (find_overload_match): Update signature.
>>
>> gdb/testsuite
>>
>> * gdb.cp/pr17132.cc: New file.
>> * gdb.cp/pr17132.exp: New file.