- /* 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))
+ {
+ gdb_printf ("Psymtab ");
+ gdb_puts (ps->filename);
+ gdb_printf (" covers bad range ");
+ gdb_puts (paddress (gdbarch, ps->text_low (objfile)));
+ gdb_printf (" - ");
+ gdb_puts (paddress (gdbarch, ps->text_high (objfile)));
+ gdb_printf ("\n");
+ continue;
+ }
+
+ /* Now do checks requiring the associated symtab. */
+ if (cust == NULL)
+ continue;
+ bv = cust->blockvector ();
+ b = 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)
+ {
+ gdb_printf ("Static symbol `");
+ gdb_puts (psym->ginfo.linkage_name ());
+ gdb_printf ("' only found in ");
+ gdb_puts (ps->filename);
+ gdb_printf (" psymtab\n");
+ }
+ }
+ b = 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)
+ {
+ gdb_printf ("Global symbol `");
+ gdb_puts (psym->ginfo.linkage_name ());
+ gdb_printf ("' only found in ");
+ gdb_puts (ps->filename);
+ gdb_printf (" psymtab\n");
+ }
+ }
+ if (ps->raw_text_high () != 0
+ && (ps->text_low (objfile) < b->start ()
+ || ps->text_high (objfile) > b->end ()))
+ {
+ gdb_printf ("Psymtab ");
+ gdb_puts (ps->filename);
+ gdb_printf (" covers ");
+ gdb_puts (paddress (gdbarch, ps->text_low (objfile)));
+ gdb_printf (" - ");
+ gdb_puts (paddress (gdbarch, ps->text_high (objfile)));
+ gdb_printf (" but symtab covers only ");
+ gdb_puts (paddress (gdbarch, b->start ()));
+ gdb_printf (" - ");
+ gdb_puts (paddress (gdbarch, b->end ()));
+ gdb_printf ("\n");
+ }
+ }
+ }
+ }