This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFAv2 0/6] Implement | (pipe) command.
- From: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- To: gdb-patches at sourceware dot org
- Date: Fri, 26 Apr 2019 22:11:02 +0200
- Subject: [RFAv2 0/6] Implement | (pipe) command.
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 version handles the comments received.
As there is a new option -dX to the pipe_command, the doc and help
was changed to describe it.
* 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 -dX option allows to specify an
alternate character to use X 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.