[llvm-dev] source line number for instruction

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] source line number for instruction

Bruce Hoult via llvm-dev
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 work
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:[hidden email] | w:http://bit.ly/ridwanNaruto a: Mount Lavinia
    

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] source line number for instruction

Bruce Hoult via llvm-dev
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 <[hidden email]> 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 work
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:[hidden email] | w:http://bit.ly/ridwanNaruto a: Mount Lavinia
    
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] source line number for instruction

Bruce Hoult via llvm-dev
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 <[hidden email]> 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 <[hidden email]> 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 work
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:[hidden email] | w:http://bit.ly/ridwanNaruto a: Mount Lavinia
    
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
--
Ridwan Shariffdeen
Graduate Student | National University of Singapore

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev