[PATCH] D56587: Fix sign/zero extension in Dwarf expressions.

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 5 08:27:09 PST 2019


bjope added inline comments.


================
Comment at: lib/Transforms/Utils/Local.cpp:1867
+
+      return DIExpression::appendToStack(DIExpression::appendToStack(DII.getExpression(), dwarf::DW_OP_convert, ToBT), dwarf::DW_OP_convert, FromBT);
     };
----------------
I still have trouble to understand how/if helps the debugger (or llc) to know how many bits to dereference. I assume that llc needs to prepend a DW_OP_deref_type in case of a memory location, or DW_OP_regval_type in case of a register location to get the correct type on the expression stack for the original value. And then we only need one DW_OP_convert to convert to the final type.
In case we think that it is ok to dereference more bits than `ToBits` (i.e. the smaller size), then we need to adjust the address to take care of endianess somewhere.
If we go down this road, then I think we need some hack to get DW_OP_deref_type/DW_OP_regval_type in place first. Or what do you think?



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56587/new/

https://reviews.llvm.org/D56587





More information about the llvm-commits mailing list