[Lldb-commits] [lldb] r247124 - Remove an invalid check in DW_OP_piece processing.

Hafiz Abid Qadeer via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 9 02:06:05 PDT 2015

Author: abidh
Date: Wed Sep  9 04:06:05 2015
New Revision: 247124

URL: http://llvm.org/viewvc/llvm-project?rev=247124&view=rev
Remove an invalid check in DW_OP_piece processing.

When lldb is processing a location containing DW_OP_piece, the result is being
stored in the 'pieces' variable. The location is popped from the 'stack' variable.
So this check to see that 'stack' is not empty was invalid and caused the pieces
after the first to not get processed.

I am working on an architecture which has 16-bit and 8-bit registers. So this
problem was quite easy to see. But I was able to re-produce this issue on x86
too with long long variable and compiling woth -m32. It resulted in following
location list.
00000014 08048496 080484b5 (DW_OP_reg6 (esi); DW_OP_piece: 4; DW_OP_reg7 (edi); DW_OP_piece: 4)

and lldb was only showing the contents of first register when I evaluated the
variable as it does not process the 2nd piece due to this check.

Reviewers: clayborg, aprantl

Subscribers: lldb-commits

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


Modified: lldb/trunk/source/Expression/DWARFExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DWARFExpression.cpp?rev=247124&r1=247123&r2=247124&view=diff
--- lldb/trunk/source/Expression/DWARFExpression.cpp (original)
+++ lldb/trunk/source/Expression/DWARFExpression.cpp Wed Sep  9 04:06:05 2015
@@ -2770,7 +2770,7 @@ DWARFExpression::Evaluate
                                 return false;
-                        else if (!stack.empty())
+                        else
                             // If this is the second or later piece there should be a value on the stack
                             if (pieces.GetBuffer().GetByteSize() != op_piece_offset)

More information about the lldb-commits mailing list