Bug 12816 - No 'pending' support for breakpoints created from Python
Summary: No 'pending' support for breakpoints created from Python
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: python (show other bugs)
Version: HEAD
: P2 enhancement
Target Milestone: ---
Assignee: Tom Tromey
URL:
Keywords:
: 12688 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-05-27 08:56 UTC by Kevin Pouget
Modified: 2024-03-12 14:08 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Pouget 2011-05-27 08:56:33 UTC
when one creates a gdb.Breakpoint object, s/he has no control on its pending state:

> (gdb) python gdb.Breakpoint('send')
> No symbol table is loaded.  Use the "file" command.
> Breakpoint 4 (send) pending.

it would be convenient to 
1) specify if we allow or not the breakpoint to be pending
2) remove the two lines written by GDB
3) know whether the breakpoint has actually been set or is pending

(I should provide a solution for 3 soon)
Comment 1 Kevin Pouget 2011-12-08 13:56:15 UTC
the problem about 1) is:

(gdb) set breakpoint pending off
(gdb) py gdb.Breakpoint("nop")
Function "nop" not defined.
Breakpoint 7 (nop) pending.
Comment 2 Hannes Domani 2022-01-03 15:13:25 UTC
Since gdb 7.12, gdb.Breakpoint has the (read-only) "pending" attribute.
Is more needed to resolve this ticket?
Comment 3 Simon Marchi 2022-01-04 14:43:23 UTC
(In reply to Hannes Domani from comment #2)
> Since gdb 7.12, gdb.Breakpoint has the (read-only) "pending" attribute.
> Is more needed to resolve this ticket?

AFAIU, it doesn't.  This bug is about being able to decide whether to allow pending breakpoints when creating a gdb.Breakpoint.  I would imagine a parameter like:

  gdb.Breakpoint("my_function", allow_pending=True)

for example.
Comment 4 Tom Tromey 2022-06-05 14:54:28 UTC
*** Bug 12688 has been marked as a duplicate of this bug. ***
Comment 5 Tom Tromey 2022-12-07 15:53:16 UTC
Working on a patch.
Comment 6 Tom Tromey 2022-12-08 18:39:07 UTC
I belatedly discovered that a breakpoint created from Python
is always marked pending.  So maybe there's nothing really needed here.
Comment 7 Tom Tromey 2022-12-21 20:21:12 UTC
I misread the bug and see it's asking for a "non-pending" option.
I guess that makes sense :)

The "announce" issue mentioned is addressed here:

https://sourceware.org/pipermail/gdb-patches/2022-December/194576.html
Comment 8 Tom Tromey 2024-03-12 14:08:36 UTC
I pushed my current hacks to my github, branch "submit/pr-py-12816-pending".
Needs rebasing and probably other work.