From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5788 invoked by alias); 11 Jun 2006 06:34:42 -0000 Received: (qmail 5736 invoked from network); 11 Jun 2006 06:34:18 -0000 Received: from unknown (202.80.33.51) by sourceware.org with QMTP; 11 Jun 2006 06:34:18 -0000 Received: (qmail 14429 invoked from network); 11 Jun 2006 06:34:15 -0000 X-Anti-Virus: Message scanned for viruses by TVL Received: from dsl2-modem31.tvl.vu (HELO [192.168.2.14]) ([202.80.43.31]) (envelope-sender ) by mail.vanuatu.com.vu (qmail-ldap-1.03) with SMTP for ; 11 Jun 2006 06:34:14 -0000 Message-ID: <448BB966.3050200@sakuraindustries.com> Date: Sun, 11 Jun 2006 06:34:00 -0000 From: Steven Johnson User-Agent: Mozilla Thunderbird 1.0.6-7.2.20060mdk (X11/20050322) MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: psymtab not in symtab warning patch Content-Type: multipart/mixed; boundary="------------060900060909050105040605" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00138.txt.bz2 This is a multi-part message in MIME format. --------------060900060909050105040605 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 774 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 --------------060900060909050105040605 Content-Type: text/x-patch; name="gdb-6.4-switchable-symtab-warning.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb-6.4-switchable-symtab-warning.patch" Content-length: 2138 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); --------------060900060909050105040605--