Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: tromey@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: PR 7536 - ``set input-radix 1'' changes radix
Date: Mon, 29 Dec 2008 19:31:00 -0000	[thread overview]
Message-ID: <200812291930.26980.pedro@codesourcery.com> (raw)
In-Reply-To: <m3r63qztii.fsf@fleche.redhat.com>

On Monday 29 December 2008 19:11:17, Tom Tromey wrote:

> I also looked at this bug a little, and I was wondering whether we
> should fix this generically, for all parameters, by saving the
> parameter's value and then restoring it if the setter function raises
> an error.  What do you think of that?

That's actually something that crosses my mind everytime I
touch these set/validate functions.

There are a couple of corner/tricky case that you would have to consider
like QUIT (pagination makes that easy-ish to trigger), and the fact that
it can happen before or after the setter having already done
side effects; or, an error not meaning the setting didn't take effect.
A codebase audit would probably be required to make sure side effects
are unwound correctly, but it's probably doable.  Another option would
be to pass to the setter the new alreayd parsed value, and let it validate
and set the final variable itself --- the setter code always knows what
it it setting.  The issue is that you either pass a variant, or have
a different setter function type for each type of variable.

-- 
Pedro Alves


  reply	other threads:[~2008-12-29 19:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-29  2:21 Pedro Alves
2008-12-29 19:14 ` Tom Tromey
2008-12-29 19:31   ` Pedro Alves [this message]
2008-12-30  8:27   ` 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=200812291930.26980.pedro@codesourcery.com \
    --to=pedro@codesourcery.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