- /* Now do checks requiring the associated symtab. */
- if (cust == NULL)
- continue;
- bv = COMPUNIT_BLOCKVECTOR (cust);
- b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- partial_symbol **psym
- = &objfile->partial_symtabs->static_psymbols[ps->statics_offset];
- length = ps->n_static_syms;
- while (length--)
- {
- sym = block_lookup_symbol (b, (*psym)->ginfo.search_name (),
- symbol_name_match_type::SEARCH_NAME,
- (*psym)->domain);
- if (!sym)
- {
- printf_filtered ("Static symbol `");
- puts_filtered ((*psym)->ginfo.linkage_name ());
- printf_filtered ("' only found in ");
- puts_filtered (ps->filename);
- printf_filtered (" psymtab\n");
- }
- psym++;
- }
- b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- psym = &objfile->partial_symtabs->global_psymbols[ps->globals_offset];
- length = ps->n_global_syms;
- while (length--)
- {
- sym = block_lookup_symbol (b, (*psym)->ginfo.search_name (),
- symbol_name_match_type::SEARCH_NAME,
- (*psym)->domain);
- if (!sym)
- {
- printf_filtered ("Global symbol `");
- puts_filtered ((*psym)->ginfo.linkage_name ());
- printf_filtered ("' only found in ");
- puts_filtered (ps->filename);
- printf_filtered (" psymtab\n");
- }
- psym++;
- }
- if (ps->raw_text_high () != 0
- && (ps->text_low (objfile) < BLOCK_START (b)
- || ps->text_high (objfile) > BLOCK_END (b)))
- {
- printf_filtered ("Psymtab ");
- puts_filtered (ps->filename);
- printf_filtered (" covers ");
- fputs_filtered (paddress (gdbarch, ps->text_low (objfile)),
- gdb_stdout);
- printf_filtered (" - ");
- fputs_filtered (paddress (gdbarch, ps->text_high (objfile)),
- gdb_stdout);
- printf_filtered (" but symtab covers only ");
- fputs_filtered (paddress (gdbarch, BLOCK_START (b)), gdb_stdout);
- printf_filtered (" - ");
- fputs_filtered (paddress (gdbarch, BLOCK_END (b)), gdb_stdout);
- printf_filtered ("\n");
- }
- }
+ /* First do some checks that don't require the associated symtab. */
+ if (ps->text_high (objfile) < ps->text_low (objfile))
+ {
+ printf_filtered ("Psymtab ");
+ puts_filtered (ps->filename);
+ printf_filtered (" covers bad range ");
+ fputs_filtered (paddress (gdbarch, ps->text_low (objfile)),
+ gdb_stdout);
+ printf_filtered (" - ");
+ fputs_filtered (paddress (gdbarch, ps->text_high (objfile)),
+ gdb_stdout);
+ printf_filtered ("\n");
+ continue;
+ }
+
+ /* Now do checks requiring the associated symtab. */
+ if (cust == NULL)
+ continue;
+ bv = COMPUNIT_BLOCKVECTOR (cust);
+ b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+ for (partial_symbol *psym : ps->static_psymbols)
+ {
+ /* Skip symbols for inlined functions without address. These may
+ or may not have a match in the full symtab. */
+ if (psym->aclass == LOC_BLOCK
+ && psym->ginfo.value.address == 0)
+ continue;
+
+ sym = block_lookup_symbol (b, psym->ginfo.search_name (),
+ symbol_name_match_type::SEARCH_NAME,
+ psym->domain);
+ if (!sym)
+ {
+ printf_filtered ("Static symbol `");
+ puts_filtered (psym->ginfo.linkage_name ());
+ printf_filtered ("' only found in ");
+ puts_filtered (ps->filename);
+ printf_filtered (" psymtab\n");
+ }
+ }
+ b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+ for (partial_symbol *psym : ps->global_psymbols)
+ {
+ sym = block_lookup_symbol (b, psym->ginfo.search_name (),
+ symbol_name_match_type::SEARCH_NAME,
+ psym->domain);
+ if (!sym)
+ {
+ printf_filtered ("Global symbol `");
+ puts_filtered (psym->ginfo.linkage_name ());
+ printf_filtered ("' only found in ");
+ puts_filtered (ps->filename);
+ printf_filtered (" psymtab\n");
+ }
+ }
+ if (ps->raw_text_high () != 0
+ && (ps->text_low (objfile) < BLOCK_START (b)
+ || ps->text_high (objfile) > BLOCK_END (b)))
+ {
+ printf_filtered ("Psymtab ");
+ puts_filtered (ps->filename);
+ printf_filtered (" covers ");
+ fputs_filtered (paddress (gdbarch, ps->text_low (objfile)),
+ gdb_stdout);
+ printf_filtered (" - ");
+ fputs_filtered (paddress (gdbarch, ps->text_high (objfile)),
+ gdb_stdout);
+ printf_filtered (" but symtab covers only ");
+ fputs_filtered (paddress (gdbarch, BLOCK_START (b)), gdb_stdout);
+ printf_filtered (" - ");
+ fputs_filtered (paddress (gdbarch, BLOCK_END (b)), gdb_stdout);
+ printf_filtered ("\n");
+ }
+ }
+ }
+ }