diff options
author | Greg Clayton <gclayton@apple.com> | 2010-10-14 22:52:14 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-10-14 22:52:14 +0000 |
commit | 8f92f0a35cba08ca0b4ff83b062494bc9d81ebe0 (patch) | |
tree | 2eadcc035d4e643d3ede63794a1b6a85a60ccf95 /lldb/test/bitfields/TestBitfields.py | |
parent | 10169b94cfe6838f881339f1944891f6d8451174 (diff) | |
download | bcm5719-llvm-8f92f0a35cba08ca0b4ff83b062494bc9d81ebe0.tar.gz bcm5719-llvm-8f92f0a35cba08ca0b4ff83b062494bc9d81ebe0.zip |
Fixed an expression parsing issue where if you were stopped somewhere without
debug information and you evaluated an expression, a crash would occur as a
result of an unchecked pointer.
Added the ability to get the expression path for a ValueObject. For a rectangle
point child "x" the expression path would be something like: "rect.top_left.x".
This will allow GUI and command lines to get ahold of the expression path for
a value object without having to explicitly know about the hierarchy. This
means the ValueObject base class now has a "ValueObject *m_parent;" member.
All ValueObject subclasses now correctly track their lineage and are able
to provide value expression paths as well.
Added a new "--flat" option to the "frame variable" to allow for flat variable
output. An example of the current and new outputs:
(lldb) frame variable
argc = 1
argv = 0x00007fff5fbffe80
pt = {
x = 2
y = 3
}
rect = {
bottom_left = {
x = 1
y = 2
}
top_right = {
x = 3
y = 4
}
}
(lldb) frame variable --flat
argc = 1
argv = 0x00007fff5fbffe80
pt.x = 2
pt.y = 3
rect.bottom_left.x = 1
rect.bottom_left.y = 2
rect.top_right.x = 3
rect.top_right.y = 4
As you can see when there is a lot of hierarchy it can help flatten things out.
Also if you want to use a member in an expression, you can copy the text from
the "--flat" output and not have to piece it together manually. This can help
when you want to use parts of the STL in expressions:
(lldb) frame variable --flat
argc = 1
argv = 0x00007fff5fbffea8
hello_world._M_dataplus._M_p = 0x0000000000000000
(lldb) expr hello_world._M_dataplus._M_p[0] == '\0'
llvm-svn: 116532
Diffstat (limited to 'lldb/test/bitfields/TestBitfields.py')
-rw-r--r-- | lldb/test/bitfields/TestBitfields.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lldb/test/bitfields/TestBitfields.py b/lldb/test/bitfields/TestBitfields.py index 6d169d3551c..0c7a4fe2b5d 100644 --- a/lldb/test/bitfields/TestBitfields.py +++ b/lldb/test/bitfields/TestBitfields.py @@ -61,25 +61,25 @@ class BitfieldsTestCase(TestBase): # This should display correctly. self.expect("frame variable -t bits", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['(uint32_t:1) b1 = 1,', - '(uint32_t:2) b2 = 3,', - '(uint32_t:3) b3 = 7,', - '(uint32_t:4) b4 = 15,', - '(uint32_t:5) b5 = 31,', - '(uint32_t:6) b6 = 63,', - '(uint32_t:7) b7 = 127,', + substrs = ['(uint32_t:1) b1 = 1', + '(uint32_t:2) b2 = 3', + '(uint32_t:3) b3 = 7', + '(uint32_t:4) b4 = 15', + '(uint32_t:5) b5 = 31', + '(uint32_t:6) b6 = 63', + '(uint32_t:7) b7 = 127', '(uint32_t:4) four = 15']) # And so should this. # rdar://problem/8348251 self.expect("frame variable -t", VARIABLES_DISPLAYED_CORRECTLY, - substrs = ['(uint32_t:1) b1 = 1,', - '(uint32_t:2) b2 = 3,', - '(uint32_t:3) b3 = 7,', - '(uint32_t:4) b4 = 15,', - '(uint32_t:5) b5 = 31,', - '(uint32_t:6) b6 = 63,', - '(uint32_t:7) b7 = 127,', + substrs = ['(uint32_t:1) b1 = 1', + '(uint32_t:2) b2 = 3', + '(uint32_t:3) b3 = 7', + '(uint32_t:4) b4 = 15', + '(uint32_t:5) b5 = 31', + '(uint32_t:6) b6 = 63', + '(uint32_t:7) b7 = 127', '(uint32_t:4) four = 15']) def bitfields_variable_python(self): |