[Lldb-commits] [lldb] r274703 - "frame variable" and "target variable" shouldn't allow us to get the address of bitfields.
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Wed Jul 6 16:16:25 PDT 2016
Author: gclayton
Date: Wed Jul 6 18:16:24 2016
New Revision: 274703
URL: http://llvm.org/viewvc/llvm-project?rev=274703&view=rev
Log:
"frame variable" and "target variable" shouldn't allow us to get the address of bitfields.
"frame variable" and "target variable" are trying to emulate the expression parser when doing things like:
(lldb) frame variable &my_struct.my_bitfield
And since the expression parser doesn't allow this, we shouldn't allow "frame variable" or "target variable" to succeed.
<rdar://problem/27208607>
Modified:
lldb/trunk/source/Core/ValueObject.cpp
Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=274703&r1=274702&r2=274703&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Wed Jul 6 18:16:24 2016
@@ -834,20 +834,20 @@ ValueObject::CreateChildAtIndex (size_t
ExecutionContext exe_ctx (GetExecutionContextRef());
- child_compiler_type = GetCompilerType().GetChildCompilerTypeAtIndex (&exe_ctx,
- idx,
- transparent_pointers,
- omit_empty_base_classes,
- ignore_array_bounds,
- child_name_str,
- child_byte_size,
- child_byte_offset,
- child_bitfield_bit_size,
- child_bitfield_bit_offset,
- child_is_base_class,
- child_is_deref_of_parent,
- this,
- language_flags);
+ child_compiler_type = GetCompilerType().GetChildCompilerTypeAtIndex(&exe_ctx,
+ idx,
+ transparent_pointers,
+ omit_empty_base_classes,
+ ignore_array_bounds,
+ child_name_str,
+ child_byte_size,
+ child_byte_offset,
+ child_bitfield_bit_size,
+ child_bitfield_bit_offset,
+ child_is_base_class,
+ child_is_deref_of_parent,
+ this,
+ language_flags);
if (child_compiler_type)
{
if (synthetic_index)
@@ -1789,6 +1789,10 @@ ValueObject::DumpPrintableRepresentation
addr_t
ValueObject::GetAddressOf (bool scalar_is_load_address, AddressType *address_type)
{
+ // Can't take address of a bitfield
+ if (IsBitfield())
+ return LLDB_INVALID_ADDRESS;
+
if (!UpdateValueIfNeeded(false))
return LLDB_INVALID_ADDRESS;
More information about the lldb-commits
mailing list