diff -Naur gdb-6.4/gdb/symtab.c gdb-6.4-no-symtab-warning/gdb/symtab.c --- gdb-6.4/gdb/symtab.c 2005-03-08 15:34:44.000000000 +1100 +++ gdb-6.4-no-symtab-warning/gdb/symtab.c 2006-06-11 16:52:11.000000000 +1100 @@ -144,6 +144,23 @@ const struct block *block_found; +/* A State variable to allow the "psymtab not in symtab" warning to + be toggled off if it produces copious unproductive warnings. + Note: It is better to resolve the warning than toggle it off, + this facility is only here for the cases where it can't be + resolved, yet causes no apparent problems. Defaults to ON. */ +int psymtab_not_in_symtab_warning = 1; + +static void + show_psymtab_not_in_symtab_warning (struct ui_file *file, int from_tty, + struct cmd_list_element *c, const char *value) +{ + fprintf_filtered (file, _("\ +The 'psymtab not in symtab' warning is %s.\n"), + value); +} + + /* Check for a symtab of a specific name; first in symtabs, then in psymtabs. *If* there is no '/' in the name, a match after a '/' in the symtab filename will also work. */ @@ -1920,7 +1937,7 @@ ps = find_pc_sect_psymtab (pc, section); if (ps) { - if (ps->readin) + if ((ps->readin) && psymtab_not_in_symtab_warning) /* Might want to error() here (in case symtab is corrupt and will cause a core dump), but maybe we can successfully continue, so let's not. */ @@ -4185,6 +4202,17 @@ All global and static variable names, or those matching REGEXP.")); } + add_setshow_boolean_cmd ("psymtab-not-in-symtab-warning", + class_support, + &psymtab_not_in_symtab_warning, + _("\ +Set psymtab not in symtab warning to be generated."), _("\ +Show psymtab not in symtab warning to be generated."), NULL, + NULL, + show_psymtab_not_in_symtab_warning, + &setlist, &showlist); + + /* Initialize the one built-in type that isn't language dependent... */ builtin_type_error = init_type (TYPE_CODE_ERROR, 0, 0, "", (struct objfile *) NULL);