From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684951488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2/v7uyjLR7sYn5U0Z0QnXAw2LG4e/5OI3nNoe13Q7v8=; b=a3P4D470EKrSYMEu4u3oSLYVqqHISHrFzmGMehwa2/ocRDDuM/iXyytsjVkYPt/0zcBMh0 3X2t4zAMUyC9VfoK/x3Q1krve+5bbn/qO25VswHvgJXxjVtMlfZ3a1jwzHk8OFMpYvLqY6 YPv4ereW/h/kyElrG9HlKSIQQ3cS+tI= 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) From: Andrew Burgess 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-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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