From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18339 invoked by alias); 19 Apr 2002 21:28:47 -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 18154 invoked from network); 19 Apr 2002 21:28:45 -0000 Received: from unknown (HELO mail-out1.apple.com) (17.254.0.52) by sources.redhat.com with SMTP; 19 Apr 2002 21:28:45 -0000 Received: from mailgate1.apple.com (A17-128-100-225.apple.com [17.128.100.225]) by mail-out1.apple.com (8.11.3/8.11.3) with ESMTP id g3JLSit18430 for ; Fri, 19 Apr 2002 14:28:44 -0700 (PDT) Received: from scv1.apple.com (scv1.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.2.1) with ESMTP id for ; Fri, 19 Apr 2002 14:28:17 -0700 Received: from inghji (inghji.apple.com [17.202.40.220]) by scv1.apple.com (8.11.3/8.11.3) with ESMTP id g3JLSis01161 for ; Fri, 19 Apr 2002 14:28:44 -0700 (PDT) Date: Fri, 19 Apr 2002 14:28:00 -0000 Mime-Version: 1.0 (Apple Message framework v481) Content-Type: text/plain; charset=US-ASCII; format=flowed Subject: Obvious fix in values.c? From: Jim Ingham To: gdb-patches@sources.redhat.com Content-Transfer-Encoding: 7bit Message-Id: <6D0E546A-53DC-11D6-8B7C-00039379E320@apple.com> X-SW-Source: 2002-04/txt/msg00638.txt.bz2 Do folks agree that this falls under the obvious fix rule? It doesn't seem safe to assume that all demangled names will contain a space (and in fact, gdb crashed on someone when the assumption was proved false...). 2002-04-19 Jim Ingham * values.c (value_headof): Don't assume all demangled names contain a space. Index: values.c =================================================================== RCS file: /cvs/src/src/gdb/values.c,v retrieving revision 1.34 diff -p -r1.34 values.c *** values.c 29 Jan 2002 03:08:26 -0000 1.34 --- values.c 19 Apr 2002 21:24:45 -0000 *************** value_headof (struct value *in_arg, stru *** 1043,1048 **** --- 1043,1049 ---- struct symbol *sym; char *demangled_name; struct minimal_symbol *msymbol; + char *tmp; btype = TYPE_VPTR_BASETYPE (dtype); CHECK_TYPEDEF (btype); *************** value_headof (struct value *in_arg, stru *** 1080,1086 **** return in_arg; } demangled_name = cplus_demangle(demangled_name,DMGL_ANSI); ! *(strchr (demangled_name, ' ')) = '\0'; sym = lookup_symbol (demangled_name, 0, VAR_NAMESPACE, 0, 0); if (sym == NULL) --- 1081,1089 ---- return in_arg; } demangled_name = cplus_demangle(demangled_name,DMGL_ANSI); ! tmp = strchr (demangled_name, ' '); ! if (tmp) ! *tmp = '\0'; sym = lookup_symbol (demangled_name, 0, VAR_NAMESPACE, 0, 0); if (sym == NULL) -- Jim Ingham jingham@apple.com Developer Tools - gdb Apple Computer