Read .debug_line without .debug_info

Torsten Polle
Mon Mar 26 19:25:00 GMT 2018

Hi Mark,

> Am 26.03.2018 um 21:12 schrieb Mark Wielaard <>:
> Hi Sasha,
> On Mon, Mar 26, 2018 at 04:41:06PM +0000, Sasha Da Rocha Pinheiro wrote:
>> is it possible to read contents of .debug_line section without the
>> presence of a .debug_info section?
> No, because .debug_line sections need some information from the CU
> which comes from the .debug_info. In particular the directory table
> starts with the compilation directory which can only be gotten from
> the CU (DW_AT_comp_dir). The files in the file list (which don't have
> an explicit dir associated) are all given relative to that comp dir.

you could take this information from the include directories:

"11. include_directories (sequence of path names)

Entries in this sequence describe each path that was searched for included source files in this compilation. (The paths include those directories specified explicitly by the user for the compiler to search and those the compiler searches without explicit direction.) Each path entry is either a full path name or is relative to the current directory of the compilation.

The last entry is followed by a single null byte.

The line number program assigns numbers to each of the file entries in order, beginning with 1. The current directory of the compilation is understood to be the zeroth entry and is not explicitly represented."

Kind Regards,

More information about the Elfutils-devel mailing list