From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3075 invoked by alias); 28 Feb 2003 23:00:00 -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 3031 invoked from network); 28 Feb 2003 22:59:59 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by 172.16.49.205 with SMTP; 28 Feb 2003 22:59:59 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h1SMxvQ29185; Fri, 28 Feb 2003 14:59:57 -0800 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Michael Elizabeth Chastain Cc: gdb-patches@sources.redhat.com Subject: stab at a fix for PR java/1039 From: David Carlton Date: Fri, 28 Feb 2003 23:00:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-02/txt/msg00829.txt.bz2 Michael, could you give this patch a try on gdb.java/jmisc2.exp in a situation where that test used to pass before this month? I don't have the right version of gcj to test it, but it's vaguely possible that this patch might do the trick. There's certainly a bug in GDB in this code, which this patch hopefully fixes; I could imagine how that test might tickle the code in question. David Carlton carlton@math.stanford.edu 2003-02-28 David Carlton * symtab.c (lookup_partial_symbol): Add linkage_name argument. (lookup_symbol_aux_psymtabs): Update call to lookup_partial_symbol. (lookup_transparent_type, find_main_psymtab) (make_symbol_overload_list): Ditto. Index: symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.96 diff -u -p -r1.96 symtab.c --- symtab.c 27 Feb 2003 20:48:03 -0000 1.96 +++ symtab.c 28 Feb 2003 22:58:15 -0000 @@ -76,6 +76,7 @@ static int find_line_common (struct line char *operator_chars (char *p, char **end); static struct partial_symbol *lookup_partial_symbol (struct partial_symtab *, + const char *, const char *, int, namespace_enum); @@ -1201,7 +1202,8 @@ lookup_symbol_aux_psymtabs (int block_in ALL_PSYMTABS (objfile, ps) { if (!ps->readin - && lookup_partial_symbol (ps, name, psymtab_index, namespace)) + && lookup_partial_symbol (ps, name, mangled_name, + psymtab_index, namespace)) { s = PSYMTAB_TO_SYMTAB (ps); bv = BLOCKVECTOR (s); @@ -1371,7 +1373,8 @@ lookup_symbol_aux_minsyms (const char *n symbols if GLOBAL, the static symbols if not */ static struct partial_symbol * -lookup_partial_symbol (struct partial_symtab *pst, const char *name, int global, +lookup_partial_symbol (struct partial_symtab *pst, const char *name, + const char *linkage_name, int global, namespace_enum namespace) { struct partial_symbol *temp; @@ -1426,7 +1429,10 @@ lookup_partial_symbol (struct partial_sy /* djb - 2000-06-03 - Use SYMBOL_MATCHES_NAME, not a strcmp, so we don't have to force a linear search on C++. Probably holds true for JAVA as well, no way to check.*/ - while (top <= real_top && SYMBOL_MATCHES_NAME (*top,name)) + while (top <= real_top + && (linkage_name + ? (strcmp (SYMBOL_LINKAGE_NAME (*top), linkage_name) == 0) + : SYMBOL_MATCHES_NAME (*top,name))) { if (SYMBOL_NAMESPACE (*top) == namespace) { @@ -1445,7 +1451,9 @@ lookup_partial_symbol (struct partial_sy { if (namespace == SYMBOL_NAMESPACE (*psym)) { - if (SYMBOL_MATCHES_NAME (*psym, name)) + if (linkage_name + ? (strcmp (SYMBOL_LINKAGE_NAME (*psym), linkage_name) == 0) + : SYMBOL_MATCHES_NAME (*psym, name)) { return (*psym); } @@ -1492,7 +1500,8 @@ lookup_transparent_type (const char *nam ALL_PSYMTABS (objfile, ps) { - if (!ps->readin && lookup_partial_symbol (ps, name, 1, STRUCT_NAMESPACE)) + if (!ps->readin + && lookup_partial_symbol (ps, name, NULL, 1, STRUCT_NAMESPACE)) { s = PSYMTAB_TO_SYMTAB (ps); bv = BLOCKVECTOR (s); @@ -1539,7 +1548,8 @@ lookup_transparent_type (const char *nam ALL_PSYMTABS (objfile, ps) { - if (!ps->readin && lookup_partial_symbol (ps, name, 0, STRUCT_NAMESPACE)) + if (!ps->readin + && lookup_partial_symbol (ps, name, NULL, 0, STRUCT_NAMESPACE)) { s = PSYMTAB_TO_SYMTAB (ps); bv = BLOCKVECTOR (s); @@ -1580,7 +1590,7 @@ find_main_psymtab (void) ALL_PSYMTABS (objfile, pst) { - if (lookup_partial_symbol (pst, main_name (), 1, VAR_NAMESPACE)) + if (lookup_partial_symbol (pst, main_name (), NULL, 1, VAR_NAMESPACE)) { return (pst); } @@ -4026,8 +4036,10 @@ make_symbol_overload_list (struct symbol if (ps->readin) continue; - if ((lookup_partial_symbol (ps, oload_name, 1, VAR_NAMESPACE) != NULL) - || (lookup_partial_symbol (ps, oload_name, 0, VAR_NAMESPACE) != NULL)) + if ((lookup_partial_symbol (ps, oload_name, NULL, 1, VAR_NAMESPACE) + != NULL) + || (lookup_partial_symbol (ps, oload_name, NULL, 0, VAR_NAMESPACE) + != NULL)) PSYMTAB_TO_SYMTAB (ps); }