diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp index a9d365325d9e2..48022996e0e39 100644 --- a/lldb/source/Expression/DWARFExpression.cpp +++ b/lldb/source/Expression/DWARFExpression.cpp @@ -2331,6 +2331,10 @@ bool DWARFExpression::Evaluate( // not available. Fill with zeros for now by resizing the data and // appending it curr_piece.ResizeData(piece_byte_size); + // Note that "0" is not a correct value for the unknown bits. + // It would be better to also return a mask of valid bits together + // with the expression result, so the debugger can print missing + // members as "" or something. ::memset(curr_piece.GetBuffer().GetBytes(), 0, piece_byte_size); pieces.AppendDataToHostBuffer(curr_piece); } else { @@ -2445,8 +2449,8 @@ bool DWARFExpression::Evaluate( return false; } } - op_piece_offset += piece_byte_size; } + op_piece_offset += piece_byte_size; } } break;