This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: D language support
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Mihail Zenkov <mihail dot zenkov at gmail dot com>
- Cc: tromey at redhat dot com, gdb-patches at sourceware dot org
- Date: Wed, 21 Apr 2010 11:56:57 -0400
- Subject: Re: D language support
- References: <20091224015617.7092112b.mihai.zenkov@gmail.com> <20091230125539.GF2788@adacore.com> <20100109082524.263bcb17.mihai.zenkov@gmail.com> <20100109082830.dd984de8.mihai.zenkov@gmail.com> <20100109142327.GC2007@adacore.com> <20100113064026.14f75ff2.mihai.zenkov@gmail.com> <m3ljfzaxlk.fsf@fleche.redhat.com> <20100415012124.91ce1769.mihai.zenkov@gmail.com> <m34oj5g5x6.fsf@fleche.redhat.com> <20100421025919.ad3a0830.mihai.zenkov@gmail.com>
> gdb/ChangeLog:
> D language support.
> * Makefile.in (SFILES): Add d-lang.c d-valprint.c.
> (COMMON_OBS): Add d-lang.o d-valprint.o.
> (HFILES_NO_SRCDIR): Add d-lang.h.
> * c-lang.c (c_emit_char, exp_descriptor_c): Make public.
> * c-lang.h (c_emit_char, exp_descriptor_c): Add declaration.
> * d-lang.c: New file.
> * d-lang.h: New file.
> * d-valprint.c: New file.
> * defs.h (enum language): Add language_d.
> * dwarf2read.c (set_cu_language): Add DW_LANG_D.
> * language.c (binop_result_type, integral_type, character_type)
> (string_type, boolean_type, structured_type): Add language_d.
> * symfile.c (init_filename_language_table): Add language_d.
> * symtab.c: Include d-lang.h.
> (symbol_init_language_specific, symbol_find_demangled_name)
> (symbol_natural_name, lookup_symbol_in_language)
> (symbol_demangled_name, symbol_matches_domain): Add language_d.
> gdb/doc/ChangeLog:
> * gdb.texinfo: Add mention about D language support.
> gdb/testsuite/ChangeLog:
> * gdb.base/default.exp: Fix "set language" test.
Overall, looks good to me, but I have a question on a couple of globals
and a few last formatting nits. We will also need to add an entry in
the NEWS file, but that can be done separately.
> +extern void c_emit_char (int c, struct type *type, struct ui_file *stream, int quoter);
This line exceeds the 78 characters limit - can you split it in two?
> +static const char *mangled_str;
I think this part needs to be rethinked, or at least I don't understand
why this needs to be a global. Can you elaborate?
Similarly, I do not understand why ...
> +/* Temporary obstack used for holding strings. */
> +static struct obstack tempbuf;
... needs to be a global?
I will not necessarily object to the code being checked in as is;
this is, after all, an implementation detail local to this language,
but if we can look at this, and fix it if applicable, let's do it now.
> + if (gsymbol->language == language_d
> + || gsymbol->language == language_auto)
> + {
> + demangled =
> + d_demangle(mangled, 0);
Can you join the last two lines?
--
Joel