}
/* Subroutine of dwarf_decode_lines to simplify it.
- Process the line number information in LH. */
+ Process the line number information in CU::line_header. */
static void
-dwarf_decode_lines_1 (struct line_header *lh, struct dwarf2_cu *cu,
- unrelocated_addr lowpc)
+dwarf_decode_lines_1 (struct dwarf2_cu *cu, unrelocated_addr lowpc)
{
+ struct line_header *lh = cu->line_header;
const gdb_byte *line_ptr, *extended_end;
const gdb_byte *line_end;
unsigned int bytes_read, extended_len;
/* See dwarf2/line-program.h. */
void
-dwarf_decode_lines (struct line_header *lh, struct dwarf2_cu *cu,
- unrelocated_addr lowpc, bool decode_mapping)
+dwarf_decode_lines (struct dwarf2_cu *cu, unrelocated_addr lowpc,
+ bool decode_mapping)
{
if (decode_mapping)
- dwarf_decode_lines_1 (lh, cu, lowpc);
+ dwarf_decode_lines_1 (cu, lowpc);
/* Make sure a symtab is created for every file, even files
which contain only variables (i.e. no code with associated
buildsym_compunit *builder = cu->get_builder ();
struct compunit_symtab *cust = builder->get_compunit_symtab ();
- for (auto &fe : lh->file_names ())
+ struct line_header *lh = cu->line_header;
+ for (file_entry &fe : lh->file_names ())
{
dwarf2_start_subfile (cu, fe, *lh);
subfile *sf = builder->get_current_subfile ();
#ifndef GDB_DWARF2_LINE_PROGRAM_H
#define GDB_DWARF2_LINE_PROGRAM_H
-/* Decode the Line Number Program (LNP) for the given line_header
- structure and CU. The actual information extracted and the type
- of structures created from the LNP depends on the value of PST.
-
- FND holds the CU file name and directory, if known.
- It is used for relative paths in the line table.
+/* Decode the Line Number Program (LNP) for CU::line_header.
NOTE: It is important that psymtabs have the same file name (via
strcmp) as the corresponding symtab. Since the directory is not
for its PC<->lines mapping information. Otherwise only the filename
table is read in. */
-extern void dwarf_decode_lines (struct line_header *lh,
- struct dwarf2_cu *cu,
+extern void dwarf_decode_lines (struct dwarf2_cu *cu,
unrelocated_addr lowpc, bool decode_mapping);
#endif /* GDB_DWARF2_LINE_PROGRAM_H */
then there won't be any interesting code in the CU, but a check later on
(in lnp_state_machine::check_line_address) will fail to properly exclude
an entry that was removed via --gc-sections. */
- dwarf_decode_lines (cu->line_header, cu, lowpc, decode_mapping && have_code);
+ dwarf_decode_lines (cu, lowpc, decode_mapping && have_code);
}
/* Process DW_TAG_compile_unit or DW_TAG_partial_unit. */