From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 9ypIFboACGdZyAgAWB0awg (envelope-from ) for ; Thu, 10 Oct 2024 12:28:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1728577722; bh=4K7moXsvMdk5HSyt+zwSQukSLE0GnI0e5kgRgCAPnts=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=oAOikdaReFlb61AGs9BRtZ5kJHSeMngaXfMkOdMI8IKlmkCgZV2cyYLNU4yhquWwf qRQ3p9zfwsMmMJJWzbimo4lJniqWInyKz8b0I4L60o/nZGACRt26Cvyi3UqPG/f7np jJF0ns80Ljm+O8EPJYMRQf4haeo3r384eem1zmLU= Received: by simark.ca (Postfix, from userid 112) id 3E3021E357; Thu, 10 Oct 2024 12:28:42 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS autolearn=unavailable autolearn_force=no version=4.0.0 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=jocMmtN/; dkim=pass (1024-bit key) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=jCpjYlhv; dkim-atps=neutral Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id CC1061E05C for ; Thu, 10 Oct 2024 12:28:41 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 789953857BB9 for ; Thu, 10 Oct 2024 16:28:41 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 6B6093857BB9 for ; Thu, 10 Oct 2024 16:28:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6B6093857BB9 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6B6093857BB9 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728577703; cv=none; b=pj9NElKg+ItPRWS6lQFAYvY6b9wH7GyGIA68xdKjJl4t3tNnnuths3IQw6muGv4bvD7oG3rdiupEXWtaacf43cCTIApt+oO4CddzujS0FV0uACCaDxN5EuRLQzXGv8+pGD2HYKZCh/KeU7Bzvx5U3w9YQqZx0hH8T+n5e29DJI4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728577703; c=relaxed/simple; bh=4K7moXsvMdk5HSyt+zwSQukSLE0GnI0e5kgRgCAPnts=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version: Subject:To:From; b=JJLxLiXkbNBpgLeBMqjGLS1/lRc3wSoFyWFfAz14zCQdZc5HpEWOQPjXxAFJuZbCoreloMn+VodaJCgD6TKf4D9aO9ZnDz4D1wkWtrIvIGXRBWQBS9P3sxhdIH72s1zc6EP7Cldr6Ub1RNUPULxjGy2DoORTR+otW14KS2jRI+0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1728577701; bh=4K7moXsvMdk5HSyt+zwSQukSLE0GnI0e5kgRgCAPnts=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jocMmtN/WSWc+2YStb0STxI0duVWryhIn5zNcfAK2zONBRHPd0qGnHj3Qx4XP9QEh gA/Q/+va0ktpIHddBNoQpRFzdJeuKqc0WwNHmt7lxNE8vmT3iFgSb0e2LXKBWhdv6J XkIAvRXC++nESIv0UUet2c8cXWFMD8knOGB7mp74= Received: by simark.ca (Postfix, from userid 112) id DC9431E357; Thu, 10 Oct 2024 12:28:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1728577700; bh=4K7moXsvMdk5HSyt+zwSQukSLE0GnI0e5kgRgCAPnts=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jCpjYlhvj9jzdq+QRSJsiPjc5bl3FLnMcN68kdynmgefGWitAEDVIsjt7mnNEYGW+ PqmJfZEp2yV3JGGIziAKrfVX+fDRmcY8b8VrHQteKMh0YkfB/QjAqatYWpkqhcPXT9 ZitGCN0U34BXGF8NXZ5TB1MjQEpnI/sBV8UJdAPI= Received: from [10.0.0.11] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 6419C1E05C; Thu, 10 Oct 2024 12:28:20 -0400 (EDT) Message-ID: <11a7fe7d-472a-4cb3-81da-81b27a46744f@simark.ca> Date: Thu, 10 Oct 2024 12:28:20 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 3/5] gdb: Migrate frame unwinders to use C++ classes To: Guinevere Larsen , gdb-patches@sourceware.org Cc: Guinevere Larsen References: <20241001184235.3710608-1-guinevere@redhat.com> <20241001184235.3710608-4-guinevere@redhat.com> Content-Language: en-US From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 2024-10-10 10:10, Guinevere Larsen wrote: > On 10/4/24 2:21 AM, Simon Marchi wrote: >> Some more things I thought about... >> >>>> + /* Default frame sniffer. Will always return that the unwinder >>>> + is able to unwind the frame. */ >>>> + virtual int sniffer (const frame_unwind *self, >> One nit: I think this method should be called just "sniff". When a >> method is named after a thing, my brain adds an implicit "get_" in front >> of it. So to me, a method named "sniffer" would return some sniffer >> object. Here, I think it would make more sense to use an action verb, >> because we want the unwinder to "sniff". > This makes sense, and is a pretty trivial change. Fixed. >> >> Oh and I guess another naming nit, I think frame_unwind should be named >> frame_unwinder. A "thing" that unwinds stuff would be called an >> "unwinder", not an "unwind". I don't know how you feel about changing >> that. > > This is a reasonably big change, because several functions receive frame_unwind as a parameter. I would expect it to be almost a 3 click change in any reasonably smart IDE :). > If we progress conversion from the legacy to the specific classes we're going to reduce the number of function that get it as a parameter and it will turn into a smaller, more manageable patch. I think makes sense for future improvement. Ack. >> And something else I just remembered, I am not really a fan of the >> very abbreviated parameter names like this: >> >> frame_unwind_trampoline (enum frame_type t, const struct frame_data *d, >> frame_prev_arch_ftype *pa) >> : frame_unwind ("trampoline", t, FRAME_UNWIND_GDB, d), prev_arch_p (pa) >> { } >> >> When using an editor that provides tooltips when writing a function >> call, the abbreviated names in the tooltip are not very helpful. I >> would suggest using proper names. > This makes sense. I really dislike having a function named the same as a type, but I will use "type", "data" and "prev_arch_func". Sounds good. Simon