This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Compile objc-lang.c, objc-exp.tab.c [1/5]
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Andrew Cagney <ac131313 at redhat dot com>
- Cc: Adam Fedor <fedor at doc dot com>,GDB Patches <gdb-patches at sources dot redhat dot com>
- Date: Thu, 20 Mar 2003 16:39:45 -0500
- Subject: Re: [RFA] Compile objc-lang.c, objc-exp.tab.c [1/5]
- References: <3E16093D.3070907@doc.com> <3E7A3226.9040904@redhat.com>
Not without some substantial thought. We use cplus_demangle in a lot
of places where we don't even know what the language is supposed to be
- for minsyms, during lookups, et cetera.
Certainly it needs to be thought about. At least objc's mangling is
probably not entirely ambiguous with C++/Java's? I don't know.
On Thu, Mar 20, 2003 at 04:27:02PM -0500, Andrew Cagney wrote:
> Daniel,
>
> Would it be possible to make the cplus_demangle() method part of the
> language vector? That way code like the patch below could be reduced to:
>
> /* Return demangled language symbol, or NULL. */
> language_demangle (current_language, arg);
>
> This would in turn allow Adam to just add an equivalent objc_demangle()
> method to the objc language vector, and hence eliminate the need to
> always link in objc-lang.c.
>
> Andrew
>
> >RCS file: /cvs/src/src/gdb/maint.c,v
> >retrieving revision 1.30
> >diff -u -p -r1.30 maint.c
> >--- maint.c 24 Dec 2002 03:57:58 -0000 1.30
> >+++ maint.c 3 Jan 2003 03:06:25 -0000
> >@@ -35,6 +35,7 @@
> > #include "symfile.h"
> > #include "objfiles.h"
> > #include "value.h"
> >+#include "objc-lang.h"
> >
> > #include "cli/cli-decode.h"
> >
> >@@ -154,9 +155,8 @@ maintenance_demangle (char *args, int fr
> > switch (current_language->la_language)
> > {
> > case language_objc:
> >- /* Commented out until ObjC handling is enabled. */
> >- /* demangled = objc_demangle (args); */
> >- /* break; */
> >+ demangled = objc_demangle (args);
> >+ break;
> > case language_cplus:
> > default:
> > demangled = cplus_demangle (args, DMGL_ANSI | DMGL_PARAMS);
>
>
>
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer