2 Test that parray of a struct with an embedded char array works.
3 This was failing because the "live address" of the child elements
4 was calculated incorrectly - as a offset from the pointer live
5 address. It only happened for char[] children because they used
6 GetAddressOf which relies on the live address.
11 import lldbsuite
.test
.lldbutil
as lldbutil
12 from lldbsuite
.test
.lldbtest
import *
15 class TestParrayVrsCharArrayChild(TestBase
):
16 NO_DEBUG_INFO_TESTCASE
= True
18 def test_parray_struct_with_char_array_child(self
):
19 """This is the basic test for does parray get the char values right."""
21 self
.main_source_file
= lldb
.SBFileSpec("main.c")
24 def do_array_test(self
):
25 (target
, process
, thread
, bkpt
) = lldbutil
.run_to_source_breakpoint(
26 self
, "Set a breakpoint here", self
.main_source_file
29 frame
= thread
.GetFrameAtIndex(0)
32 "expr -Z 3 -- struct_ptr",
34 'before = 112, var = "abcd", after = 221',
35 'before = 313, var = "efgh", after = 414',
36 'before = 515, var = "ijkl", after = 616',