This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v2 0/3] GDBServer: introduce a dedicated output stream
- From: Cleber Rosa <crosa at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: crosa at redhat dot com, areis at redhat dot com
- Date: Wed, 25 Mar 2015 17:47:49 -0300
- Subject: [PATCH v2 0/3] GDBServer: introduce a dedicated output stream
- Authentication-results: sourceware.org; auth=none
This patch series add command line options and monitor commands that
will redirect all of the gdbserver's own output (always sent to
stderr) to a separate file. This feature makes it possible to
distinguish between the inferior process stderr and gdbserver's own
stderr.
This happens to be needed for the Avocado[1] project GDB
support[2][3]. One of Avocado's GDB features is that it lets users
"transparently" run binaries instrumented by GDB. A test that
executes binaries can give the user the opportunity to interact with
the process running within gdb(server). This uses a combination of
gdb (with MI) and gdbserver. So far so good.
But, since Avocado is a test framework, it lets tests PASS or FAIL
depending on executed commands' STDERR and STDOUT matching what the
test writer expects. Matching against STDOUT is already doable as
gdbserver doesn't write to stdout, but it does write to stderr, the
same stderr that the inferior process writes to.
This is what happened to each of the patches from the first version:
[PATCH 1/4] GDBServer: introduce a stderr stream dedicated to the server
* Renamed server_stderr to server_output.
* lynx-low.c (lynx_debug): New substitution of stderr with
server_output.
* nto-low.c (nto_trace): Likewise.
* tracepoint.c: Define server_output as an alias of stderr
when compiling the IPA.
(trace_vdebug): Replace stderr with server_output.
* win32-low.c (OUTMSG): Changed definition of macro to also
use server_output instead of stderr.
(OUTMSG2): Likewise.
* wincecompat.c (perror): Likewise.
[PATCH 2/4] GDBServer: give more complete usage information
* Dropped. Pedro sent a new and better version to the
list. Obviously this version 2 now is 3 patches long.
[PATCH 3/4] GDBServer: introduce --server-stderr command line option
* Renamed --server-stderr to --server-output.
* Better document the new features by making it clear that the
server output can be redirected to another file. In other
words, stderr is really an implementation detail.
* Replaced mentions of PATH for FILE in the documentation and
in the command line option usage message.
* Replace variables named path to out(put)_filename.
* Renamed redirection utility function from set_server_stderr
to set_server_output to keep it in sync with command line
and
[PATCH 4/4]: GDBServer: add 'monitor set server-stderr' command
* Monitor command renamed to "monitor set server-output" from "monitor
set server-stderr"
So now we have on this series v2:
[PATCH v2 3/3] GDBServer: add 'monitor set server-output' command
[PATCH v2 2/3] GDBServer: introduce --server-output command line option
[PATCH v2 3/3] GDBServer: introduce a stream dedicated to the server
Thanks (again),
Cleber Rosa.
[1] - http://github.com/avocado-framework
[2] - http://avocado-framework.readthedocs.org/en/latest/DebuggingWithGDB.html
[3] - https://github.com/avocado-framework/avocado/blob/master/avocado/gdb.py
---
gdb/NEWS | 7 ++++
gdb/doc/gdb.texinfo | 20 +++++++++++
gdb/gdbserver/ax.c | 3 +-
gdb/gdbserver/debug.c | 6 ++--
gdb/gdbserver/event-loop.c | 2 +-
gdb/gdbserver/linux-aarch64-low.c | 28 ++++++++--------
gdb/gdbserver/linux-low.c | 10 +++---
gdb/gdbserver/lynx-low.c | 14 ++++----
gdb/gdbserver/mem-break.c | 4 +--
gdb/gdbserver/notif.c | 4 +--
gdb/gdbserver/nto-low.c | 4 +--
gdb/gdbserver/remote-utils.c | 54 +++++++++++++++---------------
gdb/gdbserver/server.c | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++------------------------
gdb/gdbserver/server.h | 4 +++
gdb/gdbserver/spu-low.c | 14 ++++----
gdb/gdbserver/target.c | 4 +--
gdb/gdbserver/thread-db.c | 4 +--
gdb/gdbserver/tracepoint.c | 4 ++-
gdb/gdbserver/utils.c | 25 +++++++-------
gdb/gdbserver/win32-low.c | 6 ++--
gdb/gdbserver/wincecompat.c | 4 +--
gdb/testsuite/gdb.server/server-mon.exp | 8 +++++
22 files changed, 227 insertions(+), 137 deletions(-)