From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id 64F76385DC1C for ; Fri, 8 Mar 2024 17:22:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 64F76385DC1C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 64F76385DC1C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709918535; cv=none; b=wqFMJ8GY88dlVB02CFNnmUsORp4a7PGaN9N3cTDKZ+KvAli5/ieWbKgWewE4cwKYkMC+zdDlEx5aVULIOCCbzR68l0xVABQh3VdChjom6H2FoVxgYEQndXlkOIFTuHWDyVkd0NJ4WUADSoHV1DOuxqReltbWj2dulfIYNPfuKSk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709918535; c=relaxed/simple; bh=jYr1sQjDHj/kph/h4PJF70myq9LEB7ErA/KWq3u+fkk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=W5eYSpLADjHVKK5j3Vn3zf1mRWRM9ca+d8tLiQ29+n/KLrR8Mpf40nWklmHDDI2Y+LWCR4wmmtJRBSfX30uuJfG6o3ZcW/Xj3pEWwU/bG5u/1vin96zp3TRALeskBaJ99nhjeIHW8nhhP+ybFoIMXyQp2VdHViVO4rh/nkjNAqA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6009a.ext.cloudfilter.net ([10.0.30.184]) by cmsmtp with ESMTPS id icDkrLQG6Qr4SidvArZSpn; Fri, 08 Mar 2024 17:22:12 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id idv9rKlwVAP0FidvArZdsn; Fri, 08 Mar 2024 17:22:12 +0000 X-Authority-Analysis: v=2.4 cv=KNRcDkFo c=1 sm=1 tr=0 ts=65eb4944 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=K6JAEmCyrfEA:10 a=Qbun_eYptAEA:10 a=20KFwNOVAAAA:8 a=6aRgU5nmgyqI9XyYfTIA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=vRDgEstBkQoy1aou+HN8sFBy5HTy6XWwKjLXJH3T7aI=; b=lVvZKFZxAQk0FfBhuq2Eoq/ivx cUZOTxzmqd5FL/6+WObSRhu3X6Mjo5KjjpRpHypHY3i7oRbza5GTGOhiCFFDPKq2ixmCZpSk9ZkpU AescAR4dHJmcXqE6IYMdzYkWE; Received: from 97-122-82-115.hlrn.qwest.net ([97.122.82.115]:49440 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1ridv9-0002EL-1T; Fri, 08 Mar 2024 10:22:11 -0700 From: Tom Tromey To: Guinevere Larsen Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 4/4] GDB: introduce ability to disable frame unwinders References: <20240306125135.766567-1-blarsen@redhat.com> <20240306125135.766567-5-blarsen@redhat.com> X-Attribution: Tom Date: Fri, 08 Mar 2024 10:22:10 -0700 In-Reply-To: <20240306125135.766567-5-blarsen@redhat.com> (Guinevere Larsen's message of "Wed, 6 Mar 2024 13:51:35 +0100") Message-ID: <87le6sr64d.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.82.115 X-Source-L: No X-Exim-ID: 1ridv9-0002EL-1T X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-82-115.hlrn.qwest.net (murgatroyd) [97.122.82.115]:49440 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfFQ6Y29JDJS1trIMxK5aT8v5f6DbON9bNwnBesgRwxMBguND0FruVjoYwlc1+vcJgGW8vyAK7i43KCE3ZNjDHiz9AJV2p7FA3Se9pGSwOQ4Yj764hnVN zMcIDPjR1r0vz4bIEbGN7tjwPz5PQwdkgRgmjF98T1++NH/+tAOQh29xYqdDrzfHH+UtmCWjPJIbh0XuTraDWQJxJVB07XiZ4v0= X-Spam-Status: No, score=-3015.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,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: >>>>> Guinevere Larsen writes: > +static enum frame_unwind_class > +str_to_frame_unwind_class (const char **c_str) Comment. > +{ > + std::string full_name = "FRAME_UNWIND_"; > + const int start_length = full_name.length (); > + if (strncasecmp (*c_str, full_name.c_str (), start_length) == 0) > + full_name = *c_str; In an earlier patch I was wondering how useful those FRAME_UNWIND_ strings were for the maint output. Maybe just using human names here would be overall better. Then this could just call streq. Anyway if you want to keep this approach, it's weird to allocate a string and then use the C API. Perhaps a string_view would be better. > +/* Helper function to both enable and disable frame unwinders. > + if ENABLE is true, this call will be enabling unwinders, > + otherwise the unwinders will be disabled. */ > +static void > +enable_disable_frame_unwinders (const char *args, int from_tty, bool enable) > +{ > + > + reinit_frame_cache (); Stray blank line. > + if (args == nullptr) > + { > + error (_("specify which frame unwinder(s) should be %s"), > + (enable)? "enabled" : "disabled"); > + } No braces. > + /* 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); > + } This also looks over-braced. > + add_cmd ("disable", class_maintenance, maintenance_disable_frame_unwinders, > + _("\ > +Disable one or more frame unwinder(s).\n\ > +Usage: maint frame-unwinder disable [OPTION] UNWINDER\n\ > +\n\ > +The meaning of UNWINDER depends on the OPTION given. These are the possibilities:\n\ > +\t-all - UNWINDER is ignored. All available unwinders will be disabled\n\ > +\t-name - UNWINDER is the exact name of the frame unwinder is to be disabled\n\ > +\t-class - UNWINDER is the class of unwinders to be disabled.\n\ I guess I'd write that more like disable [-all | -name UNWINDER | -class NAME] or something like that, rather than spelling out that UNWINDER is ignored in one case. I think there's probably a bug in bugzilla about disabling unwinders, so this should probably have a Bug: trailer. Tom