[1/3] Documentation for Python -P commandline support

Message ID 20190721235427.21893-2-kevinb@redhat.com
State New, archived
Headers

Commit Message

Kevin Buettner July 21, 2019, 11:54 p.m. UTC
  gdb/doc/ChangeLog:

	* gdb.texinfo (Mode Options): Add documentation for -P.
---
 gdb/doc/gdb.texinfo | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Comments

Eli Zaretskii July 22, 2019, 2:41 p.m. UTC | #1
> From: Kevin Buettner <kevinb@redhat.com>
> Cc: Kevin Buettner <kevinb@redhat.com>
> Date: Sun, 21 Jul 2019 16:54:25 -0700
> 
> gdb/doc/ChangeLog:
> 
> 	* gdb.texinfo (Mode Options): Add documentation for -P.

Thanks.

> +Python as @code{sys.argv}.  This option is only available if Python
> +scripting support was enabled when @value{GDBN} was configured.

I'd say "when @value{GDBN} was built".  It's more clear, I think.

Otherwise, this part is OK, but we should also mention this in NEWS.
  
Simon Marchi July 22, 2019, 4:03 p.m. UTC | #2
On 2019-07-21 7:54 p.m., Kevin Buettner wrote:
> gdb/doc/ChangeLog:
> 
> 	* gdb.texinfo (Mode Options): Add documentation for -P.
> ---
>  gdb/doc/gdb.texinfo | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index eddd939869..868a1734de 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -1252,6 +1252,16 @@ for remote debugging.
>  Run using @var{device} for your program's standard input and output.
>  @c FIXME: kingdon thinks there is more to -tty.  Investigate.
>  
> +@item -P
> +@cindex @code{-P}
> +@itemx --python
> +@cindex @code{--python}
> +Change interpretation of command line so that the argument immediately
> +following this switch is taken to be the name of a Python script file.
> +This option stops option processing; subsequent options are passed to
> +Python as @code{sys.argv}.  This option is only available if Python
> +scripting support was enabled when @value{GDBN} was configured.
> +
>  @c resolve the situation of these eventually
>  @item -tui
>  @cindex @code{--tui}
> 

I think having an example would be helpful to understand how to use this
feature, and how it differs from -x.  It wasn't really obvious to me at first,
so I suspect it won't be for other people less familiar with GDB.

Simon
  

Patch

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index eddd939869..868a1734de 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -1252,6 +1252,16 @@  for remote debugging.
 Run using @var{device} for your program's standard input and output.
 @c FIXME: kingdon thinks there is more to -tty.  Investigate.
 
+@item -P
+@cindex @code{-P}
+@itemx --python
+@cindex @code{--python}
+Change interpretation of command line so that the argument immediately
+following this switch is taken to be the name of a Python script file.
+This option stops option processing; subsequent options are passed to
+Python as @code{sys.argv}.  This option is only available if Python
+scripting support was enabled when @value{GDBN} was configured.
+
 @c resolve the situation of these eventually
 @item -tui
 @cindex @code{--tui}