This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA]: Make class_name_from_physname part of language vector


On Fri, May 14, 2004 at 07:37:31PM -0400, Jeff Johnston wrote:
> Index: jv-lang.c

> +  /* P now points at the `)' at the end of the argument list.  Walk
> +     back to the beginning.  */
> +  p--;
> +  depth = 1;
> +  while (p > name && depth > 0)
> +    {
> +      if (*p == '<' || *p == '(')
> +	depth--;
> +      else if (*p == '>' || *p == ')')
> +	depth++;
> +      p--;
> +    }
> +
> +  if (p == name)
> +    return NULL;
> +
> +  while (p > name && *p != '.')
> +    p--;

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.

-- 
Daniel Jacobowitz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]