File index given line (libdw)

Mark Wielaard mark@klomp.org
Fri Jul 14 10:03:00 GMT 2017


On Thu, 2017-07-13 at 17:33 +0000, Sasha Da Rocha Pinheiro wrote:
> given a Die, I want to associate each line (from dwarf_getsrclines) to
> a file (from dwarf_getsrcfiles). The only way to do this is get the
> filename returned by dwarf_linesrc, and search in the filenames given
> by dwarf_getsrcfiles and dwarf_filesrc. But this is expensive since
> this has to be done for each line. Instead, if I could get the file
> index in the array "struct Dwarf_Fileinfo_s info", I wouldn't need to
> search.

But why do you want to do that?
If we would add int dwarf_line_index (Dwarf_Line *line, size_t *idx) how
exactly would you use it?
What would be a good testcase for this new functionality?
A small example program would help to see what the exact semantics
should be.

Thanks,

Mark



More information about the Elfutils-devel mailing list