From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id y9FCLKGjBmdyjgcAWB0awg (envelope-from ) for ; Wed, 09 Oct 2024 11:39:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1728488353; bh=CKHOQnAGOuyDXlo18CWEjZQ96BUPBl6YUiDzAh9OEOs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=wsZ+7QSHHUfox+vTeJTyM7WieT0/68cuOG/byIbU2TCLFcAzQwe/WeGDRU9E7aYjR hTn65Z+Z+K1VNkqrY2BdzbvXplYkL03htO5tVDC/E3F7iQ73ZWDJNDIZrp32uCX4eq 7HEE5Q95BXU40/DoyXThCRX9Ts6PEbzxSwobTm0I= Received: by simark.ca (Postfix, from userid 112) id 82D301E356; Wed, 9 Oct 2024 11:39:13 -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=GvBkPPEY; dkim=pass (1024-bit key) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=uaV+ZdAa; 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 9FA0B1E05C for ; Wed, 9 Oct 2024 11:39:10 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CB1D5385E45A for ; Wed, 9 Oct 2024 15:39:09 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 5DA4F385DDD7 for ; Wed, 9 Oct 2024 15:38:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5DA4F385DDD7 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 5DA4F385DDD7 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=1728488332; cv=none; b=jsKrsfKatagsekQKdtI78vNp7q4lbPDFtCYxZU5wp/gD3gIu9sWcm33/0lubVnjrcCPgEYG5b5YygpAdyRJD991g+KtmVJUjl4ILqHhh27qNLM0itZV5S0COuqOfapdC5SVPn7bHn7xMAyjKJiVj2E1IK6eW12bc/fU4rrUMAzk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728488332; c=relaxed/simple; bh=CKHOQnAGOuyDXlo18CWEjZQ96BUPBl6YUiDzAh9OEOs=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version: Subject:To:From; b=AEM9V2ZZEWV/H+qPkGE5xiX7Mp2AnhjCIoxcGWovT+RAbiZ/PQqcoVTEjBdo4jDjdosjRNCcPSOUR7Ymq/zymyXqlADGxjRITqw5LTEYTFUrz8a8j9+m2MtZ9z7OdKVgLo0yIW1jG/egakZKLioW5Y8dRtKYk0jAd1lWi5oSfk8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1728488329; bh=CKHOQnAGOuyDXlo18CWEjZQ96BUPBl6YUiDzAh9OEOs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=GvBkPPEYEiIc5P8vR7Ugdnu4Jx3vGU1y1Qk2zhKyKXUxS3+Siwq7U4UZUeswzvQiV HCPYkHbClH001SOfJ1/AKP5kESK9lvqC41bLDlGtmon3ZgFBkwnZW9ALXqk8m9Y2uF 85RHWDOwY+AahadfQa84EeRC0jX/2tBybA0OCxfg= Received: by simark.ca (Postfix, from userid 112) id 9809F1E356; Wed, 9 Oct 2024 11:38:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1728488328; bh=CKHOQnAGOuyDXlo18CWEjZQ96BUPBl6YUiDzAh9OEOs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=uaV+ZdAaHUgd3M/3yQKf7pLcRZ1BX+nCs/DE5VsSkQIPzuN40cTFCU3IScuy3PPOT aaMxWyhdT3IlfAhqr0iTEjHYcRhCDyWKKmWCYwpvli+RAF68enqQDyq9/nOFkJdSyS Pv/k3Lvhi0xM9vWIrLGID91xuZTgxM9E6wJVNzPk= 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 58DB21E05C; Wed, 9 Oct 2024 11:38:48 -0400 (EDT) Message-ID: <4e02c463-59ba-454d-ad36-98b738a10079@simark.ca> Date: Wed, 9 Oct 2024 11:38:48 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 4/5] gdb: introduce ability to disable frame unwinders To: Guinevere Larsen , gdb-patches@sourceware.org Cc: Guinevere Larsen References: <20241001184235.3710608-1-guinevere@redhat.com> <20241001184235.3710608-5-guinevere@redhat.com> <9753fe9a-e940-4994-9e2a-acbe491a6cb3@redhat.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <9753fe9a-e940-4994-9e2a-acbe491a6cb3@redhat.com> 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-09 09:32, Guinevere Larsen wrote: >> OTOH, I don't think accepting user inputs FRAME_UNWIND_ is really >> necessary. > That's a fair question, but I don't think this is too costly (for performance, or maintenance) to keep it, in case someone reads the code instead of documentation (not that I do that or anything o.o'). If you disagree, I am fine with removing it honestly, especially with documenting the classes that you suggested later. It's more that the FRAME_UNWIND_* names come from your enumerator names, which are really an internal implementation detail. It feels weird to expose that in the UI, where things can't change (in theory, although this is a maintenance command). >>> + struct gdbarch* gdbarch = current_inferior ()->arch (); >>> + std::vector unwinder_list >>> + = gdbarch_unwinder_list (gdbarch); >>> + >>> + /* First see if the user wants to change all unwinders. */ >>> + if (check_for_argument (&args, "-all")) >>> + { >>> + for (const frame_unwind *u : unwinder_list) >>> + u->set_enabled (enable); >>> + return; >>> + } >> Did you consider using the gdb::option framework for this (found in >> cli/cli-option.h)? It's been a while since I touched it, I don't recall >> if it would be a good fit for this, but it would be worth checking. > > I hadn't looked into using this framework when I first implemented it. However, looking at it now, it looks like overkill for what I need. The gdb::option path need the option array (with all the stuff that goes along with it), to end up with a very similar setup in the function itself. > > Now, if you think I'm overselling the complexity or that we are likely to add more options to this command, I can add it for the next version. I don't recall how it works exactly, I would have to try it for myself. Simon