Page MenuHomePhabricator

DWARFExpression: Fix implementation of DW_OP_pick

Authored by labath on Apr 26 2019, 4:17 AM.



The DWARF spec states that the DWARF stack arguments are numbered from
the top. Our implementation of DW_OP_pick was counting them from the

This bug probably wasn't noticed because nobody (except my upcoming
postfix-to-DWARF converter) uses DW_OP_pick, but I've cross-checked with
gdb to confirm that counting from the top is the expected behavior.

This patch fixes the implementation to match the spec and gdb behavior
and adds a test.

Diff Detail


Event Timeline

labath created this revision.Apr 26 2019, 4:17 AM
clayborg accepted this revision.Apr 26 2019, 10:41 AM
This revision is now accepted and ready to land.Apr 26 2019, 10:41 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 29 2019, 3:53 AM
Herald added a subscriber: abidh. · View Herald Transcript