public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: gdb-patches@sourceware.org
Subject: [RFAv4 0/5] Implement | (pipe) command.
Date: Thu, 30 May 2019 14:21:00 -0000	[thread overview]
Message-ID: <20190530142106.25487-1-philippe.waroquiers@skynet.be> (raw)

Implement | (pipe) command.

This patch series adds the pipe command, that allows to send the output
of a GDB command to a shell command.

This is the fourth version of the patch, handling the additional
comments of Pedro.
The doc, help and NEWS are changed in this fourth version, so must be
re-reviewed.

* Main changes in this version:
  * Reworded the help, manual and code, e.g. use -d DELIM instead of -d SEP.
    Also, stopped forcing GDB users to read Ada syntax :).
  * Removed the patch related to WIF* macros on MinGW.
  * Reworked the arg parsing logic in pipe command.

--- Previous versions:
* Comments of Pedro:
  * Implement -d SEP (SEP being a string) instead of -dX.
  * popen has been kept as libiberty pexecute still implies to use
    the WIF* macros.  However, exit status handling reworked to go via
    convenience variables, rather than being shown to the user.
  * various small changes (== '\0', Skip, ...).
  * simplified error messages to just indicate with a static string
    what argument is wrong or missing.
  * extended the test to verify all error handling messages and check
    the new convenience variables $_shell_exitcode and $_shell_exitsignal.

* Comments from Eli :
   * better definition of WIF* macros for MinGW.
   * replace @ref by @xref in the doc.

* Comment from Abhijit Halder/Tom:
   * it not that unlikely to have | in a GDB command
     => an optional -d SEP option allows to specify an
     alternate string to use SEP to replace the | as separator
     between the GDB COMMAND and the SHELL_COMMAND.

* Comments from Tom:
  * make previous_saved_command_line static. For this, saved_command_line
    is now also static, and all repeat related functions/vars are now
    in top.c
  * various small changes (use std::swap, strchr, .empty (), ...).
  * removed the scoped_restore_current_thread restore
  * popen has been kept as libiberty pexecute still implies to use
    the WIF* macros.
  * Instead of using execute_command_to_string, use GDB redirection
    mechanism.  I did several trials for this, and at the end,
    the only one working properly was very close to the code
    of execute_command_to_string.
    => we now have a function execute_command_to_ui_file that is used
    to implement the pipe command, and also used by
    execute_command_to_string.


             reply	other threads:[~2019-05-30 14:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30 14:21 Philippe Waroquiers [this message]
2019-05-30 14:21 ` [RFAv4 3/5] " Philippe Waroquiers
2019-05-30 14:21 ` [RFAv4 1/5] Add previous_saved_command_line to allow a command to repeat a previous command Philippe Waroquiers
2019-05-30 14:21 ` [RFAv4 2/5] Add function execute_command_to_ui_file Philippe Waroquiers
2019-05-30 14:21 ` [RFAv4 5/5] NEWS and documentation for | (pipe) command Philippe Waroquiers
2019-05-30 15:02   ` Eli Zaretskii
2019-05-31 14:39   ` Pedro Alves
2019-05-30 14:21 ` [RFAv4 4/5] Test the " Philippe Waroquiers
2019-05-31 14:42 ` [RFAv4 0/5] Implement " Pedro Alves
2019-05-31 15:29   ` Philippe Waroquiers

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=20190530142106.25487-1-philippe.waroquiers@skynet.be \
    --to=philippe.waroquiers@skynet.be \
    --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).