diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 19dfdee5b2a0..41fc3ea5540d 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -1007,7 +1007,17 @@ ValueObject::GetData (DataExtractor& data) ExecutionContext exe_ctx (GetExecutionContextRef()); Error error = m_value.GetValueAsData(&exe_ctx, GetClangAST(), data, 0, GetModule().get()); if (error.Fail()) - return 0; + { + if (m_data.GetByteSize()) + { + data = m_data; + return data.GetByteSize(); + } + else + { + return 0; + } + } data.SetAddressByteSize(m_data.GetAddressByteSize()); data.SetByteOrder(m_data.GetByteOrder()); return data.GetByteSize(); @@ -3832,6 +3842,13 @@ ValueObject::AddressOf (Error &error) break; } } + else + { + StreamString expr_path_strm; + GetExpressionPath(expr_path_strm, true); + error.SetErrorStringWithFormat("'%s' doesn't have a valid address", expr_path_strm.GetString().c_str()); + } + return m_addr_of_valobj_sp; } diff --git a/lldb/source/Expression/Materializer.cpp b/lldb/source/Expression/Materializer.cpp index 9cbc01c69c84..046b5751384c 100644 --- a/lldb/source/Expression/Materializer.cpp +++ b/lldb/source/Expression/Materializer.cpp @@ -521,7 +521,7 @@ public: } void Dematerialize (lldb::StackFrameSP &frame_sp, IRMemoryMap &map, lldb::addr_t process_address, - lldb::addr_t frame_top, lldb::addr_t frame_bottom, Error &err) + lldb::addr_t frame_top, lldb::addr_t frame_bottom, Error &err) { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));