switch (p[1])
{
case 'S':
- pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
- VAR_DOMAIN, LOC_STATIC,
- data_sect_index,
- psymbol_placement::STATIC,
- nlist.n_value, psymtab_language,
- partial_symtabs, objfile);
+ if (pst != nullptr)
+ pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
+ VAR_DOMAIN, LOC_STATIC,
+ data_sect_index,
+ psymbol_placement::STATIC,
+ nlist.n_value, psymtab_language,
+ partial_symtabs, objfile);
+ else
+ complaint (_("static `%*s' appears to be defined "
+ "outside of all compilation units"),
+ sym_len, sym_name);
continue;
case 'G':
/* The addresses in these entries are reported to be
wrong. See the code that reads 'G's for symtabs. */
- pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
- VAR_DOMAIN, LOC_STATIC,
- data_sect_index,
- psymbol_placement::GLOBAL,
- nlist.n_value, psymtab_language,
- partial_symtabs, objfile);
+ if (pst != nullptr)
+ pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
+ VAR_DOMAIN, LOC_STATIC,
+ data_sect_index,
+ psymbol_placement::GLOBAL,
+ nlist.n_value, psymtab_language,
+ partial_symtabs, objfile);
+ else
+ complaint (_("global `%*s' appears to be defined "
+ "outside of all compilation units"),
+ sym_len, sym_name);
continue;
case 'T':
|| (p == namestring + 1
&& namestring[0] != ' '))
{
- pst->add_psymbol (gdb::string_view (sym_name, sym_len),
- true, STRUCT_DOMAIN, LOC_TYPEDEF, -1,
- psymbol_placement::STATIC,
- 0, psymtab_language,
- partial_symtabs, objfile);
+ if (pst != nullptr)
+ pst->add_psymbol (gdb::string_view (sym_name, sym_len),
+ true, STRUCT_DOMAIN, LOC_TYPEDEF, -1,
+ psymbol_placement::STATIC,
+ 0, psymtab_language,
+ partial_symtabs, objfile);
+ else
+ complaint (_("enum, struct, or union `%*s' appears "
+ "to be defined outside of all "
+ "compilation units"),
+ sym_len, sym_name);
if (p[2] == 't')
{
/* Also a typedef with the same name. */
- pst->add_psymbol (gdb::string_view (sym_name, sym_len),
- true, VAR_DOMAIN, LOC_TYPEDEF, -1,
- psymbol_placement::STATIC,
- 0, psymtab_language,
- partial_symtabs, objfile);
+ if (pst != nullptr)
+ pst->add_psymbol (gdb::string_view (sym_name, sym_len),
+ true, VAR_DOMAIN, LOC_TYPEDEF, -1,
+ psymbol_placement::STATIC,
+ 0, psymtab_language,
+ partial_symtabs, objfile);
+ else
+ complaint (_("typedef `%*s' appears to be defined "
+ "outside of all compilation units"),
+ sym_len, sym_name);
p += 1;
}
}
case 't':
if (p != namestring) /* a name is there, not just :T... */
{
- pst->add_psymbol (gdb::string_view (sym_name, sym_len),
- true, VAR_DOMAIN, LOC_TYPEDEF, -1,
- psymbol_placement::STATIC,
- 0, psymtab_language,
- partial_symtabs, objfile);
+ if (pst != nullptr)
+ pst->add_psymbol (gdb::string_view (sym_name, sym_len),
+ true, VAR_DOMAIN, LOC_TYPEDEF, -1,
+ psymbol_placement::STATIC,
+ 0, psymtab_language,
+ partial_symtabs, objfile);
+ else
+ complaint (_("typename `%*s' appears to be defined "
+ "outside of all compilation units"),
+ sym_len, sym_name);
}
check_enum:
/* If this is an enumerated type, we need to
;
/* Note that the value doesn't matter for
enum constants in psymtabs, just in symtabs. */
- pst->add_psymbol (gdb::string_view (p, q - p), true,
- VAR_DOMAIN, LOC_CONST, -1,
- psymbol_placement::STATIC, 0,
- psymtab_language,
- partial_symtabs, objfile);
+ if (pst != nullptr)
+ pst->add_psymbol (gdb::string_view (p, q - p), true,
+ VAR_DOMAIN, LOC_CONST, -1,
+ psymbol_placement::STATIC, 0,
+ psymtab_language,
+ partial_symtabs, objfile);
+ else
+ complaint (_("enum constant `%*s' appears to be defined "
+ "outside of all compilation units"),
+ ((int) (q - p)), p);
/* Point past the name. */
p = q;
/* Skip over the value. */
case 'c':
/* Constant, e.g. from "const" in Pascal. */
- pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
- VAR_DOMAIN, LOC_CONST, -1,
- psymbol_placement::STATIC, 0,
- psymtab_language,
- partial_symtabs, objfile);
+ if (pst != nullptr)
+ pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
+ VAR_DOMAIN, LOC_CONST, -1,
+ psymbol_placement::STATIC, 0,
+ psymtab_language,
+ partial_symtabs, objfile);
+ else
+ complaint (_("constant `%*s' appears to be defined "
+ "outside of all compilation units"),
+ sym_len, sym_name);
+
continue;
case 'f':
pst->set_text_low (nlist.n_value);
textlow_not_set = 0;
}
- pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
- VAR_DOMAIN, LOC_BLOCK,
- SECT_OFF_TEXT (objfile),
- psymbol_placement::STATIC,
- nlist.n_value, psymtab_language,
- partial_symtabs, objfile);
+ if (pst != nullptr)
+ pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
+ VAR_DOMAIN, LOC_BLOCK,
+ SECT_OFF_TEXT (objfile),
+ psymbol_placement::STATIC,
+ nlist.n_value, psymtab_language,
+ partial_symtabs, objfile);
continue;
/* Global functions were ignored here, but now they
pst->set_text_low (nlist.n_value);
textlow_not_set = 0;
}
- pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
- VAR_DOMAIN, LOC_BLOCK,
- SECT_OFF_TEXT (objfile),
- psymbol_placement::GLOBAL,
- nlist.n_value, psymtab_language,
- partial_symtabs, objfile);
+ if (pst != nullptr)
+ pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
+ VAR_DOMAIN, LOC_BLOCK,
+ SECT_OFF_TEXT (objfile),
+ psymbol_placement::GLOBAL,
+ nlist.n_value, psymtab_language,
+ partial_symtabs, objfile);
continue;
/* Two things show up here (hopefully); static symbols of