[LLVMdev] Replacement for findStopPoint() in LLVM 2.7

Jeffrey Yasskin jyasskin at google.com
Tue Mar 16 11:11:04 PDT 2010


On Tue, Mar 16, 2010 at 10:02 AM, Török Edwin <edwintorok at gmail.com> wrote:
> On 03/16/2010 06:52 PM, John Criswell wrote:
>> Török Edwin wrote:
>>> [snip]
>>>
>>> Ah, the method got moved to the instruction itself!
>>>
>>> dbgKind = Context->getMDKindID("dbg");
>>> if (MDNode *Dbg = I->getMetadata(dbgKind)) {
>>> ...
>>>
>>
>> Thanks!  This appears to work.
>
> Ok.
>
>>
>> I also have code that looks up debug information for GlobalVariables and
>> regular LLVM Value *'s.  For the former, I think I can look up their
>> debug information by using the DebugInfoFinder class and iterating
>> through all the MDNodes for global variables (using the
>> global_variable_begin()/global_variable_end() methods).  Is this the
>> best way to do it, or is there a better way?
>>
>> For LLVM Value *s, I'm not sure how to get the debug information if they
>> come from alloca instructions.  Is the best option to look for a use of
>> the Value in a llvm.dbg.declare() call and then grab the debug metadata
>> from that?
>
> I wasn't following the dbg.declare changes, but I think there is a
> llvm.dbg.value now that survives mem2reg (or rather it is dbg.declare
> initially and becomes dbg.value later).

This should all be described at
http://llvm.org/docs/SourceLevelDebugging.html. If something's missing
there, please ask Devang to add it.

Devang, I don't think there's any documentation about how to _read_
debug info (for example, pointing to Instruction::getMetadata() and
include/llvm/Analysis/DebugInfo.h). Could you add some?

Thanks,
Jeffrey




More information about the llvm-dev mailing list