Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] inadvertent language switch during breakpoint_re_set_one
Date: Thu, 10 May 2018 18:58:00 -0000	[thread overview]
Message-ID: <87sh6zxsu6.fsf@redhat.com> (raw)
In-Reply-To: <1525976353-67414-1-git-send-email-brobecker@adacore.com> (Joel	Brobecker's message of "Thu, 10 May 2018 14:19:13 -0400")

On Thursday, May 10 2018, Joel Brobecker wrote:

> Hello,

Hey Joel,

[...]
> diff --git a/gdb/language.h b/gdb/language.h
> index 029de4a..3e2b90a 100644
> --- a/gdb/language.h
> +++ b/gdb/language.h
> @@ -705,4 +705,30 @@ private:
>    enum language m_lang;
>  };
>  
> +/* Save the current language mode and restore it upon destruction.  */
> +
> +class scoped_restore_current_language_mode
> +{
> +public:
> +
> +  explicit scoped_restore_current_language_mode ()
> +    : m_lang_mode (language_mode)
> +  {
> +  }
> +
> +  ~scoped_restore_current_language_mode ()
> +  {
> +    language_mode = m_lang_mode;
> +  }
> +
> +  scoped_restore_current_language_mode
> +      (const scoped_restore_current_language_mode &) = delete;
> +  scoped_restore_current_language_mode &operator=
> +      (const scoped_restore_current_language_mode &) = delete;

I think you can use DISABLE_COPY_AND_ASSIGN here.

Cheers,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/


  reply	other threads:[~2018-05-10 18:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10 18:42 Joel Brobecker
2018-05-10 18:58 ` Sergio Durigan Junior [this message]
2018-05-10 19:26   ` Joel Brobecker
2018-05-10 19:08 ` Keith Seitz
2018-05-10 19:21   ` Joel Brobecker
2018-05-10 19:35     ` Keith Seitz
2018-05-10 19:29 ` Tom Tromey
2018-05-10 20:59   ` Joel Brobecker
2018-05-31  0:02     ` Joel Brobecker
2018-06-01 12:42     ` Pedro Alves
2018-06-01 16:39       ` Joel Brobecker

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=87sh6zxsu6.fsf@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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