This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug symtab/17866] incremental read missing header files


https://sourceware.org/bugzilla/show_bug.cgi?id=17866

Doug Evans <xdje42 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xdje42 at gmail dot com

--- Comment #1 from Doug Evans <xdje42 at gmail dot com> ---
The reason this happens is that gdb avoids create psymtabs for headers not
referenced in the line number program in dwarf.
grep for included_p below.

There's some discussion as to why in this thread:
https://sourceware.org/ml/gdb-patches/2004-04/msg00267.html
with the original message here:
https://www.sourceware.org/ml/gdb-patches/2004-01/msg00015.html

gdb has changed a bit since then, it may now be reasonable to
create psymtabs for all headers, whether or not they are referenced
by the line number program.

static void
dwarf_decode_lines (struct line_header *lh, const char *comp_dir,
                    struct dwarf2_cu *cu, struct partial_symtab *pst,
                    CORE_ADDR lowpc, int decode_mapping)
{
  struct objfile *objfile = cu->objfile;
  const int decode_for_pst_p = (pst != NULL);

  if (decode_mapping)
    dwarf_decode_lines_1 (lh, cu, decode_for_pst_p, lowpc);

  if (decode_for_pst_p)
    {
      int file_index;

      /* Now that we're done scanning the Line Header Program, we can           
         create the psymtab of each included file.  */
      for (file_index = 0; file_index < lh->num_file_names; file_index++)
        if (lh->file_names[file_index].included_p == 1)
          {
            const char *include_name =
              psymtab_include_file_name (lh, file_index, pst, comp_dir);
            if (include_name != NULL)
              dwarf2_create_include_psymtab (include_name, pst, objfile);
          }
    }

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]