From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44238 invoked by alias); 21 Mar 2015 02:35:02 -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 44220 invoked by uid 89); 21 Mar 2015 02:35:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 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; Sat, 21 Mar 2015 02:35:00 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2L2YwJ1026810 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 20 Mar 2015 22:34:59 -0400 Received: from x220.homelab.tallawa.org.com ([10.3.112.4]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2L2YppL029072; Fri, 20 Mar 2015 22:34:54 -0400 From: Cleber Rosa To: gdb-patches@sourceware.org Cc: crosa@redhat.com, areis@redhat.com Subject: [PATCH 0/4] GDBServer: introduce a dedicated stderr stream Date: Sat, 21 Mar 2015 02:35:00 -0000 Message-Id: <1426905265-8495-1-git-send-email-crosa@redhat.com> X-SW-Source: 2015-03/txt/msg00681.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. I appreciate any comments/questions/reviews. Thanks, 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/doc/gdb.texinfo | 13 +++++ 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 | 8 +-- gdb/gdbserver/mem-break.c | 4 +- gdb/gdbserver/notif.c | 4 +- gdb/gdbserver/remote-utils.c | 54 ++++++++++----------- gdb/gdbserver/server.c | 145 +++++++++++++++++++++++++++++++++++++------------------ gdb/gdbserver/server.h | 4 ++ gdb/gdbserver/spu-low.c | 14 +++--- gdb/gdbserver/target.c | 4 +- gdb/gdbserver/thread-db.c | 4 +- gdb/gdbserver/utils.c | 25 +++++----- gdb/testsuite/gdb.server/server-mon.exp | 8 +++