public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Make documentation of "python" command match actual behavior
@ 2019-06-29 21:17 Kevin Buettner
  2019-07-09 21:16 ` Tom Tromey
  2019-07-21  5:51 ` Kevin Buettner
  0 siblings, 2 replies; 3+ messages in thread
From: Kevin Buettner @ 2019-06-29 21:17 UTC (permalink / raw)
  To: gdb-patches; +Cc: Kevin Buettner

The example in the documentation for the "python" command shows GDB
outputting instructions for how to terminate a sequence of python
commands entered from the command line.  The documentation shows that
the following two lines are being output, though this does not occur
when actually using the "python" command from GDB:

    Type python script
    End with a line saying just "end".

While display of this text might be helpful, GDB has several other
commands which also use the "end" terminator that offer no such text.
Examples include the "if" and "while" commands.  For example,

(gdb) if 1==1
 >print "a"
 >end
$1 = "a"

This seems similar to doing:

(gdb) python
 >print 23
 >end
23

If we decide that we want the "python" command to print such a message,
we should also adjust the behavior for other GDB commands which also use
"end" to terminate a command list.  I.e, if this decision is made, the
"if" and "while" commands ought to also print similar messages.

So, for the moment anyway, this commit adjusts the documentation of the
python command to match its implementation.

This patch was taken from a larger body of work originating from the
Archer project.  I haven't been able to determine its original author,
though I did find a commit log from Jan Kratochvil (in the Archer
repository) which suggests that the change had originally been made to
gdb.texinfo, but got inadvertently dropped when the python related
documentation was split out to python.texi.

gdb/doc/ChangeLog:

	* python.texi (python command): Revise example to match
	command behavior.
---
 gdb/doc/python.texi | 2 --
 1 file changed, 2 deletions(-)

diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index f769ad03a2..034623513b 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -90,8 +90,6 @@ containing @code{end}.  For example:
 
 @smallexample
 (@value{GDBP}) python
-Type python script
-End with a line saying just "end".
 >print 23
 >end
 23
-- 
2.21.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Make documentation of "python" command match actual behavior
  2019-06-29 21:17 [PATCH] Make documentation of "python" command match actual behavior Kevin Buettner
@ 2019-07-09 21:16 ` Tom Tromey
  2019-07-21  5:51 ` Kevin Buettner
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2019-07-09 21:16 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

>>>>> "Kevin" == Kevin Buettner <kevinb@redhat.com> writes:

Kevin> So, for the moment anyway, this commit adjusts the documentation of the
Kevin> python command to match its implementation.

Seems reasonable to me.  I don't think there's much reason to add the
additional text to the command's actual output at this point.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Make documentation of "python" command match actual behavior
  2019-06-29 21:17 [PATCH] Make documentation of "python" command match actual behavior Kevin Buettner
  2019-07-09 21:16 ` Tom Tromey
@ 2019-07-21  5:51 ` Kevin Buettner
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Buettner @ 2019-07-21  5:51 UTC (permalink / raw)
  To: gdb-patches

On Sat, 29 Jun 2019 14:16:55 -0700
Kevin Buettner <kevinb@redhat.com> wrote:

> gdb/doc/ChangeLog:
> 
> 	* python.texi (python command): Revise example to match
> 	command behavior.

I've pushed this commit.

Kevin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-21  5:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-29 21:17 [PATCH] Make documentation of "python" command match actual behavior Kevin Buettner
2019-07-09 21:16 ` Tom Tromey
2019-07-21  5:51 ` Kevin Buettner

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).