Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* psymtab not in symtab warning patch
@ 2006-06-11  6:34 Steven Johnson
  2006-06-13 23:13 ` Jim Blandy
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Johnson @ 2006-06-11  6:34 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 774 bytes --]

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

[-- Attachment #2: gdb-6.4-switchable-symtab-warning.patch --]
[-- Type: text/x-patch, Size: 2138 bytes --]

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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-13 23:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-11  6:34 psymtab not in symtab warning patch Steven Johnson
2006-06-13 23:13 ` Jim Blandy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox