Both gcc and clang have option -gcolumn-info
, which is described this way:
Emit location column information into DWARF debugging information, rather than just file and line.
I have compiled my binary with this option. Now I have address of some instruction and want to translate it back to source file, line number and column. Is there a way to do it in gdb? Is there some other tool that can extract this information?
I know that I can use info line *0xabcd1234
in gdb to get the source file and line corresponding to that address, but it does not show the column.
Answering my guestion, I found one way to get the information using
lldb
andimage lookup
command: