[PATCH] D69886: [DebugInfo] Support for DW_OP_implicit_pointer (Post IR transformation phase)

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 16:52:22 PST 2019


probinson added a comment.

In D69886#1736266 <https://reviews.llvm.org/D69886#1736266>, @dblaikie wrote:

> I'd expect more than 3 patches and in this order:


+1.

> @probinson @aprantl - do you folks know why implicit_pointer needs to point to another DIE, rather than describing bytes directly? I guess it's intended to handle void*, for instance? (where the type information for the pointee isn't present in the pointer type) But for something like int* if the int isn't in memory (so can't be pointed to) - say, it's in a register, I'd expect to describe the value of the int without any extra DIE references, etc? (who knows if the DIE is in a variable/described by any other DIE). I'm pretty confused by the way this DWARF feature is spec'd & wondering if we should avoid implementing it/instead implement a better extension? But quite possible there's things about the design that I don't understand.

I think the main use-case was for when a pointed-to object is optimized into registers (which don't have addresses), but the pointed-to values are easily found.  For example if you have a function that takes a pointer-to-object, and is then inlined, and the optimizer decides it doesn't need the object to be in memory after all.  If values from the "pointed-to" object are still findable, you probably know what object that was originally, and so implicit_pointer can refer to that object's DIE.  Among other things, this indirection has an advantage if the "pointed-to" object moves around; the pointed-to object's locations are tracked in the pointed-to object's DIE, and the pointer DIE just says "ask that DIE where it is right now."

It might possibly be helpful to read the proposal (http://dwarfstd.org/ShowIssue.php?issue=100831.1) where the first example is a bit more compelling than the examples that made it into the spec, unfortunately.

Note that I have not read this patch, or the others.


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

https://reviews.llvm.org/D69886





More information about the llvm-commits mailing list