From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21738 invoked by alias); 12 Apr 2002 10:22:56 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 21729 invoked from network); 12 Apr 2002 10:22:51 -0000 Received: from unknown (HELO dublin.ACT-Europe.FR) (212.157.227.154) by sources.redhat.com with SMTP; 12 Apr 2002 10:22:51 -0000 Received: from berlin.ACT-Europe.FR (berlin.int.act-europe.fr [10.10.0.169]) by dublin.ACT-Europe.FR (Postfix) with ESMTP id DE7B0229E45 for ; Fri, 12 Apr 2002 12:22:50 +0200 (MET DST) Received: by berlin.ACT-Europe.FR (Postfix, from userid 507) id 961F6984; Fri, 12 Apr 2002 12:22:50 +0200 (CEST) Date: Fri, 12 Apr 2002 03:22:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: Re: [RFC] Uninitialized section index internal error on Tru64 5.1 Message-ID: <20020412122250.F16134@act-europe.fr> References: <20020412121941.E16134@act-europe.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="qMm9M+Fa2AknHoGS" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020412121941.E16134@act-europe.fr>; from brobecker@ACT-Europe.FR on Fri, Apr 12, 2002 at 12:19:41PM +0200 X-SW-Source: 2002-04/txt/msg00453.txt.bz2 --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 268 > The following patch fixes many regressions in the testsuite: > Summary 1 2 > FAIL 1644 792 > PASS 4388 6990 > XFAIL 59 149 > XPASS 1 3 Sorry, the patch is attached, this time. What a fool sometimes... -- Joel --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mdebugread.c.diff" Content-length: 4716 Index: mdebugread.c =================================================================== RCS file: /cvs/src/src/gdb/mdebugread.c,v retrieving revision 1.24 diff -c -3 -p -r1.24 mdebugread.c *** mdebugread.c 19 Mar 2002 19:00:03 -0000 1.24 --- mdebugread.c 12 Apr 2002 10:02:08 -0000 *************** struct symloc *** 143,149 **** || (sc) == scPData \ || (sc) == scXData) #define SC_IS_COMMON(sc) ((sc) == scCommon || (sc) == scSCommon) ! #define SC_IS_BSS(sc) ((sc) == scBss || (sc) == scSBss) #define SC_IS_UNDEF(sc) ((sc) == scUndefined || (sc) == scSUndefined) /* Various complaints about symbol reading that don't abort the process */ --- 143,150 ---- || (sc) == scPData \ || (sc) == scXData) #define SC_IS_COMMON(sc) ((sc) == scCommon || (sc) == scSCommon) ! #define SC_IS_BSS(sc) ((sc) == scBss) ! #define SC_IS_SBSS(sc) ((sc) == scSBss) #define SC_IS_UNDEF(sc) ((sc) == scUndefined || (sc) == scSUndefined) /* Various complaints about symbol reading that don't abort the process */ *************** static int found_ecoff_debugging_info; *** 327,332 **** --- 328,335 ---- /* Forward declarations */ + static int get_section_index (struct objfile *, char *); + static int upgrade_type (int, struct type **, int, union aux_ext *, int, char *); *************** is_pending_symbol (FDR *fh, char *sh) *** 637,642 **** --- 640,657 ---- return p; } + /* Return the section index for the given section name. Return -1 if + the section was not found. */ + static int + get_section_index (struct objfile *objfile, char *section_name) + { + asection *sect = bfd_get_section_by_name (objfile->obfd, section_name); + if (sect) + return sect->index; + else + return -1; + } + /* Add a new symbol SH of type T */ static void *************** parse_partial_symbols (struct objfile *o *** 2425,2450 **** --- 2440,2511 ---- ms_type = mst_bss; svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile)); } + else if (SC_IS_SBSS (ext_in->asym.sc)) + { + ms_type = mst_bss; + svalue += ANOFFSET (objfile->section_offsets, + get_section_index (objfile, ".sbss")); + } else ms_type = mst_abs; break; case stLabel: /* Label */ + + /* On certain platforms, some extra label symbols can be + generated by the linker. One possible usage for this kind + of symbols is to represent the address of the begining of a + given section. For instance, on Tru64 5.1, the address of + the _ftext label is the start address of the .text section. + + The storage class of these symbols is usually directly + related to the section to which the symbol refers. For + instance, on Tru64 5.1, the storage class for the _fdata + label is scData, refering to the .data section. + + It is actually possible that the section associated to the + storage class of the label does not exist. On True64 5.1 + for instance, the libm.so shared library does not contain + any .data section, although it contains a _fpdata label + which storage class is scData... Since these symbols are + usually useless for the debugger user anyway, we just + discard these symbols. + */ + if (SC_IS_TEXT (ext_in->asym.sc)) { + if (objfile->sect_index_text == -1) + continue; + ms_type = mst_file_text; svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); } else if (SC_IS_DATA (ext_in->asym.sc)) { + if (objfile->sect_index_data == -1) + continue; + ms_type = mst_file_data; svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile)); } else if (SC_IS_BSS (ext_in->asym.sc)) { + if (objfile->sect_index_bss == -1) + continue; + ms_type = mst_file_bss; svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile)); } + else if (SC_IS_SBSS (ext_in->asym.sc)) + { + const int sbss_sect_index = get_section_index (objfile, ".sbss"); + + if (sbss_sect_index == -1) + continue; + + ms_type = mst_file_bss; + svalue += ANOFFSET (objfile->section_offsets, sbss_sect_index); + } else ms_type = mst_abs; break; --qMm9M+Fa2AknHoGS--