* [Bug python/26586] from_tty argument to Python's gdb.execute is no longer effective
2020-09-08 15:23 [Bug python/26586] New: from_tty argument to Python's gdb.execute is no longer effective grees at undo dot io
@ 2020-09-08 16:33 ` grees at undo dot io
2020-09-08 17:05 ` brobecker at gnat dot com
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: grees at undo dot io @ 2020-09-08 16:33 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26586
Gareth Rees <grees at undo dot io> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |grees at undo dot io
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug python/26586] from_tty argument to Python's gdb.execute is no longer effective
2020-09-08 15:23 [Bug python/26586] New: from_tty argument to Python's gdb.execute is no longer effective grees at undo dot io
2020-09-08 16:33 ` [Bug python/26586] " grees at undo dot io
@ 2020-09-08 17:05 ` brobecker at gnat dot com
2020-09-10 17:35 ` simark at simark dot ca
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: brobecker at gnat dot com @ 2020-09-08 17:05 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26586
Joel Brobecker <brobecker at gnat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |10.1
CC| |brobecker at gnat dot com
--- Comment #1 from Joel Brobecker <brobecker at gnat dot com> ---
Not really a regression (gdb-8.2 and gdb-9-branch have the patch identified as
the cause of this failure), but seems like a good fix to have if we can.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug python/26586] from_tty argument to Python's gdb.execute is no longer effective
2020-09-08 15:23 [Bug python/26586] New: from_tty argument to Python's gdb.execute is no longer effective grees at undo dot io
2020-09-08 16:33 ` [Bug python/26586] " grees at undo dot io
2020-09-08 17:05 ` brobecker at gnat dot com
@ 2020-09-10 17:35 ` simark at simark dot ca
2020-09-10 17:35 ` simark at simark dot ca
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: simark at simark dot ca @ 2020-09-10 17:35 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26586
Simon Marchi <simark at simark dot ca> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |simark at simark dot ca
--- Comment #2 from Simon Marchi <simark at simark dot ca> ---
Created attachment 12832
--> https://sourceware.org/bugzilla/attachment.cgi?id=12832&action=edit
Patch 1 to improve test case
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug python/26586] from_tty argument to Python's gdb.execute is no longer effective
2020-09-08 15:23 [Bug python/26586] New: from_tty argument to Python's gdb.execute is no longer effective grees at undo dot io
` (2 preceding siblings ...)
2020-09-10 17:35 ` simark at simark dot ca
@ 2020-09-10 17:35 ` simark at simark dot ca
2020-09-10 17:36 ` simark at simark dot ca
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: simark at simark dot ca @ 2020-09-10 17:35 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26586
--- Comment #3 from Simon Marchi <simark at simark dot ca> ---
Arg sorry, wrong bug.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug python/26586] from_tty argument to Python's gdb.execute is no longer effective
2020-09-08 15:23 [Bug python/26586] New: from_tty argument to Python's gdb.execute is no longer effective grees at undo dot io
` (3 preceding siblings ...)
2020-09-10 17:35 ` simark at simark dot ca
@ 2020-09-10 17:36 ` simark at simark dot ca
2020-09-19 15:39 ` cbiesinger at google dot com
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: simark at simark dot ca @ 2020-09-10 17:36 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26586
Simon Marchi <simark at simark dot ca> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #12832|0 |1
is obsolete| |
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug python/26586] from_tty argument to Python's gdb.execute is no longer effective
2020-09-08 15:23 [Bug python/26586] New: from_tty argument to Python's gdb.execute is no longer effective grees at undo dot io
` (4 preceding siblings ...)
2020-09-10 17:36 ` simark at simark dot ca
@ 2020-09-19 15:39 ` cbiesinger at google dot com
2020-09-22 10:24 ` grees at undo dot io
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: cbiesinger at google dot com @ 2020-09-19 15:39 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26586
Christian Biesinger <cbiesinger at google dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |cbiesinger at google dot com
--- Comment #4 from Christian Biesinger <cbiesinger at google dot com> ---
Gareth, could you send the patch to the gdb-patches mailing list as described
in https://sourceware.org/gdb/wiki/ContributionChecklist ? Thanks!
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug python/26586] from_tty argument to Python's gdb.execute is no longer effective
2020-09-08 15:23 [Bug python/26586] New: from_tty argument to Python's gdb.execute is no longer effective grees at undo dot io
` (5 preceding siblings ...)
2020-09-19 15:39 ` cbiesinger at google dot com
@ 2020-09-22 10:24 ` grees at undo dot io
2020-09-26 18:02 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: grees at undo dot io @ 2020-09-22 10:24 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26586
--- Comment #5 from Gareth Rees <grees at undo dot io> ---
Patch submitted as requested:
https://sourceware.org/pipermail/gdb-patches/2020-September/172000.html
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug python/26586] from_tty argument to Python's gdb.execute is no longer effective
2020-09-08 15:23 [Bug python/26586] New: from_tty argument to Python's gdb.execute is no longer effective grees at undo dot io
` (6 preceding siblings ...)
2020-09-22 10:24 ` grees at undo dot io
@ 2020-09-26 18:02 ` cvs-commit at gcc dot gnu.org
2020-09-28 20:16 ` cvs-commit at gcc dot gnu.org
2020-10-08 17:42 ` simark at simark dot ca
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-26 18:02 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26586
--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Joel Brobecker <brobecke@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8f9929bb97dc0f0fdf60269ac8c9a7d50746646f
commit 8f9929bb97dc0f0fdf60269ac8c9a7d50746646f
Author: Gareth Rees <grees@undo.io>
Date: Sat Sep 26 11:01:45 2020 -0700
gdb: Fix from_tty argument to gdb.execute in Python.
Prior to commit 56bcdbea2b, the from_tty keyword argument to the
Python function gdb.execute controlled whether the command took input
from the terminal. When from_tty=True, "starti" and similar commands
prompted the user:
(gdb) python gdb.execute("starti", from_tty=True)
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /bin/true
Program stopped.
When from_tty=False, these commands did not prompt the user, and "yes"
was assumed:
(gdb) python gdb.execute("starti", from_tty=False)
Program stopped.
However, after commit 56bcdbea2b, the from_tty keyword argument no
longer had this effect. For example, as of commit 7ade7fba75:
(gdb) python gdb.execute("starti", from_tty=True)
The program being debugged has been started already.
Start it from the beginning? (y or n) [answered Y; input not from
terminal]
Starting program: /bin/true
Program stopped.
Note the "[answered Y; input not from terminal]" in the output even
though from_tty=True was requested.
Looking at commit 56bcdbea2b, it seems that the behaviour of the
from_tty argument was changed accidentally. The commit message said:
Let gdb.execute handle multi-line commands
This changes the Python API so that gdb.execute can now handle
multi-line commands, like "commands" or "define".
and there was no mention of changing the effect of the from_tty
argument. It looks as though the code for setting the instream to
nullptr was accidentally moved from execute_user_command() to
execute_control_commands() along with the other scoped restores.
Accordingly, the simplest way to fix this is to partially reverse
commit 56bcdbea2b by moving the code for setting the instream to
nullptr back to execute_user_command() where it was to begin with.
Additionally, add a test case to reduce the risk of similar breakage
in future.
gdb/ChangeLog:
PR python/26586
* cli/cli-script.c (execute_control_commands): don't set
instream to nullptr here as this breaks the from_tty argument
to gdb.execute in Python.
(execute_user_command): set instream to nullptr here instead.
gdb/testsuite/ChangeLog:
PR python/26586
* gdb.python/python.exp: add test cases for the from_tty
argument to gdb.execute.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug python/26586] from_tty argument to Python's gdb.execute is no longer effective
2020-09-08 15:23 [Bug python/26586] New: from_tty argument to Python's gdb.execute is no longer effective grees at undo dot io
` (7 preceding siblings ...)
2020-09-26 18:02 ` cvs-commit at gcc dot gnu.org
@ 2020-09-28 20:16 ` cvs-commit at gcc dot gnu.org
2020-10-08 17:42 ` simark at simark dot ca
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-09-28 20:16 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26586
--- Comment #7 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-10-branch branch has been updated by Joel Brobecker
<brobecke@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f6c03ee4ad37c883c008f62d603dba043c424a54
commit f6c03ee4ad37c883c008f62d603dba043c424a54
Author: Gareth Rees <grees@undo.io>
Date: Sat Sep 26 11:01:45 2020 -0700
gdb: Fix from_tty argument to gdb.execute in Python.
Prior to commit 56bcdbea2b, the from_tty keyword argument to the
Python function gdb.execute controlled whether the command took input
from the terminal. When from_tty=True, "starti" and similar commands
prompted the user:
(gdb) python gdb.execute("starti", from_tty=True)
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /bin/true
Program stopped.
When from_tty=False, these commands did not prompt the user, and "yes"
was assumed:
(gdb) python gdb.execute("starti", from_tty=False)
Program stopped.
However, after commit 56bcdbea2b, the from_tty keyword argument no
longer had this effect. For example, as of commit 7ade7fba75:
(gdb) python gdb.execute("starti", from_tty=True)
The program being debugged has been started already.
Start it from the beginning? (y or n) [answered Y; input not from
terminal]
Starting program: /bin/true
Program stopped.
Note the "[answered Y; input not from terminal]" in the output even
though from_tty=True was requested.
Looking at commit 56bcdbea2b, it seems that the behaviour of the
from_tty argument was changed accidentally. The commit message said:
Let gdb.execute handle multi-line commands
This changes the Python API so that gdb.execute can now handle
multi-line commands, like "commands" or "define".
and there was no mention of changing the effect of the from_tty
argument. It looks as though the code for setting the instream to
nullptr was accidentally moved from execute_user_command() to
execute_control_commands() along with the other scoped restores.
Accordingly, the simplest way to fix this is to partially reverse
commit 56bcdbea2b by moving the code for setting the instream to
nullptr back to execute_user_command() where it was to begin with.
Additionally, add a test case to reduce the risk of similar breakage
in future.
gdb/ChangeLog:
PR python/26586
* cli/cli-script.c (execute_control_commands): don't set
instream to nullptr here as this breaks the from_tty argument
to gdb.execute in Python.
(execute_user_command): set instream to nullptr here instead.
gdb/testsuite/ChangeLog:
PR python/26586
* gdb.python/python.exp: add test cases for the from_tty
argument to gdb.execute.
(cherry picked from commit 8f9929bb97dc0f0fdf60269ac8c9a7d50746646f)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug python/26586] from_tty argument to Python's gdb.execute is no longer effective
2020-09-08 15:23 [Bug python/26586] New: from_tty argument to Python's gdb.execute is no longer effective grees at undo dot io
` (8 preceding siblings ...)
2020-09-28 20:16 ` cvs-commit at gcc dot gnu.org
@ 2020-10-08 17:42 ` simark at simark dot ca
9 siblings, 0 replies; 11+ messages in thread
From: simark at simark dot ca @ 2020-10-08 17:42 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26586
Simon Marchi <simark at simark dot ca> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from Simon Marchi <simark at simark dot ca> ---
Marking as fixed.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 11+ messages in thread