[PATCH] D67717: [DebugInfo] Exclude memory location values as parameter entry values

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 11:16:39 PDT 2019


vsk added a subscriber: friss.
vsk added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfExpression.cpp:418
+      assert(!isParameterValue() && "Parameter entry values should not be "
+                                    "dereferenced due to safety reasons.");
       if (!isMemoryLocation() && ::isMemoryLocation(ExprCursor))
----------------
I think this makes sense as an interim solution, but I'm concerned that this will be too restrictive in the long run. For example, I think this rules out accessing spilled values when stopped in the callee. What does gcc do?

What I had in mind was an escape analysis for the MachineMemOperand. As I understand it, the mem operand can either be backed by an llvm::Value or a PseudoSourceValue. Perhaps the analysis could visit the uses of these values to check for stores of pointers which may-alias it, or calls. I know the analysis isn't sound, because the callee can technically reconstruct+clobber the pointer bit-by-bit in a way that's invisible to the analysis. However, that strikes me as something only an attacker would do, so perhaps it's not a concern. Wdyt? (Paging @aprantl @djtodoro @friss as well.)


================
Comment at: test/DebugInfo/MIR/X86/dbgcall-site-interpretation.mir:26
+# CHECK-NOT:       DW_AT_location      (DW_OP_reg2 RCX)
 # CHECK-NEXT:       DW_AT_location      (DW_OP_reg4 RSI)
 # CHECK-NEXT:       DW_AT_GNU_call_site_value   (DW_OP_lit4)
----------------
The CHECK-NEXT implies the previous CHECK-NOT, I believe? The comment is still helpful.


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

https://reviews.llvm.org/D67717





More information about the llvm-commits mailing list