From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3A67438300B3; Wed, 1 Jun 2022 12:11:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A67438300B3 From: "plasmahh at gmx dot net" To: gdb-prs@sourceware.org Subject: [Bug python/29217] New: gdb.set_parameter doesn't accept a bool where gdb.parameter returns one Date: Wed, 01 Jun 2022 12:11:46 +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: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: plasmahh at gmx dot net 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 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2022 12:11:47 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29217 Bug ID: 29217 Summary: gdb.set_parameter doesn't accept a bool where gdb.parameter returns one Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: python Assignee: unassigned at sourceware dot org Reporter: plasmahh at gmx dot net Target Milestone: --- bool settings return bools in python: > python print(type(gdb.parameter("may-interrupt"))) but do not accept them: > python gdb.set_parameter("may-interrupt",False) Traceback (most recent call last): File "", line 1, in File "/home/plasmahh/opt/gdb/share/gdb/python/gdb/__init__.py", line 237,= in set_parameter execute("set " + name + " " + str(value), to_string=3DTrue) gdb.error: "on" or "off" expected. Error while executing Python code. which paticularily also breaks gdb.with_parameter() for bool values. While something like if( isinstance(gdb.parameter(name),bool) ): value =3D { True:"on",False:"off"}[value] will fix this particular case, it might make more sense to enhance the gdb = core functionality to accept "True" (and maybe "true") too since despite the message, 1, "yes" and "enable" are already accepted. --=20 You are receiving this mail because: You are on the CC list for the bug.=