This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

psymtab not in symtab warning patch


Hi,

Please consider the attached patch.

It allows the "PC 0x??? in psymtab but not in symtab" warning to be
"toggled off".  The reason for this, is for whatever reason I get it
heaps with my PPC Assembler code.  There doesn't appear to be any
obvious incantation to control it or prevent it when building the asm
files, so i've given up trying.  The attached patch retains the current
behaviour, but if someone is being inundated by the warning, which
happens when it occurs, they can turn it off, and at least continue
debugging OK.

Obviously finding out why it happens is far better, but i know nothing
about dwarf debug information, or the psymtab or symtab stuff, so i'm
not going to be productive in finding a better answer.

This patch is against GDB 6.4

Steven J
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,
 				  "<unknown type>", (struct objfile *) NULL);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]