From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id LObVMdpRbmRc+xIAWB0awg (envelope-from ) for ; Wed, 24 May 2023 14:05:14 -0400 Received: by simark.ca (Postfix, from userid 112) id B92841E11E; Wed, 24 May 2023 14:05:14 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=otwtukJQ; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6220A1E0D4 for ; Wed, 24 May 2023 14:05:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C16A7385843E for ; Wed, 24 May 2023 18:05:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C16A7385843E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684951512; bh=2/v7uyjLR7sYn5U0Z0QnXAw2LG4e/5OI3nNoe13Q7v8=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=otwtukJQnEX/MU8l4DmyssV1O80n4PBRmMDLgAMWxbWWgX7HnTPSXdfCpEmJb9LdU mIAYZ9YNhb4CBV8GjHnroHXBhkkoARFhwvG9g41+83GWi6jWvdAQvCRndhronWfKYi zgZtgp3uGQYCcs8kzgv803+ALejIStdfE2QEJ19c= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 871323858D28 for ; Wed, 24 May 2023 18:04:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 871323858D28 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-21-8KcS1hTOPNKikEGU7jz2Qg-1; Wed, 24 May 2023 14:04:45 -0400 X-MC-Unique: 8KcS1hTOPNKikEGU7jz2Qg-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3f60a4470cdso5339065e9.2 for ; Wed, 24 May 2023 11:04:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684951484; x=1687543484; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2/v7uyjLR7sYn5U0Z0QnXAw2LG4e/5OI3nNoe13Q7v8=; b=VpxT5BTi6WMg0PuYMXuTAkGCbLaEsQAOfG/me2CWwf+DB5WH6gMzyHP0aqNKFzeHS5 vMQ2hGK3J7DptUNLxG3ioPS+MEYXh6vxTK0ejqiQpAIOyCB6Xk4x1jhM+f/cvHmFU+iy 7DA14LmIkrmPcxssvFhcVgi3GfdnNKMJgVbWPyv0M0W8dBkhxITgV5jOrMIjiyN0zaBG oU52fSK/5mzxVpAQ2JB5V7EfbFNaQgCTr25O1kgjSZ/T+RjNd79bskQeRc1mlQ+FIj2g HdXbxzic1RPywxTWcuWHyUIqeVo3J7yjVnzKiGtgkJuDbXtju5vq1qzpM75DPl7evGgb FGuA== X-Gm-Message-State: AC+VfDzTQpkSqk6/Pn3algRw+0E1SCN3+kZeFaez59Z0stUewYFbVcd4 HhiLKrYUG+/djV7JgVPrCJBMfRsYHHLB+lP1uZcvWCrsuWddvadfo8jGQHq9VHkJJiZe3xqVXtd x2kKBhLEaQqG1jOKvAPVApC3lMWtvgg== X-Received: by 2002:a05:600c:c6:b0:3f4:2973:b8c8 with SMTP id u6-20020a05600c00c600b003f42973b8c8mr435008wmm.26.1684951484129; Wed, 24 May 2023 11:04:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Xstm3Tl3XyFsB+Isu40Wlj47SlSURaWFE/eBeCnGLPRPhFSMXRgWV7WA8CrQb2NKxh1zXaQ== X-Received: by 2002:a05:600c:c6:b0:3f4:2973:b8c8 with SMTP id u6-20020a05600c00c600b003f42973b8c8mr435000wmm.26.1684951483851; Wed, 24 May 2023 11:04:43 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id f8-20020a1c6a08000000b003f41bb52834sm3102008wmc.38.2023.05.24.11.04.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 11:04:43 -0700 (PDT) To: Simon Marchi , Simon Marchi via Gdb-patches Subject: Re: [PATCH] gdbsupport: add support for references to checked_static_cast In-Reply-To: References: <20230518205737.403656-1-simon.marchi@efficios.com> <878rdd7u9p.fsf@redhat.com> Date: Wed, 24 May 2023 19:04:41 +0100 Message-ID: <87o7m961xi.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Simon Marchi writes: > On 5/24/23 09:07, Andrew Burgess wrote: >> Simon Marchi via Gdb-patches 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 > > Thanks. Are you also fine with the switch to use > gdb::Requires to do the "target is reference" > check, as Lancelot suggested? Yes, that looks good too. Thanks, Andrew