[LLVMdev] Load and store debug information

Eric Christopher echristo at apple.com
Tue Aug 14 14:13:27 PDT 2012


On Aug 12, 2012, at 6:27 AM, Alberto Magni <alberto.magni86 at gmail.com> wrote:

> Hi all,
> 
> I am currently looking for more accurate debug information.
> In particular I am interested into relating load and store IR
> instructions to the corresponding array subscript.
> Current debug information associate each instruction to the source
> code line they come from.
> I would like to extend this, for loads and stores only, to make
> metadata point to the
> source location where the array subscript is.
> 
> Is this something reasonable to ask for ?
> Is there any "easy" way to achieve this ?
> 

You could make the SrcLoc for the instruction match the array subscript instead
of the current location when generating debug information for that particular
expression, or perhaps add a SrcLoc for the GEP that's used to calculate the
offset. Just some ideas off the top of my head.

> One more thing.
> Reading the documentation about source level debugging [1] I have noticed that
> the IR snippet presented in "Object lifetimes and scoping" is not equivalent to
> the corresponding piece of C code.

Heh. Thanks.

-eric



More information about the llvm-dev mailing list