[gdb/docs] use a clearer example for gdb lexing

Message ID JjReHsyUaIf9SKN2vDhyWrBGwFeVxKsYv9ACUvo7xa2Y5btUQPuB9Gl1VJb-Dln7HJc1pPFNixu7zn0drwF11Dl_CcgG-PPfPcZeIgSUWYE=@proton.me
State New
Headers
Series [gdb/docs] use a clearer example for gdb lexing |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Test passed

Commit Message

k4lizen Sept. 28, 2026, 11:21 p.m. UTC
  The old one raised a SyntaxWarning, and this one
allows the reader to focus on the GDB lexing
without having to think about what python is
doing.

Signed-off-by: k4lizen <k4lizen@proton.me>
---
 gdb/doc/python.texi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Eli Zaretskii Sept. 29, 2026, 5:33 a.m. UTC | #1
> Date: Mon, 28 Sep 2026 23:21:40 +0000
> From: k4lizen <k4lizen@proton.me>
> 
> The old one raised a SyntaxWarning, and this one
> allows the reader to focus on the GDB lexing
> without having to think about what python is
> doing.

Thanks.  Is the new variant you suggest supported by all the versions
of Python we currently support?

Also, I think this should be reviewed by someone who knows Python
better than I do (which is close to nothing), because this is not just
a documentation issue.

The patch is okay Texinfo-wise.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
  
Tom Tromey Sept. 30, 2026, 2:09 p.m. UTC | #2
>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Mon, 28 Sep 2026 23:21:40 +0000
>> From: k4lizen <k4lizen@proton.me>
>> 
>> The old one raised a SyntaxWarning, and this one
>> allows the reader to focus on the GDB lexing
>> without having to think about what python is
>> doing.

Eli> Thanks.  Is the new variant you suggest supported by all the versions
Eli> of Python we currently support?

Yeah.  But also IMO it doesn't matter, Python developers generally
update and it's gdb that is weird in using obsolete versions.

Eli> Also, I think this should be reviewed by someone who knows Python
Eli> better than I do (which is close to nothing), because this is not just
Eli> a documentation issue.

It's fine, I'm going to check it in momentarily.

Tom
  

Patch

diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index d86d679c35d..ddb347361f7 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -4698,8 +4698,8 @@  Arguments are separated by spaces and may be quoted.
 Example:
 
 @smallexample
-print(gdb.string_to_argv ("1 2\ \\\"3 '4 \"5' \"6 '7\""))
-['1', '2 "3', '4 "5', "6 '7"]
+print(gdb.string_to_argv (r"""1 2\ \"3 "4 '5" '6 "7'"""))
+['1', '2 "3', "4 '5", '6 "7']
 @end smallexample
 
 @end defun