From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A5334385E032; Sat, 9 Mar 2024 02:51:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5334385E032 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1709952669; bh=8TnMrssa0+l0WYcWbzr6HvfyVRpx062KwGKZqQdatQw=; h=From:To:Subject:Date:From; b=yc5BiaDO5TdTYjgRToG+gnrz92B9ETe3QI+R91KOOaZ8O8BtExLhRjHwCrEiBDcgY cmYmFM+UA0gTNuW8ai++ddKZsQPFQVkZ60BxTxLqUgi0lt7RBRe/Y3dMSbLovM01lr Xe8mV6AgrYKhFWeZtH1Th6iB+kNAXzk0J5gzK1XA= From: "mitch at runsafesecurity dot com" To: gdb-prs@sourceware.org Subject: [Bug python/31467] New: gdb python api with_parameter doesn't work correctly for "breakpoint pending" Date: Sat, 09 Mar 2024 02:51:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mitch at runsafesecurity dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31467 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 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=3DTrue) 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)=20 ``` --=20 You are receiving this mail because: You are on the CC list for the bug.=