Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Stephan Rohr <stephan.rohr@intel.com>
Cc: gdb-patches@sourceware.org,  tom@tromey.com,  guinevere@redhat.com
Subject: Re: [PATCH v3 1/1] gdb: fix assert after register write failure
Date: Mon, 09 Nov 2026 12:03:45 -0700	[thread overview]
Message-ID: <87y0b1u8ry.fsf@tromey.com> (raw)
In-Reply-To: <20261104130344.44218-2-stephan.rohr@intel.com> (Stephan Rohr's message of "Wed, 4 Nov 2026 13:03:44 +0000")

>>>>> Stephan Rohr <stephan.rohr@intel.com> writes:

> Fix this by catching the exception and only invalidating the regcache
> if the error is not a TARGET_CLOSE_ERROR.

I looked at fixing up the ravenscar code and this made me realize:

> +  catch (const gdb_exception_error &ex)
> +    {
> +      /* The write failed.  If the target is closed, the regcache is
> +	 destroyed and is not accessible.  */
> +      if (ex.error != TARGET_CLOSE_ERROR)
> +	invalidate (regnum);
> +      throw;

... here, I think this code should catch gdb_exception.

Normally catching gdb_exception_error is what you want, with the idea
being that a QUIT ought to propagate upward.

However, in this case, a QUIT would violate the invariant here, leaving
the register apparently valid.

And, since this code is re-throwing anyway, I think simply catching all
exceptions here would be correct.

What do you think?

thanks,
Tom

  parent reply	other threads:[~2026-11-09 19:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 13:03 [PATCH v3 0/1] " Stephan Rohr
2026-11-04 13:03 ` [PATCH v3 1/1] " Stephan Rohr
2026-11-06 19:01   ` Tom Tromey
2026-11-09 19:03   ` Tom Tromey [this message]
2026-11-06 19:06 ` [PATCH v3 0/1] " 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=87y0b1u8ry.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=guinevere@redhat.com \
    --cc=stephan.rohr@intel.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