Remove Python 2 from gdb documentation

Message ID 20230628154138.2727810-1-tromey@adacore.com
State New
Headers
Series Remove Python 2 from gdb documentation |

Commit Message

Tom Tromey June 28, 2023, 3:41 p.m. UTC
  GDB can't be built using Python 2 any more, so remove the remaining
vestiges of this from the documentation.
---
 gdb/doc/python.texi | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)
  

Comments

Eli Zaretskii June 28, 2023, 3:48 p.m. UTC | #1
> Cc: Tom Tromey <tromey@adacore.com>
> Date: Wed, 28 Jun 2023 09:41:38 -0600
> From: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org>
> 
> GDB can't be built using Python 2 any more, so remove the remaining
> vestiges of this from the documentation.

This is OK, but...

>  @defvar Instruction.data
> -A buffer with the raw instruction data.  In Python 3, the return value is a
> -@code{memoryview} object.
> +A @code{memoryview} holding the raw instruction data.

...you've lost the "object" part here.

Thanks.

Approved-By: Eli Zaretskii <eliz@gnu.org>
  
Tom Tromey June 28, 2023, 4:55 p.m. UTC | #2
>> @defvar Instruction.data
>> -A buffer with the raw instruction data.  In Python 3, the return value is a
>> -@code{memoryview} object.
>> +A @code{memoryview} holding the raw instruction data.

Eli> ...you've lost the "object" part here.

I fixed that & I'm checking it in.

Eli> Approved-By: Eli Zaretskii <eliz@gnu.org>

Tom
  

Patch

diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 9cb97a9597d..ee24113e336 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -3508,11 +3508,10 @@  particular frame (@pxref{Frames In Python}).
 @anchor{gdbpy_inferior_read_memory}
 @findex Inferior.read_memory
 @defun Inferior.read_memory (address, length)
-Read @var{length} addressable memory units from the inferior, starting at
-@var{address}.  Returns a buffer object, which behaves much like an array
-or a string.  It can be modified and given to the
-@code{Inferior.write_memory} function.  In Python 3, the return
-value is a @code{memoryview} object.
+Read @var{length} addressable memory units from the inferior, starting
+at @var{address}.  Returns a @code{memoryview} object, which behaves
+much like an array or a string.  It can be modified and given to the
+@code{Inferior.write_memory} function.
 @end defun
 
 @findex Inferior.write_memory
@@ -4060,8 +4059,7 @@  An integer representing this instruction's address.
 @end defvar
 
 @defvar Instruction.data
-A buffer with the raw instruction data.  In Python 3, the return value is a
-@code{memoryview} object.
+A @code{memoryview} holding the raw instruction data.
 @end defvar
 
 @defvar Instruction.decoded
@@ -6814,20 +6812,15 @@  If @var{packet} is not a @code{bytes} object, or a @code{Unicode}
 string, then a @code{TypeError} is raised.  If @var{packet} is empty
 then a @code{ValueError} is raised.
 
-The response is returned as a @code{bytes} object.  For Python 3 if it
-is known that the response can be represented as a string then this
-can be decoded from the buffer.  For example, if it is known that the
+The response is returned as a @code{bytes} object.  If it is known
+that the response can be represented as a string then this can be
+decoded from the buffer.  For example, if it is known that the
 response is an @sc{ascii} string:
 
 @smallexample
 remote_connection.send_packet("some_packet").decode("ascii")
 @end smallexample
 
-In Python 2 @code{bytes} and @code{str} are aliases, so the result is
-already a string, if the response includes non-printable characters,
-or null characters, then these will be present in the result, care
-should be taken when processing the result to handle this case.
-
 The prefix, suffix, and checksum (as required by the remote serial
 protocol) are automatically added to the outgoing packet, and removed
 from the incoming packet before the contents of the reply are