[LLVMdev] Finding the first line number of a function (-g vs -gline-tables-only)

Renato Golin renato.golin at linaro.org
Tue Nov 26 06:42:25 PST 2013


On 26 November 2013 14:01, Diego Novillo <dnovillo at google.com> wrote:

> I need '3' to be my base for all the relative offsets I get from the
> profiler.  So, how do I find out the line number of the symbol 'foo'
> itself?
>

Hi Diego,

In the metadata. Look for DW_TAG_subprogram:

define i32 @main() #0 {
...
}

...
!4 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"main",
metadata !"main", metadata !"", i32 6, metadata !6, i1 false, i1 true, i32
0, i32 0, null, i32 256, i1 false, i32 ()* @main, null, null, metadata !2,
i32 6} ; [ DW_TAG_subprogram ] [line 6] [def] [main]

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131126/53f97636/attachment.html>


More information about the llvm-dev mailing list