Specialize partial_symtab for DWARF include files
Include files are represented by a partial symtab, but don't expand to
anything. From dwarf2_psymtab::expand_psymtab:
if (per_cu == NULL)
{
/* It's an include file, no symbols to read for it.
Everything is in the parent symtab. */
readin = true;
return;
}
This patch introduces a new specialization of partial_symtab to handle
this case. In addition to being slightly smaller, I believe an
include file is the only situation where a DWARF psymtab can result in
a null compunit_symtab. This adds an assert to that effect as well.
This change will simplify one of the psymtab sharing patches.
gdb/ChangeLog
2020-02-26 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (struct dwarf2_include_psymtab): New.
(dwarf2_create_include_psymtab): Use dwarf2_include_psymtab.
(dwarf2_psymtab::expand_psymtab, dwarf2_psymtab::readin_p)
(dwarf2_psymtab::get_compunit_symtab): Remove null checks for
per_cu_data.