From ddc01737d34f16074b2c9a92c5a808be5c91340f Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 26 Apr 2022 21:40:51 -0400 Subject: gdb/dwarf: pass compilation directory to line header The following patch changes line_header::file_file_name to prepend the compilation directory to the file name, if needed. For that, the line header needs to know about the compilation directory. Prepare for that by adding a constructor that takes it as a parameter, and passing the value down everywhere needed. Add a second constructor for the special case of building a line_header for doing a hash table lookup, since that case doesn't require a compilation directory value. Change-Id: Iba3ba0293e4e2d13a64b257cf9a3094684d54330 --- gdb/dwarf2/line-header.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gdb/dwarf2/line-header.c') diff --git a/gdb/dwarf2/line-header.c b/gdb/dwarf2/line-header.c index 6323084..1337985 100644 --- a/gdb/dwarf2/line-header.c +++ b/gdb/dwarf2/line-header.c @@ -264,7 +264,8 @@ line_header_up dwarf_decode_line_header (sect_offset sect_off, bool is_dwz, dwarf2_per_objfile *per_objfile, struct dwarf2_section_info *section, - const struct comp_unit_head *cu_header) + const struct comp_unit_head *cu_header, + const char *comp_dir) { const gdb_byte *line_ptr; unsigned int bytes_read, offset_size; @@ -281,7 +282,7 @@ dwarf_decode_line_header (sect_offset sect_off, bool is_dwz, return 0; } - line_header_up lh (new line_header ()); + line_header_up lh (new line_header (comp_dir)); lh->sect_off = sect_off; lh->offset_in_dwz = is_dwz; -- cgit v1.1