[llvm-dev] source line number for instruction

Ridwan Shariffdeen via llvm-dev llvm-dev at lists.llvm.org
Wed May 16 00:38:39 PDT 2018


Hi David,

Thanks for your email, I was able to get it right after some googling.
Indeed it was as you suggested, we can get the line information with debug
info associated in an instruction

Thanks!

On Wed, May 16, 2018 at 12:14 AM David Blaikie <dblaikie at gmail.com> wrote:

> Not sure what you tried/how it didn't work - could you explain more?
>
> You could scan through all the llvm::Functions in an llvm::Module and look
> at the debug info associated with them (getSubprogram) then check the
> location of that debug info.
>
> - Dave
>
> On Tue, May 15, 2018 at 12:46 AM Ridwan Shariffdeen via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> Hi,
>>
>> I want to retrieve a function from a source line-number, is this something possible to achieve?
>> I tried the following code snippet with LLVM-7 but it doesn't seem to workhttp://llvm.org/docs/SourceLevelDebugging.html#ccxx_frontend <http://llvm.org/docs/SourceLevelDebugging.html#ccxx_frontend:>
>>
>> Is there specific documentation I can refer to implement this?
>>
>> Thanks
>>
>> --
>>
>>
>> *Rtr. PP Ridwan Shariffdeen*
>> Asst. District Rotaract Representative | Rotaract District 3220
>> Past President | Rotaract Club of University of Moratuwa
>>
>> Member | Rotaract Club of Alumni of University of Moratuwa
>> Graduate | University of Moratuwa
>>
>> m:+94 772562002 | e:rshariffdeen at gmail.com | w:http://bit.ly/ridwanNaruto
>>  | a: Mount Lavinia
>> <http://facebook.com/ridwan.naruto>
>> <http://linkedin.com/in/rshariffdeen>  <http://twitter.com/rshariffdeen>
>> <http://plus.google.com/u/0/117443860077215662076>
>> <http://github.com/rshariffdeen>
>>
> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
> --
*Ridwan Shariffdeen*
Graduate Student | National University of Singapore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180516/efaa698f/attachment.html>


More information about the llvm-dev mailing list