Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mihail Zenkov <mihail.zenkov@gmail.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Mihail Zenkov <mihail.zenkov@gmail.com>,
	tromey@redhat.com,  gdb-patches@sourceware.org
Subject: Re: D language support
Date: Thu, 22 Apr 2010 00:11:00 -0000	[thread overview]
Message-ID: <20100422030910.7e84f7ea.mihai.zenkov@gmail.com> (raw)
In-Reply-To: <20100421155657.GA19194@adacore.com>

> > +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?

It not real global. As it static it visibility limited to current file. In this case we can 
think about this file as if it was C++ class. IMHO it more easy readable code - we
promptly see all function use same variables.

I see same code in many other places (c-exp.c:3823, c-exp.c:4192, c-exp.c:4609,
ada-lang.c:307, ada-exp.c:2769 and others).

> > +  if (gsymbol->language == language_d
> > +      || gsymbol->language == language_auto)
> > +    {
> > +      demangled =
> > +	d_demangle(mangled, 0);
> 
> Can you join the last two lines?

Current code:

  if (gsymbol->language == language_objc
      || gsymbol->language == language_auto)
    {
      demangled =
        objc_demangle (mangled, 0);
      if (demangled != NULL)
        {
          gsymbol->language = language_objc;
          return demangled;
        }
    }
  if (gsymbol->language == language_cplus
      || gsymbol->language == language_auto)
    {
      demangled =
        cplus_demangle (mangled, DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE);
      if (demangled != NULL)
        {
          gsymbol->language = language_cplus;
          return demangled;
        }
    }
  if (gsymbol->language == language_java)
    {
      demangled =
        cplus_demangle (mangled,
                        DMGL_PARAMS | DMGL_ANSI | DMGL_JAVA);

Still i should join it?


  reply	other threads:[~2010-04-22  0:11 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-23 23:57 Mihail Zenkov
2009-12-30 12:56 ` Joel Brobecker
2010-01-09  6:25   ` Mihail Zenkov
2010-01-09  6:29     ` Mihail Zenkov
2010-01-09 14:23       ` Joel Brobecker
2010-01-13  4:42         ` Mihail Zenkov
2010-01-15  5:10           ` Joel Brobecker
2010-01-15 21:02             ` Tom Tromey
2010-01-15 21:05           ` Tom Tromey
2010-04-14 22:22             ` Mihail Zenkov
2010-04-20 21:39               ` Tom Tromey
2010-04-21  0:01                 ` Mihail Zenkov
2010-04-21 15:57                   ` Joel Brobecker
2010-04-22  0:11                     ` Mihail Zenkov [this message]
2010-04-22  0:44                       ` Joel Brobecker
2010-04-22  1:53                         ` Mihail Zenkov
2010-04-23 18:11                           ` Tom Tromey
2010-04-24  0:06                             ` Mihail Zenkov
2010-04-27 16:05                               ` Joel Brobecker
2010-04-27 23:55                                 ` Mihail Zenkov
2010-04-28 15:17                                   ` Joel Brobecker
2010-04-28 17:11                                     ` Eli Zaretskii
2010-04-29  2:16                                     ` Mihail Zenkov
2010-04-28 17:10                                   ` Eli Zaretskii
2010-04-29  1:59                                     ` Mihail Zenkov
2010-04-29  3:10                                       ` Eli Zaretskii
2010-04-29 14:47                                       ` Joel Brobecker
2010-04-23 18:09                         ` Tom Tromey
2010-04-23 20:15                           ` Leandro Lucarella
2010-04-23 20:37                             ` Tom Tromey
2010-04-26 23:51                               ` Stan Shebs
2010-04-27  0:29                                 ` Joel Brobecker
2010-04-23 21:35               ` Robert Clipsham
2010-04-24  0:26                 ` Mihail Zenkov
2010-04-27 20:27                   ` Robert Clipsham
  -- strict thread matches above, loose matches on Subject: below --
2009-08-17 23:02 Mihail Zenkov
2009-08-18  4:18 ` Eli Zaretskii
2009-08-18 16:39 ` Tom Tromey
     [not found]   ` <20090818225844.GA9879@homero.springfield.home>
2009-08-19 18:36     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100422030910.7e84f7ea.mihai.zenkov@gmail.com \
    --to=mihail.zenkov@gmail.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox