From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126701 invoked by alias); 25 Mar 2015 20:48:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 126684 invoked by uid 89); 25 Mar 2015 20:48:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD,UNSUBSCRIBE_BODY autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 25 Mar 2015 20:48:20 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2PKmI3W018729 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 25 Mar 2015 16:48:19 -0400 Received: from x220.homelab.tallawa.org.com (ovpn-112-23.phx2.redhat.com [10.3.112.23]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2PKmB3q008768; Wed, 25 Mar 2015 16:48:13 -0400 From: Cleber Rosa To: gdb-patches@sourceware.org Cc: crosa@redhat.com, areis@redhat.com Subject: [PATCH v2 0/3] GDBServer: introduce a dedicated output stream Date: Wed, 25 Mar 2015 20:48:00 -0000 Message-Id: <1427316472-20629-1-git-send-email-crosa@redhat.com> X-SW-Source: 2015-03/txt/msg00832.txt.bz2 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(-)