summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-07-31 23:39:10 +0000
committerGreg Clayton <gclayton@apple.com>2012-07-31 23:39:10 +0000
commit1811b4faad9fd1496bde1d09bd336f9d9902dd78 (patch)
treea706d8b48c714fe427e6fb1320064796a73c3afc /lldb/source/Plugins
parentd1c43cee245b56f34849821228e12b9437d97329 (diff)
downloadbcm5719-llvm-1811b4faad9fd1496bde1d09bd336f9d9902dd78.tar.gz
bcm5719-llvm-1811b4faad9fd1496bde1d09bd336f9d9902dd78.zip
<rdar://problem/11275622>
Added new API to lldb::SBTypeMember for bitfields: bool SBTypeMember::IsBitfield(); uint32_t SBTypeMember::GetBitfieldSizeInBits(); Also added new properties for easy access. Now SBTypeMember objects in python have a "fields" property for all type fields, "bases" for all direct bases, "vbases" for all virtual base classes and "members" for a combo of all three organized by bit offset. They all return a python list() of SBTypeMember objects. Usage: (lldb) script >>> t = lldb.target.FindFirstType("my_type") >>> for field in t.fields: ... print field >>> for vbase in t.vbases: ... print vbase >>> for base in t.bases: ... print base >>> for member in t.members: ... print member Also added new "is_bitfield" property to the SBTypeMember objects that will return the result of SBTypeMember::IsBitfield(), and "bitfield_bit_size" which will return the result of SBTypeMember::GetBitfieldSizeInBits(); I also fixed "SBTypeMember::GetOffsetInBytes()" to return the correct byte offset. llvm-svn: 161091
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r--lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
index 7b5631c1bca..677a4afede0 100644
--- a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
+++ b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
@@ -753,12 +753,12 @@ ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &ast_type
for (uint32_t idx = 0; idx < num_children; idx++)
{
std::string name;
- uint32_t field_bit_offset;
+ uint64_t field_bit_offset = 0;
bool is_signed;
bool is_complex;
uint32_t count;
- clang_type_t field_clang_type = ClangASTContext::GetFieldAtIndex (ast_context, ret_value_type, idx, name, &field_bit_offset);
+ clang_type_t field_clang_type = ClangASTContext::GetFieldAtIndex (ast_context, ret_value_type, idx, name, &field_bit_offset, NULL, NULL);
size_t field_bit_width = ClangASTType::GetClangTypeBitWidth(ast_context, field_clang_type);
// If there are any unaligned fields, this is stored in memory.
@@ -840,12 +840,14 @@ ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &ast_type
in_gpr = false;
else
{
- uint32_t next_field_bit_offset;
- clang_type_t next_field_clang_type = ClangASTContext::GetFieldAtIndex (ast_context,
+ uint64_t next_field_bit_offset = 0;
+ clang_type_t next_field_clang_type = ClangASTContext::GetFieldAtIndex (ast_context,
ret_value_type,
idx + 1,
name,
- &next_field_bit_offset);
+ &next_field_bit_offset,
+ NULL,
+ NULL);
if (ClangASTContext::IsIntegerType (next_field_clang_type, is_signed))
in_gpr = true;
else
@@ -864,12 +866,14 @@ ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &ast_type
in_gpr = false;
else
{
- uint32_t prev_field_bit_offset;
+ uint64_t prev_field_bit_offset = 0;
clang_type_t prev_field_clang_type = ClangASTContext::GetFieldAtIndex (ast_context,
ret_value_type,
idx - 1,
name,
- &prev_field_bit_offset);
+ &prev_field_bit_offset,
+ NULL,
+ NULL);
if (ClangASTContext::IsIntegerType (prev_field_clang_type, is_signed))
in_gpr = true;
else
OpenPOWER on IntegriCloud