given an object file and address addr2line tool can relate it to a file and line number in the source code.
I'd like to have the opposite. Given a line number and an object file I want to get a list of instruction addresses which correspond to a given line in the source code.
I know that I can use objdump -DS and seek for a line, but that inconvenient, and requires manual effort to filter out the addresses. Do you know any tool which can do what I want if I give it a list of lines?
UPD.
I give an example of what I want.
I have a set of file lines:
src/a.c:14
src/a.c:28
src/b.c:44
I pass this list to a tool:
cat lines | line2addr -e lib.so
And it reports me instruction addresses for these lines:
0x442: src/a.c:14
0x444: src/a.c:14
0x44a: src/a.c:14
0x584: src/a.c:28
0x588: src/a.c:28
...