public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: Andrew Burgess <aburgess@redhat.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 14:54:35 -0400	[thread overview]
Message-ID: <018b222d-960e-f871-599b-512cce845717@efficios.com> (raw)
In-Reply-To: <87o7m961xi.fsf@redhat.com>

On 5/24/23 14:04, Andrew Burgess wrote:
> 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, pushed.

Simon

  reply	other threads:[~2023-05-24 18:54 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
2023-05-24 18:54       ` Simon Marchi [this message]
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=018b222d-960e-f871-599b-512cce845717@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=aburgess@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).