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'
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116532 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBFrame.cpp b/source/API/SBFrame.cpp
index f4dfb33..9afac97 100644
--- a/source/API/SBFrame.cpp
+++ b/source/API/SBFrame.cpp
@@ -390,7 +390,7 @@
const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx)
{
- value_list.Append(ValueObjectSP (new ValueObjectRegisterSet (reg_ctx, set_idx)));
+ value_list.Append(ValueObjectSP (new ValueObjectRegisterSet (NULL, reg_ctx, set_idx)));
}
}
}
diff --git a/source/API/SBType.cpp b/source/API/SBType.cpp
index 5c3e973..35c280d 100644
--- a/source/API/SBType.cpp
+++ b/source/API/SBType.cpp
@@ -83,6 +83,7 @@
int32_t child_byte_offset = 0;
uint32_t child_bitfield_bit_size = 0;
uint32_t child_bitfield_bit_offset = 0;
+ bool child_is_base_class = false;
if (IsValid ())
{
@@ -97,7 +98,8 @@
child_byte_size,
child_byte_offset,
child_bitfield_bit_size,
- child_bitfield_bit_offset);
+ child_bitfield_bit_offset,
+ child_is_base_class);
}
@@ -110,6 +112,7 @@
member.m_offset = child_byte_offset;
member.m_bit_size = child_bitfield_bit_size;
member.m_bit_offset = child_bitfield_bit_offset;
+ member.m_is_base_class = child_is_base_class;
}
else
{
@@ -192,7 +195,9 @@
m_member_name (NULL),
m_offset (0),
m_bit_size (0),
- m_bit_offset (0)
+ m_bit_offset (0),
+ m_is_base_class (false)
+
{
}
@@ -222,6 +227,7 @@
m_offset = 0;
m_bit_size = 0;
m_bit_offset = 0;
+ m_is_base_class = false;
}
bool
@@ -248,6 +254,12 @@
return m_bit_offset;
}
+bool
+SBTypeMember::IsBaseClass ()
+{
+ return m_is_base_class;
+}
+
size_t
SBTypeMember::GetOffset ()
{