From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12370 invoked by alias); 5 Jul 2004 21:50:46 -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 12362 invoked from network); 5 Jul 2004 21:50:45 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 5 Jul 2004 21:50:45 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1BhbM5-0002IQ-78; Mon, 05 Jul 2004 17:50:29 -0400 Date: Mon, 05 Jul 2004 21:50:00 -0000 From: Daniel Jacobowitz To: Jeff Johnston Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA]: Make class_name_from_physname part of language vector Message-ID: <20040705215028.GA8372@nevyn.them.org> Mail-Followup-To: Jeff Johnston , gdb-patches@sources.redhat.com References: <40E9B840.8040102@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40E9B840.8040102@redhat.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-07/txt/msg00035.txt.bz2 On Mon, Jul 05, 2004 at 04:21:20PM -0400, Jeff Johnston wrote: > >You've left in a lot of hokery from the C++ support which I'm > >reasonably confident Java does not need. I don't believe that Java > >mangled names will ever have templates, or classes nested inside of > >functions, or multiple argument lists - no depth at all. Also, I'd > >appreciate it if you called it something other than > >find_last_component; the C++ version shouldn't have such a generic name > >either, IMO. > > > >Otherwise this looks fine. > I have made the changes you recommended. The function now only looks for > the opening parenthesis. I renamed it to "find_member_function_name" as > well. Sorry I wasn't clear - I was hoping for something that said it was for Java. Maybe java_find_last_component? Also: > +/* Find the member function name of the demangled name NAME. NAME > + must be a method name including arguments, in order to correctly > + locate the last component. > + > + This function return a pointer to the first dot before the > + member function name, or NULL if the name was not of the > + expected form. */ > + > +static const char * > +find_member_function_name (const char *name) > +{ > + const char *p; > + int depth; DEPTH is now write-only. > + > + /* Functions can have local classes, so we need to find the > + beginning of the last argument list, not the end of the first > + one. */ > + p = name + strlen (name) - 1; > + while (p > name && *p != ')') > + p--; Is this true for Java? I don't think it is. If it isn't, you can just search forward for the first '(' (and use strchr, even - I'm not sure why the old code doesn't use strrchr). -- Daniel Jacobowitz