Page MenuHomePhabricator

Remove an invalid check in DW_OP_piece processing.

Authored by abidh on Sep 7 2015, 6:07 AM.



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.

Diff Detail


Event Timeline

abidh updated this revision to Diff 34154.Sep 7 2015, 6:07 AM
abidh retitled this revision from to Remove an invalid check in DW_OP_piece processing..
abidh updated this object.
abidh added reviewers: aprantl, clayborg.
abidh added a subscriber: lldb-commits.
clayborg accepted this revision.Sep 8 2015, 8:54 AM
clayborg edited edge metadata.
This revision is now accepted and ready to land.Sep 8 2015, 8:54 AM
aprantl accepted this revision.Sep 8 2015, 9:02 AM
aprantl edited edge metadata.

Thanks, yes, this check looks like it serves no purpose.

This revision was automatically updated to reflect the committed changes.