This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: [PATCH] Fix watching structs in C++


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


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