Fix GetAddressOf for children of pointer ValueObjectConstResult* variables.
authorJim Ingham <jingham@apple.com>
Thu, 8 Dec 2022 19:00:08 +0000 (11:00 -0800)
committerJim Ingham <jingham@apple.com>
Fri, 9 Dec 2022 19:16:10 +0000 (11:16 -0800)
commit3b7ac5b295df7381cee277342085f52fe468e633
treec7f9fb5f1163bc433ecd86f03c444b6965fae1b9
parentf472da190b65a1db2512960ee5334889a6663aef
Fix GetAddressOf for children of pointer ValueObjectConstResult* variables.

The original code always set the m_live_address of children of the ValueObjects that
use ValueObjectConstResultImpl backends to the parent m_live_address + child_byte_offset.
That is correct for structure types, but wrong for pointer types, since m_live_address
for a pointer type is the address of the storage for the pointer, not of the pointee.

Also added a test which was failing before this patch.
lldb/source/Core/ValueObjectConstResultImpl.cpp
lldb/test/API/lang/c/parray_vrs_char_array/Makefile [new file with mode: 0644]
lldb/test/API/lang/c/parray_vrs_char_array/TestParrayVrsCharArrayChild.py [new file with mode: 0644]
lldb/test/API/lang/c/parray_vrs_char_array/main.c [new file with mode: 0644]