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.133.124]) by sourceware.org (Postfix) with ESMTPS id D4F983858CD1 for ; Mon, 11 Mar 2024 14:09:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D4F983858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D4F983858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710166197; cv=none; b=tU0MQv7+1unmn3Nz8h7nkfbvGD6HZnKfmM7RdEuqZJbmyFVOKXybHUu7ldNRxFuygrNk1ExCafZ47VjzFsoc0DVj4TrmvVtOqkZWLOAl0Ge1eQmYgz5TTmsxZ4cungxHUzO1FyqKNHMxNWopiJqs9oR6qG2opy7t8LlyX9a+m0g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710166197; c=relaxed/simple; bh=SQips0TzmvrJ4oeB9Ltr0gNiaFnnudkAIpSWMWjqe6M=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=aQNYdfZopcNaaI1cgaBjBlu3D5bRnGCskE+h9rPYQTzMEgMC0vrt04v8tiJpZwX1GsbzpZAMQfNxIKr05plkyu8JG4NyF/q/pCAeHECmjNS9sWCcb3s56GmX+GrhsWCI8SADTPEUCwaU2E5m9l0VNg+W3OhlgjhpXu698n/cV/8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710166194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sxxmHvHEOoDzL+Ft5MuHDYgaKxOJ7KNpjsBSxgJvwo0=; b=aXDfX3biJQ8GVw4SUqZu46SgyEdrlxf/IkE/wPdoEgvFzhmJh/xE6Z9pTkEkEaG0AEH9RO +CqOAEoOZBe3hY/ly3sO5JV4tYw3Bk+J/vKrdztvpxK45+6tnIqBXwar0NSHDHV2KO+W+4 VxUJ7i6Zgs9DUYl++rHB6pl++eO9caE= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-144-6eR4MVG3NpiTDSfHg03d3w-1; Mon, 11 Mar 2024 10:09:53 -0400 X-MC-Unique: 6eR4MVG3NpiTDSfHg03d3w-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a44d0cb0596so179196066b.2 for ; Mon, 11 Mar 2024 07:09:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710166191; x=1710770991; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sxxmHvHEOoDzL+Ft5MuHDYgaKxOJ7KNpjsBSxgJvwo0=; b=rO6oHtTOTgQ7lZudWNn0Bv3PcLvLrGXltaXN/GBXxmW8ZDPNxEofP0d7GfhkPYip+3 yKFwrrrNlFPB14symcO/DX9hNyBcEu3aR77i7YU4W/CikmoTEnNnyD5Dl6nu9y8tqGTU NweG1fFnWKNLfcRHfUQXjJ6pPs/4op80U7xvnK/gqmy8xpWg8wQLI8D8DpH5eLu4wOv/ AavYqxvCtO7m1uquQSPY3TCY7h8NSQOLcO35vXhUi9gTfviZAQMNWmdVR1mghg9n+ioL r3GDq59peuOh6IRnsc0Jtx67I/7mfd35sZQAPSjKT1HACetIzUBpup11GDVjVmhIcvxM KYSA== X-Gm-Message-State: AOJu0YyoXrz54kdsz3Hkc/HRAgrpRAeFWXM49v17STqUD/s6nuhNdTL+ iW3YfHHbHkH37oL8L1EhaW0+WPlGYjgPUbMZBSvCxCShWBDYG6Os1P1vzV+GQ5mxtj/m+W904Lm mC6Ukfx+bLgzP+KZ8nfRb0jGjCHKEzJLu9HyAZ5vCFu3u7tbcsFT5jTtxZ0TOFpF8dsg= X-Received: by 2002:a17:906:b11:b0:a3e:e678:556 with SMTP id u17-20020a1709060b1100b00a3ee6780556mr4065284ejg.58.1710166191229; Mon, 11 Mar 2024 07:09:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHDqnhcH35C/nv2o3PU6zHyeuwYp2S87nGiB+NSbzH5k8hhW6GHbad61oND69/YvY9cPVFWg== X-Received: by 2002:a17:906:b11:b0:a3e:e678:556 with SMTP id u17-20020a1709060b1100b00a3ee6780556mr4065271ejg.58.1710166190835; Mon, 11 Mar 2024 07:09:50 -0700 (PDT) Received: from [192.168.0.129] (ip-94-112-227-180.bb.vodafone.cz. [94.112.227.180]) by smtp.gmail.com with ESMTPSA id kn22-20020a170906aa5600b00a45200fe2b5sm2888010ejb.224.2024.03.11.07.09.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Mar 2024 07:09:50 -0700 (PDT) Message-ID: <7e5b7543-cda3-4ff5-95a9-2d0daf0be6b4@redhat.com> Date: Mon, 11 Mar 2024 15:09:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/4] GDB: introduce ability to disable frame unwinders To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20240306125135.766567-1-blarsen@redhat.com> <20240306125135.766567-5-blarsen@redhat.com> <87le6sr64d.fsf@tromey.com> From: Guinevere Larsen In-Reply-To: <87le6sr64d.fsf@tromey.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 08/03/2024 18:22, Tom Tromey wrote: >>>>>> 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. I don't want to call streq because I want case insensitive matching, but I will drop the FRAME_UNWIND_ prefix from printing. > > 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. I used the string because at that moment it felt safer than dealing with strcat, and originally I was going to use the operator equals rather than strcasecmp. I'll drop it > > >> +/* 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. That sounds like a much better solution to what I came up with hahaha. Thank you! > > > I think there's probably a bug in bugzilla about disabling unwinders, so > this should probably have a Bug: trailer. Is there? :o I'll go looking for it. -- Cheers, Guinevere Larsen She/Her/Hers > > Tom >