Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Guinevere Larsen <blarsen@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 4/4] GDB: introduce ability to disable frame unwinders
Date: Mon, 11 Mar 2024 15:09:49 +0100	[thread overview]
Message-ID: <7e5b7543-cda3-4ff5-95a9-2d0daf0be6b4@redhat.com> (raw)
In-Reply-To: <87le6sr64d.fsf@tromey.com>

On 08/03/2024 18:22, Tom Tromey wrote:
>>>>>> Guinevere Larsen <blarsen@redhat.com> 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
>


  reply	other threads:[~2024-03-11 14:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 12:51 [PATCH 0/4] Modernize frame unwinders and add disable feature Guinevere Larsen
2024-03-06 12:51 ` [PATCH 1/4] gdb: make gdbarch store a vector of frame unwinders Guinevere Larsen
2024-03-08 16:34   ` Tom Tromey
2024-03-11 10:51     ` Guinevere Larsen
2024-03-11 18:01       ` Tom Tromey
2024-03-06 12:51 ` [PATCH 2/4] gdb: add "unwinder class" to " Guinevere Larsen
2024-03-08 16:40   ` Tom Tromey
2024-03-06 12:51 ` [PATCH 3/4] gdb: Migrate frame unwinders to use C++ classes Guinevere Larsen
2024-03-07 11:01   ` Lancelot SIX
2024-03-07 11:04     ` Guinevere Larsen
2024-03-08 17:07   ` Tom Tromey
2024-03-12 16:24     ` Guinevere Larsen
2024-03-06 12:51 ` [PATCH 4/4] GDB: introduce ability to disable frame unwinders Guinevere Larsen
2024-03-06 13:47   ` Eli Zaretskii
2024-03-06 14:07     ` Guinevere Larsen
2024-03-06 14:16       ` Eli Zaretskii
2024-03-08 17:22   ` Tom Tromey
2024-03-11 14:09     ` Guinevere Larsen [this message]
2024-03-11 14:56 ` [PATCH 0/4] Modernize frame unwinders and add disable feature Luis Machado
2024-03-11 15:00   ` Guinevere Larsen
2024-03-11 15:10     ` Luis Machado
2024-03-13 12:08       ` Guinevere Larsen
2024-03-13 12:44         ` Luis Machado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7e5b7543-cda3-4ff5-95a9-2d0daf0be6b4@redhat.com \
    --to=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox