public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andrew Burgess <aburgess@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCHv2 11/14] gdb: allow 'set args' and run commands to contain newlines
Date: Mon, 04 Nov 2024 18:52:19 +0200	[thread overview]
Message-ID: <864j4nuekc.fsf@gnu.org> (raw)
In-Reply-To: <90598ecf0ece00f01d373e15dc4a5c09b7f8d429.1730731085.git.aburgess@redhat.com> (message from Andrew Burgess on Mon, 4 Nov 2024 14:45:55 +0000)

> From: Andrew Burgess <aburgess@redhat.com>
> Cc: Andrew Burgess <aburgess@redhat.com>,
> 	Eli Zaretskii <eliz@gnu.org>
> Date: Mon,  4 Nov 2024 14:45:55 +0000
> 
> When starting GDB it is possible to set an inferior argument that
> contains a newline, for example:
> 
>   shell> gdb --args my.app "abc
>   > def"
>   ...
>   (gdb) show args
>   Argument list to give program being debugged when it is started is "abc'
>   'def".
> 
> However, once GDB is started, the only way to install an argument
> containing a newline is to use the Python API.
> 
> This commit changes that.
> 
> After this commit 'set args' as well as 'run', 'start', and 'starti',
> will now accept multi-line inferior arguments, e.g.:
> 
>   (gdb) set args "abc
>   > def"
>   (gdb) show args
>   Argument list to give program being debugged when it is started is ""abc
>   def"".
> 
> And also:
> 
>   (gdb) run "abc
>   > def"
>   ... etc ...
> 
> Once GDB has presented the secondary prompt to gather the remaining
> inferior arguments then it is possible for the user to quit argument
> entry by sending SIGINT (usually, Ctrl-c), or sending EOF (usually,
> Ctrl-d).  For the 'set args' case this will abort the argument change,
> leaving the arguments as they were previously.  For the run style
> commands, this aborts the run command completely, the inferior is not
> changed, and the partially collected arguments are not installed.
> 
> Reviewed-By: Eli Zaretskii <eliz@gnu.org>
> ---
>  gdb/NEWS                                 |   8 ++
>  gdb/doc/gdb.texinfo                      |  20 ++++
>  gdb/infcmd.c                             | 140 +++++++++++++++++++++--
>  gdb/testsuite/gdb.base/inferior-args.exp |  71 +++++++++++-
>  4 files changed, 229 insertions(+), 10 deletions(-)

