Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Guinevere Larsen <guinevere@redhat.com>, gdb-patches@sourceware.org
Cc: Guinevere Larsen <blarsen@redhat.com>
Subject: Re: [PATCH v5 4/5] gdb: introduce ability to disable frame unwinders
Date: Wed, 9 Oct 2024 11:38:48 -0400	[thread overview]
Message-ID: <4e02c463-59ba-454d-ad36-98b738a10079@simark.ca> (raw)
In-Reply-To: <9753fe9a-e940-4994-9e2a-acbe491a6cb3@redhat.com>



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<const frame_unwind *> 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

  reply	other threads:[~2024-10-09 15:39 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01 18:42 [PATCH v5 0/5] Modernize frame unwinders and add disable feature Guinevere Larsen
2024-10-01 18:42 ` [PATCH v5 1/5] gdb: make gdbarch store a vector of frame unwinders Guinevere Larsen
2024-10-02 21:49   ` Thiago Jung Bauermann
2024-10-08 17:01     ` Guinevere Larsen
2024-10-03 18:33   ` Simon Marchi
2024-10-04 18:37   ` Tom Tromey
2024-10-12  1:34     ` Thiago Jung Bauermann
2024-10-14 18:18       ` Guinevere Larsen
2024-10-17 22:53         ` Tom Tromey
2024-10-18 17:40           ` Guinevere Larsen
2024-10-17 23:41       ` Tom Tromey
2024-10-01 18:42 ` [PATCH v5 2/5] gdb: add "unwinder class" to " Guinevere Larsen
2024-10-02 22:08   ` Thiago Jung Bauermann
2024-10-03 18:46   ` Simon Marchi
2024-10-08 18:22     ` Guinevere Larsen
2024-10-08 18:37       ` Simon Marchi
2024-10-01 18:42 ` [PATCH v5 3/5] gdb: Migrate frame unwinders to use C++ classes Guinevere Larsen
2024-10-03  0:23   ` Thiago Jung Bauermann
2024-10-09 18:16     ` Guinevere Larsen
2024-10-03 20:06   ` Simon Marchi
2024-10-04  5:21     ` Simon Marchi
2024-10-10 14:10       ` Guinevere Larsen
2024-10-10 16:28         ` Simon Marchi
2024-10-09 20:00     ` Guinevere Larsen
2024-10-01 18:42 ` [PATCH v5 4/5] gdb: introduce ability to disable frame unwinders Guinevere Larsen
2024-10-02  6:10   ` Eli Zaretskii
2024-10-04 17:57     ` Guinevere Larsen
2024-10-03  2:45   ` Thiago Jung Bauermann
2024-10-08 19:23     ` Guinevere Larsen
2024-10-06  2:51   ` Simon Marchi
2024-10-09 13:32     ` Guinevere Larsen
2024-10-09 15:38       ` Simon Marchi [this message]
2024-10-01 18:42 ` [PATCH v5 5/5] gdb/testsuite: Test for a backtrace through object without debuginfo Guinevere Larsen
2024-10-03  2:47   ` Thiago Jung Bauermann
2024-10-03  6:58   ` Gerlicher, Klaus
2024-10-09 14:56     ` Guinevere Larsen

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=4e02c463-59ba-454d-ad36-98b738a10079@simark.ca \
    --to=simark@simark.ca \
    --cc=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=guinevere@redhat.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