This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix watching structs in C++
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 05 Mar 2018 18:32:32 +0100
- Subject: Re: [PATCH] Fix watching structs in C++
- Authentication-results: sourceware.org; auth=none
- References: <m34lm2paqs.fsf@oc1027705133.ibm.com> <86k1uq3aar.fsf@gmail.com>
On Mon, Mar 05 2018, Yao Qi wrote:
> Andreas Arnez <arnez@linux.vnet.ibm.com> writes:
>
> Hi Andreas,
>
>> Some of the watchpoint logic depends on the fact that the head of the
>> value chain represents the user-specified value to watch. Thus no
>> additional values should be added to the value chain after that. However,
>> this may happen in gnuv3_rrti_type, where value_addr is invoked. If no
>> RTTI is found, then the pointer value built by value_addr, rather than the
>> original value, stays in front of the value chain.
>
> I sort of understand the value chain in watchpoint expressions, but it
> is still a big gap from watchpoint value chain to the function you
> changed in the patch.
>
> Could you please add more information in commit log? especially about
> how value chain is related to gnuv3_rrti_type.
OK, how about this? --
... However, if a watchpoint is defined for a C++ structure/class
object, then run-time type information (RTTI) may be present. Thus,
while constructing the value chain for the watchpoint, the dynamic type
is fetched by gnuv3_rrti_type, which invokes value_addr, which then adds
a new value to the head of the value chain. This new value represents
the pointer to the structure instead of the structure itself.
--
Andreas