summaryrefslogtreecommitdiff
path: root/libdw/dwarf.h
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2018-05-06 00:33:27 +0200
committerMark Wielaard <mark@klomp.org>2018-05-11 16:42:57 +0200
commit982b6fe9e31683607d476d7f90d1b56cbb78aa21 (patch)
tree7d19fa0c71053dcf39aa79ca68bf5cfe7dddb02a /libdw/dwarf.h
parentce50fccb956238ed7a536397633edb2cc5294627 (diff)
downloadelfutils-982b6fe9e31683607d476d7f90d1b56cbb78aa21.tar.gz
libdw: Handle DWARF5 line tables in dwarf_getsrclines.
In DWARF5 the actual line number table format doesn't change, except for not allowing DW_LNE_define_file (but we still just accept it). The changes are the header having new fields for address and segment selector sizes, and new formats for the directory and file names tables. The directory and file name tables are much more flexible in DWARF5, but we only interpret the actual names and file/dir index relationships, skipping/ignoring any other information. There also is no new interface yet to get at the new directory and file properties. There is some small confusion about the file name table indexing. Older DWARF versions explicitly called the first file name table 1. DWARF5 implies the first index is 0 (but for file attributes, zero means not associated with a file). We get away with that by having an actual zero index for older DWARF versions (the null_fill). It looks like gcc gets around it by explicitly duplicating the first (0) and second (1) file name entry in the table. This can also be seen in the new testcase. The patch looks big because of moving a few initializations around and because the code that is different for older/newer DWARF got moved under if statements. But the original old DWARF code path didn't really change. Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'libdw/dwarf.h')
-rw-r--r--libdw/dwarf.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libdw/dwarf.h b/libdw/dwarf.h
index 99cc1128..fc9801bd 100644
--- a/libdw/dwarf.h
+++ b/libdw/dwarf.h
@@ -783,6 +783,17 @@ enum
DW_DEFAULTED_out_of_class = 2
};
+/* DWARF line content descriptions. */
+enum
+ {
+ DW_LNCT_path = 0x1,
+ DW_LNCT_directory_index = 0x2,
+ DW_LNCT_timestamp = 0x3,
+ DW_LNCT_size = 0x4,
+ DW_LNCT_MD5 = 0x5,
+ DW_LNCT_lo_user = 0x2000,
+ DW_LNCT_hi_user = 0x3fff
+ };
/* DWARF standard opcode encodings. */
enum