[PATCH] D79306: llvm rejects DWARF operator DW_OP_push_object_address.

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 02:38:00 PDT 2020


djtodoro added a comment.

In D79306#2017173 <https://reviews.llvm.org/D79306#2017173>, @alok wrote:

> In D79306#2017039 <https://reviews.llvm.org/D79306#2017039>, @djtodoro wrote:
>
> > I don't see you are touching the `DIExpression::ExprOperand::getSize()`.
> >
> > Can we verify the operation within `DWARFVerifier` ?
>
>
> Thanks for your review. `DIExpression::ExprOperand::getSize()` does special handling for operators with size >1, default case is 1. Since DW_OP_push_object_address doesnt have argument, its size is 1. it need not special mention.
>
>   switch (Op) {
>   case dwarf::DW_OP_LLVM_convert:
>   case dwarf::DW_OP_LLVM_fragment:
>   case dwarf::DW_OP_bregx:
>     return 3;
>   case dwarf::DW_OP_constu:
>   case dwarf::DW_OP_consts:
>   case dwarf::DW_OP_deref_size:
>   case dwarf::DW_OP_plus_uconst:
>   case dwarf::DW_OP_LLVM_tag_offset:
>   case dwarf::DW_OP_LLVM_entry_value:
>   case dwarf::DW_OP_regx:
>     return 2;
>   default:
>     return 1;
>   }
>   


OK, good, thanks!
I think you can add a testcase with an invalid use of  `push_object_address` operation (such as `!DIExpression(DW_OP_push_object_address, DW_OP_something)`).

> I did not have any special verification for this (may be like other single sized operators), Please do let me know if have any verification in mind.



================
Comment at: llvm/test/DebugInfo/dwarfdump-pushobjectaddress.ll:1
+; This test checks whether DWARF operator DW_OP_push_object_address
+; is accepted and processed.
----------------
The recommendation is (I've learned this recently) using double `;` for high-level comments.


================
Comment at: llvm/test/DebugInfo/dwarfdump-pushobjectaddress.ll:7
+
+; Test whether DW_OP_push_object_address is accepted.
+
----------------
Likewise.


================
Comment at: llvm/test/DebugInfo/dwarfdump-pushobjectaddress.ll:13
+
+; Below is the original test case this IR is generated from
+;---------------------------
----------------
Likewise.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79306





More information about the llvm-commits mailing list