-/* Add an entry to LH's include directory table. */
-
-static void
-add_include_dir (struct line_header *lh, const char *include_dir)
+void
+line_header::add_include_dir (const char *include_dir)
{
if (dwarf_line_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "Adding dir %u: %s\n",
- lh->num_include_dirs + 1, include_dir);
+ (unsigned) include_dirs.size () + 1, include_dir);
@@ -17952,11 +17890,22 @@ dwarf_decode_line_header (unsigned int
offset, struct dwarf2_cu *cu)
if (lh->version >= 5)
{
/* Read directory table. */
- read_formatted_entries (abfd, &line_ptr, lh, &cu->header,
- add_include_dir_stub);
+ read_formatted_entries (abfd, &line_ptr, lh.get (), &cu->header,
+ [] (struct line_header *lh, const char *name,
+ unsigned int dir_index, unsigned int mod_time,
+ unsigned int length)
+ {
+ lh->add_include_dir (name);
+ });
/* Read file name table. */
- read_formatted_entries (abfd, &line_ptr, lh, &cu->header,
add_file_name);
+ read_formatted_entries (abfd, &line_ptr, lh.get (), &cu->header,
+ [] (struct line_header *lh, const char *name,
+ unsigned int dir_index, unsigned int mod_time,
+ unsigned int length)
+ {
+ lh->add_file_name (name, dir_index, mod_time, length);
+ });