public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/31467] New: gdb python api with_parameter doesn't work correctly for "breakpoint pending"
@ 2024-03-09 2:51 mitch at runsafesecurity dot com
2024-03-09 2:52 ` [Bug python/31467] " mitch at runsafesecurity dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: mitch at runsafesecurity dot com @ 2024-03-09 2:51 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31467
Bug ID: 31467
Summary: gdb python api with_parameter doesn't work correctly
for "breakpoint pending"
Product: gdb
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: python
Assignee: unassigned at sourceware dot org
Reporter: mitch at runsafesecurity dot com
Target Milestone: ---
Using `gdb.with_parameter` method with `breakpoint pending` fails and does not
restore original parameter value when original parameter is "auto".
```python
# foo.py
gdb.execute("show breakpoint pending")
print ("Old: ", gdb.parameter("breakpoint pending"))
with gdb.with_parameter("breakpoint pending", "on"):
gdb.execute("show breakpoint pending")
print ("New: ", gdb.parameter("breakpoint pending"))
```
```
(gdb) source foo.py
source foo.py
Debugger's behavior regarding pending breakpoints is auto.
Old: None
Debugger's behavior regarding pending breakpoints is on.
New: True
Traceback (most recent call last):
File "foo.py", line 16, in <module>
print ("New: ", gdb.parameter("breakpoint pending"))
File "/usr/lib/python3.7/contextlib.py", line 119, in __exit__
next(self.gen)
File "/usr/local/share/gdb/python/gdb/__init__.py", line 263, in
with_parameter
set_parameter(name, old_value)
File "/usr/local/share/gdb/python/gdb/__init__.py", line 250, in
set_parameter
execute("set " + name + " " + str(value), to_string=True)
gdb.error: "on", "off" or "auto" expected.
(gdb) source foo.py
source foo.py
Debugger's behavior regarding pending breakpoints is on.
Old: True
Debugger's behavior regarding pending breakpoints is on.
New: True
(gdb)
```
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug python/31467] gdb python api with_parameter doesn't work correctly for "breakpoint pending"
2024-03-09 2:51 [Bug python/31467] New: gdb python api with_parameter doesn't work correctly for "breakpoint pending" mitch at runsafesecurity dot com
@ 2024-03-09 2:52 ` mitch at runsafesecurity dot com
2024-03-09 13:05 ` ssbssa at sourceware dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: mitch at runsafesecurity dot com @ 2024-03-09 2:52 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31467
Mitch Souders <mitch at runsafesecurity dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Version|unknown |14.1
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug python/31467] gdb python api with_parameter doesn't work correctly for "breakpoint pending"
2024-03-09 2:51 [Bug python/31467] New: gdb python api with_parameter doesn't work correctly for "breakpoint pending" mitch at runsafesecurity dot com
2024-03-09 2:52 ` [Bug python/31467] " mitch at runsafesecurity dot com
@ 2024-03-09 13:05 ` ssbssa at sourceware dot org
2024-03-11 15:37 ` tromey at sourceware dot org
2024-03-12 14:07 ` tromey at sourceware dot org
3 siblings, 0 replies; 5+ messages in thread
From: ssbssa at sourceware dot org @ 2024-03-09 13:05 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31467
Hannes Domani <ssbssa at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2024-03-09
CC| |ssbssa at sourceware dot org
--- Comment #1 from Hannes Domani <ssbssa at sourceware dot org> ---
gdb.parameter() returns for auto_boolean types 'None' if it's set to 'auto',
but gdb.set_parameter() thinks 'None' can only mean 'unlimited'.
Not sure how to fix this.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug python/31467] gdb python api with_parameter doesn't work correctly for "breakpoint pending"
2024-03-09 2:51 [Bug python/31467] New: gdb python api with_parameter doesn't work correctly for "breakpoint pending" mitch at runsafesecurity dot com
2024-03-09 2:52 ` [Bug python/31467] " mitch at runsafesecurity dot com
2024-03-09 13:05 ` ssbssa at sourceware dot org
@ 2024-03-11 15:37 ` tromey at sourceware dot org
2024-03-12 14:07 ` tromey at sourceware dot org
3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2024-03-11 15:37 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31467
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org
--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
Vaguely related to bug#12188, where another case returns
something unexpected for auto.
Maybe the only fix is some API for looking up the underlying
"type" of a parameter so set_parameter can figure out
this is "auto boolean".
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug python/31467] gdb python api with_parameter doesn't work correctly for "breakpoint pending"
2024-03-09 2:51 [Bug python/31467] New: gdb python api with_parameter doesn't work correctly for "breakpoint pending" mitch at runsafesecurity dot com
` (2 preceding siblings ...)
2024-03-11 15:37 ` tromey at sourceware dot org
@ 2024-03-12 14:07 ` tromey at sourceware dot org
3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2024-03-12 14:07 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31467
--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
Alternatively, for this particular case, a fix to bug#12816 would
seem to work.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-03-12 14:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-09 2:51 [Bug python/31467] New: gdb python api with_parameter doesn't work correctly for "breakpoint pending" mitch at runsafesecurity dot com
2024-03-09 2:52 ` [Bug python/31467] " mitch at runsafesecurity dot com
2024-03-09 13:05 ` ssbssa at sourceware dot org
2024-03-11 15:37 ` tromey at sourceware dot org
2024-03-12 14:07 ` tromey at sourceware dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).