Closed the-shank closed 1 year ago
libbacktrace doesn't look at DW_AT_decl_file
. It gets the file name from the line header. I'm not sure off-hand how to see that information using llvm-dwarfdump. With readelf you can see it using readelf --debug=line
. Look for the "File Name Table".
Thanks for the quick response:
This is the file name table I am gettting using readelf --debug=line <binary>
Does this in any way convey that the paths in the backtrace (using libbacktrace) would be relative?
Edit:
I think the dir
corresponding to the dir number is what would be prepended to the filename.
It might be too basic a question, but what step would I have to take during compilation so that the dir does not become relative? If you can point me in the correct direction, it would be a great help. Thanks.
I would guess that you are executing something like $CC src/core/fxfont.cpp
and that is probably where the directory entry is coming from. You could try using an absolute path there.
In any case this doesn't seem like a bug in libbacktrace, so closing.
Thanks for the wonderful library!
I am facing an issue wherein libbacktrace is providing only relative paths, despite absolute paths being available in the dwarf information:
For example, here is the relevant section from
llvm-dwarfdump
output for a particular binary that I built locally.And here is the backtrace produced using
backtrace_full
:Is there a way to have libbacktrace provide absolute filenames?