aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/line-header.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2022-04-26 21:40:51 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2022-07-29 20:54:49 -0400
commitddc01737d34f16074b2c9a92c5a808be5c91340f (patch)
tree8acce31c8736d1749f358e57d2f4761a58b4c89d /gdb/dwarf2/line-header.c
parent80affb9f80d22ee4b1463f23a36b083e05b6d2c3 (diff)
downloadbinutils-ddc01737d34f16074b2c9a92c5a808be5c91340f.zip
binutils-ddc01737d34f16074b2c9a92c5a808be5c91340f.tar.gz
binutils-ddc01737d34f16074b2c9a92c5a808be5c91340f.tar.bz2
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
Diffstat (limited to 'gdb/dwarf2/line-header.c')
-rw-r--r--gdb/dwarf2/line-header.c5
1 files changed, 3 insertions, 2 deletions
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;