Page MenuHomePhabricator

[DwarfDebug] Dump call site debug info into DWARF
Needs ReviewPublic

Authored by djtodoro on Mon, Feb 11, 4:01 AM.

Details

Summary

Dump DWARF information about call sites and call site parameters into debug info sections.

Also. add handling of DW_OP_entry_value emitting.

For now, we use GNU extensions, since LLVM has portion of dumping call site information for tail calls (with DWARF 5 support). It can stay this way until we test, merge and patch every peace of the feature.

Authors: @asowda, @NikolaPrica, @djtodoro, @ivanbaev

Diff Detail

Event Timeline

djtodoro created this revision.Mon, Feb 11, 4:01 AM
djtodoro edited the summary of this revision. (Show Details)
djtodoro added a subscriber: NikolaPrica.
djtodoro added a project: debug-info.
djtodoro added a subscriber: petarj.
djtodoro updated this revision to Diff 186453.Tue, Feb 12, 6:42 AM

If we wanted to support the DWARF 5 variants are there any semantic differences, or do we just need to rename the attributes?

If we wanted to support the DWARF 5 variants are there any semantic differences, or do we just need to rename the attributes?

@aprantl Yes, it will take only DWARF symbols (tag, attributes, operand) renaming.

djtodoro updated this revision to Diff 186614.Wed, Feb 13, 2:49 AM
  • Rename: VariableNotChanged ===> ArgumentNotModified
  • Refactor test cases
dstenb added a subscriber: dstenb.Wed, Feb 13, 8:27 AM
dstenb added inline comments.
lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
39

Although it is a short function which is easy to skim through, I think it would be helpful to somehow signal that it only applies for non-entry values, e.g. through amending the comment or changing the name (although I don't have any suggestions for the latter).

Alternatively, maybe the function can be left as it was before this patch, and instead the calls to {add,drop}RegDescribedVar can be wrapped with that conditional?

69

Since isDescribedByReg has been changed to ignore entry values, the InlinedEntity will not be added to RegVars, so unless I have overlooked something I don't think we should get here with an entry value. Maybe this should be an assertion?

djtodoro marked 2 inline comments as done.Thu, Feb 14, 3:40 AM
djtodoro added inline comments.
lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
39

Thanks! Definitely we should change something here.

69

Oh, this is dead code for sure. We didn't have this in initial patch. We'll remove this. Thanks!

djtodoro updated this revision to Diff 187191.Sun, Feb 17, 10:44 PM
  • Change a comment for isDescribedByReg()
  • Remove a dead code