From: Andrew Burgess <aburgess@redhat.com>
To: "Tom Tromey" <tom@tromey.com>, "Tomáš Hrnčiar" <thrnciar@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/python: add allow_pending parameter to gdb.Breakpoint constructor
Date: Thu, 22 Oct 2026 14:54:41 +0100 [thread overview]
Message-ID: <87a4o596xq.fsf@redhat.com> (raw)
In-Reply-To: <877bjk46l1.fsf@tromey.com>
Tom Tromey <tom@tromey.com> writes:
>>>>>> "Tomáš" == Tomáš Hrnčiar <thrnciar@redhat.com> writes:
>
> Tomáš> Add a new allow_pending parameter to the gdb.Breakpoint constructor.
> Tomáš> Setting the new parameter to False causes GDB to raise an error instead
> Tomáš> of creating a pending breakpoint. By default this parameter is True,
> Tomáš> which allows pending breakpoints to be created, preserving the existing
> Tomáš> behaviour.
>
> Hi. Thanks for the patch.
>
> This is PR python/12816 so please add this tag to the commit message:
>
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=12816
>
> Tomáš> + ** The gdb.Breakpoint constructor now takes an optional
> Tomáš> + 'allow_pending' argument. Setting it to False causes GDB to raise
> Tomáš> + an error instead of creating a pending breakpoint.
>
> I wonder about calling the new argument 'pending' instead. I tend to
> think that's a bit nicer since we already match the parameter and
> attribute name for 'temporary'.
Hi Tom,
Full disclosure: I consulted with Tomáš about this patch before it was
posted.
I suggested that the argument be called allow_pending rather than just
pending as having:
bp = gdb.Breakpoint("file.c:10", pending=True)
seemed (to me) that this was a request *for* a pending breakpoint, which
clearly isn't what this actually does. I felt that:
bp = gdb.Breakpoint("file.c:10", allow_pending=True)
was much clearer about the intent.
Though, having just typed this, I realise that as 'True' is the default,
you'll never actually write that, you'd instead only write:
bp = gdb.Breakpoint("file.c:10", pending=False)
where reading this as a request *for* a non-pending breakpoint is
actually fine. So, I guess the case where the name 'pending' is (IMHO)
confusing, is the case that you're less likely to write.
Still, I do prefer the fuller name, but if you'd rather it was changed,
then that's also fine with me, I'm not that tied to it.
Thanks,
Andrew
next prev parent reply other threads:[~2026-10-22 13:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 7:47 Tomáš Hrnčiar
2026-10-13 12:55 ` Eli Zaretskii
2026-10-14 15:58 ` Tom Tromey
2026-10-22 13:54 ` Andrew Burgess [this message]
2026-10-22 17:50 ` Simon Marchi
2026-10-22 18:35 ` Tom Tromey
2026-10-27 8:09 ` [PATCH v2] " Tomáš Hrnčiar
2026-10-27 14:06 ` Tom Tromey
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=87a4o596xq.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=thrnciar@redhat.com \
--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