public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Simon Marchi <simon.marchi@efficios.com>,
	Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdbsupport: add support for references to checked_static_cast
Date: Wed, 24 May 2023 19:04:41 +0100	[thread overview]
Message-ID: <87o7m961xi.fsf@redhat.com> (raw)
In-Reply-To: <d509b5b1-ad93-82c2-77de-3bee29fe5059@efficios.com>

Simon Marchi <simon.marchi@efficios.com> writes:

> On 5/24/23 09:07, Andrew Burgess wrote:
>> Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
>> 
>>> Add a checked_static_cast overload that works with references.  A bad
>>> dynamic cast with references throws std::bad_cast, it would be possible
>>> to implement the new overload based on that, but it seemed simpler to
>>> just piggy back off the existing function.
>>>
>>> I found some potential uses of this new overload in amd-dbgapi-target.c,
>>> update them to illustrate the use of the new overload.  To build
>>> amd-dbgapi-target.c, on needs the amd-dbgapi library, which I don't
>>> expect many people to have.  But I have it, and it builds fine here.  I
>>> did test the new overload by making a purposely bad cast and it did
>>> catch it.
>> 
>> Looks great.  Thanks for expanding this feature.
>> 
>> Reviewed-By: Andrew Burgess <aburgess@redhat.com>
>
> Thanks.  Are you also fine with the switch to use
> gdb::Requires<std::is_reference<T> to do the "target is reference"
> check, as Lancelot suggested?

Yes, that looks good too.

Thanks,
Andrew


  reply	other threads:[~2023-05-24 18:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18 20:57 Simon Marchi
2023-05-19 21:31 ` Kevin Buettner
2023-05-23 12:03   ` Simon Marchi
2023-05-24 13:07 ` Andrew Burgess
2023-05-24 14:51   ` Simon Marchi
2023-05-24 18:04     ` Andrew Burgess [this message]
2023-05-24 18:54       ` Simon Marchi
2023-05-24 13:22 ` Lancelot SIX
2023-05-24 14:51   ` Simon Marchi
2023-05-24 15:33     ` Lancelot SIX
2023-05-24 15:44       ` Simon Marchi

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=87o7m961xi.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).