From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18479 invoked by alias); 16 Jan 2002 02:45:18 -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 18431 invoked from network); 16 Jan 2002 02:45:10 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 16 Jan 2002 02:45:10 -0000 Received: from drow by nevyn.them.org with local (Exim 3.33 #1 (Debian)) id 16Qg4g-0002oW-00; Tue, 15 Jan 2002 21:45:14 -0500 Date: Tue, 15 Jan 2002 18:45:00 -0000 From: Daniel Jacobowitz To: Jason Merrill , gdb-patches@sources.redhat.com Subject: Problem with your patch to is_type_conversion_operator Message-ID: <20020115214514.A14245@nevyn.them.org> Mail-Followup-To: Jason Merrill , gdb-patches@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.23i X-SW-Source: 2002-01/txt/msg00438.txt.bz2 This patch caused a few dozen regressions on the GCC 2.95.x/DWARF-2 combination. This is caused by the v2 vs. v3 use of DW_AT_name for operators. In v2 we get: DW_AT_name : operator = But in v3: DW_AT_name : operator= So in v3: 399 if (! strchr (" \t\f\n\r", *name)) 400 return 0; triggers for operator=. We never even go to look at what operator it is. But for v2 it doesn't, and name is '='. That doesn't look like new. That doesn't look like delete. It's not a type conversion operator! Not that there was anything wrong with your patch; it was papering over this potential bug (well, potential when that code was written). I've committed the patch below to fix it. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer 2002-01-15 Daniel Jacobowitz * c-typeprint.c (is_type_conversion_operator): Add additional check for non-conversion operators. Index: c-typeprint.c =================================================================== RCS file: /cvs/src/src/gdb/c-typeprint.c,v retrieving revision 1.14 diff -u -p -r1.14 c-typeprint.c --- c-typeprint.c 2002/01/10 00:06:02 1.14 +++ c-typeprint.c 2002/01/16 02:41:47 @@ -402,7 +402,13 @@ is_type_conversion_operator (struct type while (strchr (" \t\f\n\r", *name)) name++; - if (strncmp (name, "new", 3) == 0) + if (!('a' <= *name && *name <= 'z') + && !('A' <= *name && *name <= 'Z') + && *name != '_') + /* If this doesn't look like the start of an identifier, then it + isn't a type conversion operator. */ + return 0; + else if (strncmp (name, "new", 3) == 0) name += 3; else if (strncmp (name, "delete", 6) == 0) name += 6;