Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: "'Pedro Alves'" <palves@redhat.com>,	"'Tom Tromey'" <tom@tromey.com>
Cc: <gdb-patches@sourceware.org>
Subject: RE: [RFA 3/5] Use std::string, std::vector in rust-lang.c
Date: Thu, 22 Sep 2016 20:37:00 -0000	[thread overview]
Message-ID: <000f01d21508$755322b0$5ff96810$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <1b62c1c7-31ec-38c7-e4b4-25fdc560388c@redhat.com>



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pedro Alves
> Envoyé : jeudi 22 septembre 2016 21:25
> À : Tom Tromey
> Cc : gdb-patches@sourceware.org
> Objet : Re: [RFA 3/5] Use std::string, std::vector in rust-lang.c
> 
> On 09/22/2016 08:15 PM, Tom Tromey wrote:
> >>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
> >
> > Pedro> So I think we should move the variable declaration to the
> > Pedro> initialization line, to avoid default constructing the
> variable
> > Pedro> and then resetting it afterwards, as the compiler may
> > Pedro> not be smart enough to elide that.
> >
> > I think so too -- I had avoided this on account of earlier objections
> to
> > this style.
> 
> In C, it'd require C99, while we were C89.  Other than that,
> it was just a coding convention.
> 
> But we now have technical reasons for not putting variables
> at top of the scope.  There's the efficiency reason, and then
> some types may not even have a default constructor, and the
> arguments that'd need to be passed to the constructor
> might not have been computed at the top of the scope, making
> it impossible to declare the variable at the top, unless we'd
> open an ugly new scope...

  Just out of curiosity:
how are such variables treated by gcc regarding debug information?

  What is the scope of definition of those variables?
And is it correctly handled by current GDB?

  IIRC (but my knowledge about C++ if far
worse than for plain C.. which itself I only learned to be able to
contribute to GDB...) the reason why we can remove the cleanups is
that the compiler will insert auto--magically
the destructors of those local variables at the end of
their respective scope, is this correct? 
 
> So I think there's no ground for objection.

  Not that I want to raise an objection,
I just wonder if debugging GDB by itself will remain as easy as it was!

Pierre Muller
pascal language support maintainer...


  reply	other threads:[~2016-09-22 19:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22 17:51 [RFA 0/5] Some random C++-ification Tom Tromey
2016-09-22 17:51 ` [RFA 1/5] Use std::string in break-catch-sig.c Tom Tromey
2016-09-23 13:17   ` Yao Qi
2016-09-22 17:51 ` [RFA 3/5] Use std::string, std::vector in rust-lang.c Tom Tromey
2016-09-22 19:03   ` Pedro Alves
2016-09-22 19:24     ` Tom Tromey
2016-09-22 19:35       ` Pedro Alves
2016-09-22 20:37         ` Pierre Muller [this message]
     [not found]         ` <57e4328a.c3c4620a.59d5b.803fSMTPIN_ADDED_BROKEN@mx.google.com>
2016-09-23  9:44           ` Pedro Alves
2016-09-23 15:56             ` Tom Tromey
2016-09-23 16:15               ` Pedro Alves
2016-09-22 17:51 ` [RFA 4/5] Use std::vector in objfiles.c Tom Tromey
2016-09-22 17:51 ` [RFA 2/5] Use std::string in cp-namespace.c Tom Tromey
2016-09-22 19:08   ` Pedro Alves
2016-09-22 20:56     ` Tom Tromey
2016-09-22 19:03 ` [RFA 5/5] Use std::string rather than dyn-string Tom Tromey
2016-09-22 19:10 ` [RFA 0/5] Some random C++-ification Pedro Alves
2016-09-22 19:15   ` Pedro Alves
2016-09-22 23:10   ` Trevor Saunders
2016-09-23 15:47   ` Tom Tromey
2016-09-23 15:49     ` Pedro Alves

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='000f01d21508$755322b0$5ff96810$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=tom@tromey.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