Apologies for my failing memory: did we discuss the need to say in the
manual that this will only work on some systems?  I think on Windows
it won't work, because Windows doesn't support command lines with
embedded newlines.

  reply	other threads:[~2024-11-04 16:52 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 14:26 [PATCH 00/16] Inferior argument (inc for remote targets) changes Andrew Burgess
2024-01-09 14:26 ` [PATCH 01/16] libiberty/buildargv: POSIX behaviour for backslash handling Andrew Burgess
2024-01-09 14:26 ` [PATCH 02/16] gdb/testsuite: add some xfail in gdb.base/startup-with-shell.exp Andrew Burgess
2024-01-09 14:26 ` [PATCH 03/16] gdb: Support some escaping of args with startup-with-shell being off Andrew Burgess
2024-01-09 14:26 ` [PATCH 04/16] gdb: remove the !startup_with_shell path from construct_inferior_arguments Andrew Burgess
2024-01-21  3:56   ` Keith Seitz
2024-10-18 15:09     ` Andrew Burgess
2024-01-09 14:26 ` [PATCH 05/16] gdbserver: convert program_args to a single string Andrew Burgess
2024-01-09 14:26 ` [PATCH 06/16] gdbsupport: have construct_inferior_arguments take an escape function Andrew Burgess
2024-01-09 14:26 ` [PATCH 07/16] gdbsupport: split escape_shell_characters in two Andrew Burgess
2024-01-09 14:26 ` [PATCH 08/16] gdb: move remote arg splitting and joining into gdbsupport/ Andrew Burgess
2024-01-21  3:57   ` Keith Seitz
2024-10-18 15:21     ` Andrew Burgess
2024-01-09 14:26 ` [PATCH 09/16] gdb/python: change escaping rules when setting arguments Andrew Burgess
2024-01-09 16:30   ` Eli Zaretskii
2024-01-09 14:26 ` [PATCH 10/16] gdb: add remote argument passing self tests Andrew Burgess
2024-01-21  3:57   ` Keith Seitz
2024-10-18 15:23     ` Andrew Burgess
2024-01-09 14:26 ` [PATCH 11/16] gdb/gdbserver: pass inferior arguments as a single string Andrew Burgess
2024-01-09 16:34   ` Eli Zaretskii
2024-01-09 16:35   ` Eli Zaretskii
2024-01-09 14:26 ` [PATCH 12/16] gdb/gdbserver: add a '--no-escape-args' command line option Andrew Burgess
2024-01-09 16:43   ` Eli Zaretskii
2024-01-21  3:57   ` Keith Seitz
2024-10-18 15:31     ` Andrew Burgess
2024-01-09 14:26 ` [PATCH 13/16] gdb: allow 'set args' and run commands to contain newlines Andrew Burgess
2024-01-09 16:44   ` Eli Zaretskii
2024-01-21  3:57   ` Keith Seitz
2024-10-23 13:01     ` Andrew Burgess
2024-10-25 16:15       ` Keith Seitz
2024-10-30 15:57         ` Andrew Burgess
2024-01-09 14:26 ` [PATCH 14/16] gdb/gdbserver: remove some uses of free_vector_argv Andrew Burgess
2024-01-09 14:26 ` [PATCH 15/16] gdb: new maintenance command to help debug remote argument issues Andrew Burgess
2024-01-09 16:32   ` Eli Zaretskii
2024-01-21  3:57   ` Keith Seitz
2024-10-23 15:34     ` Andrew Burgess
2024-10-25 17:25       ` Keith Seitz
2024-10-30 15:58         ` Andrew Burgess
2024-01-09 14:26 ` [PATCH 16/16] gdb/gdbserver: rework argument splitting and joining Andrew Burgess
2024-01-09 16:37   ` Eli Zaretskii
2024-01-21  3:57   ` Keith Seitz
2024-10-18 15:39     ` Andrew Burgess
2024-01-09 16:58 ` [PATCH 00/16] Inferior argument (inc for remote targets) changes Eli Zaretskii
2024-01-20 22:46   ` Andrew Burgess
2024-01-21 10:22     ` Eli Zaretskii
2024-01-22 10:29       ` Andrew Burgess
2024-01-10  8:28 ` Michael Weghorn
2024-01-21  3:56 ` Keith Seitz
2024-11-04 14:45 ` [PATCHv2 00/14] " Andrew Burgess
2024-11-04 14:45   ` [PATCHv2 01/14] gdb/testsuite: add some xfail in gdb.base/startup-with-shell.exp Andrew Burgess
2024-11-04 14:45   ` [PATCHv2 02/14] gdb: Support some escaping of args with startup-with-shell being off Andrew Burgess
2024-11-04 14:45   ` [PATCHv2 03/14] gdb: remove the !startup_with_shell path from construct_inferior_arguments Andrew Burgess
2024-11-04 14:45   ` [PATCHv2 04/14] gdbserver: convert program_args to a single string Andrew Burgess
2024-11-04 14:45   ` [PATCHv2 05/14] gdb: move remote arg splitting and joining into gdbsupport/ Andrew Burgess
2024-11-04 14:45   ` [PATCHv2 06/14] gdb: add remote argument passing self tests Andrew Burgess
2024-11-04 14:45   ` [PATCHv2 07/14] gdb: split up construct_inferior_arguments Andrew Burgess
2024-11-04 14:45   ` [PATCHv2 08/14] gdb/python: change escaping rules when setting arguments Andrew Burgess
2024-11-04 14:45   ` [PATCHv2 09/14] gdb/gdbserver: pass inferior arguments as a single string Andrew Burgess
2024-11-04 14:45   ` [PATCHv2 10/14] gdb/gdbserver: add a '--no-escape-args' command line option Andrew Burgess
2024-11-04 14:45   ` [PATCHv2 11/14] gdb: allow 'set args' and run commands to contain newlines Andrew Burgess
2024-11-04 16:52     ` Eli Zaretskii [this message]
2024-11-04 14:45   ` [PATCHv2 12/14] gdb/gdbserver: remove some uses of free_vector_argv Andrew Burgess
2024-11-04 14:45   ` [PATCHv2 13/14] gdb: new maintenance command to help debug remote argument issues Andrew Burgess
2024-11-04 14:45   ` [PATCHv2 14/14] gdb/gdbserver: rework argument splitting and joining Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=864j4nuekc.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).