This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Support for DWARF operator DW_OP_over
ClosedPublic

Authored by alok on Oct 11 2020, 10:19 AM.

Details

Summary

llvm rejects DWARF operator DW_OP_over.This DWARF
operator is needed for Flang to support assumed rank array.
Debugger in such cases calculates Array bounds using
DW_AT_rank and DW_TAG_generic_subrange.
for (i=0;i<rank;i++) {
lBound of i'th dim =>
Debugger keeps hidden operator DW_OP_lit"i" before lBound expression
and this operator is used by the expression having DW_OP_over.
}

Summary:

Currently llvm rejects DWARF operator DW_OP_over.
below error is produced when llvm finds this operator.

[..]
invalid expression
!DIExpression(151, 20, 16, 48, 30, 35, 80, 34, 6)
warning: ignoring invalid debug info in over.ll
[..]

There are some parts missing in support of this operator, need to
be completed.

Testing

-added a unit testcase
-check-debuginfo
-check-llvm

Diff Detail

Event Timeline

alok created this revision.Oct 11 2020, 10:19 AM
alok requested review of this revision.Oct 11 2020, 10:19 AM
alok updated this revision to Diff 297499.Oct 11 2020, 11:01 PM

Re-based,

Can you add an assembler roundtrip test to test/Assembler to test the change to lib/IR?
It just can contain a single named node that holds a DIExpression.

alok updated this revision to Diff 297771.Oct 12 2020, 11:34 PM

Updated to re-base and incorporate comment from @aprantl .

alok added a comment.Oct 12 2020, 11:34 PM

Can you add an assembler roundtrip test to test/Assembler to test the change to lib/IR?
It just can contain a single named node that holds a DIExpression.

Thanks for your comment and suggestion. It is included now.

aprantl accepted this revision.Oct 16 2020, 1:36 PM

Thanks!

This revision is now accepted and ready to land.Oct 16 2020, 1:36 PM
This revision was automatically updated to reflect the committed changes.