Index: source/Expression/DWARFExpression.cpp =================================================================== --- source/Expression/DWARFExpression.cpp +++ source/Expression/DWARFExpression.cpp @@ -2960,9 +2960,17 @@ if (stack.empty()) { // Nothing on the stack, check if we created a piece value from DW_OP_piece or DW_OP_bit_piece opcodes - if (pieces.GetBuffer().GetByteSize()) + lldb::offset_t byte_size = pieces.GetBuffer().GetByteSize(); + if (byte_size) { - result = pieces; + if (byte_size == sizeof(unsigned int)) + result = Scalar(*((unsigned int *) pieces.GetBuffer().GetBytes())); + else if (byte_size == sizeof(unsigned long)) + result = Scalar(*((unsigned long *) pieces.GetBuffer().GetBytes())); + else if (byte_size == sizeof(unsigned long long)) + result = Scalar(*((unsigned long *) pieces.GetBuffer().GetBytes())); + else + error_ptr->SetErrorString ("DWARF pieces could not be converted to a scalar."); } else { Index: test/lang/c/register_variables/TestRegisterVariables.py =================================================================== --- test/lang/c/register_variables/TestRegisterVariables.py +++ test/lang/c/register_variables/TestRegisterVariables.py @@ -17,7 +17,6 @@ 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):