Skip to content

Commit

Permalink
[ValueObject] Do not return address of eValueTypeHostAddress values.
Browse files Browse the repository at this point in the history
Summary:
This fixes TestRegisterVariables for clang and hence it is enabled in this commit.


Test Plan: dotest.py -C clang -p TestRegisterVariables

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9421

llvm-svn: 236447
  • Loading branch information
Siva Chandra committed May 4, 2015
1 parent 4fe30a0 commit a3747a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lldb/source/Core/ValueObject.cpp
Expand Up @@ -1821,13 +1821,14 @@ ValueObject::GetAddressOf (bool scalar_is_load_address, AddressType *address_typ

case Value::eValueTypeLoadAddress:
case Value::eValueTypeFileAddress:
case Value::eValueTypeHostAddress:
{
if(address_type)
*address_type = m_value.GetValueAddressType ();
return m_value.GetScalar().ULongLong(LLDB_INVALID_ADDRESS);
}
break;
case Value::eValueTypeHostAddress:
break;
}
if (address_type)
*address_type = eAddressTypeInvalid;
Expand Down Expand Up @@ -3785,7 +3786,7 @@ ValueObject::AddressOf (Error &error)
const bool scalar_is_load_address = false;
addr_t addr = GetAddressOf (scalar_is_load_address, &address_type);
error.Clear();
if (addr != LLDB_INVALID_ADDRESS)
if (addr != LLDB_INVALID_ADDRESS && address_type != eAddressTypeHost)
{
switch (address_type)
{
Expand All @@ -3799,7 +3800,6 @@ ValueObject::AddressOf (Error &error)

case eAddressTypeFile:
case eAddressTypeLoad:
case eAddressTypeHost:
{
ClangASTType clang_type = GetClangType();
if (clang_type)
Expand All @@ -3816,6 +3816,8 @@ ValueObject::AddressOf (Error &error)
}
}
break;
default:
break;
}
}
else
Expand Down
Expand Up @@ -17,7 +17,6 @@ def test_with_dsym_and_run_command(self):
self.buildDsym()
self.const_variable()

@expectedFailureClang
@dwarf_test
@expectedFailureGcc #xfail to get buildbot green, test failed with gcc4.8.2
def test_with_dwarf_and_run_command(self):
Expand Down

0 comments on commit a3747a9

Please sign in to comment.