From patchwork Mon Jul 20 11:35:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 7747 Received: (qmail 103212 invoked by alias); 20 Jul 2015 11:35:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 103142 invoked by uid 89); 20 Jul 2015 11:35:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f46.google.com Received: from mail-pa0-f46.google.com (HELO mail-pa0-f46.google.com) (209.85.220.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 20 Jul 2015 11:35:45 +0000 Received: by pachj5 with SMTP id hj5so100437063pac.3 for ; Mon, 20 Jul 2015 04:35:44 -0700 (PDT) X-Received: by 10.70.133.98 with SMTP id pb2mr58529785pdb.2.1437392144151; Mon, 20 Jul 2015 04:35:44 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id db1sm21335338pdb.50.2015.07.20.04.35.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Jul 2015 04:35:43 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 1/8] Disallow using --attach and --wrapper together. Date: Mon, 20 Jul 2015 12:35:19 +0100 Message-Id: <1437392126-29503-2-git-send-email-yao.qi@linaro.org> In-Reply-To: <1437392126-29503-1-git-send-email-yao.qi@linaro.org> References: <1437392126-29503-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes gdb/gdbserver: 2015-07-15 Yao Qi * server.c (captured_main): Call gdbserver_usage and exit if attach is true and wrapper_argv isn't NULL. --- gdb/gdbserver/server.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 7e388dd..ce3ffb5 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -3481,6 +3481,15 @@ captured_main (int argc, char *argv[]) exit (1); } + if (attach && wrapper_argv != NULL) + { + /* Option --wrapper is used to start a new program, while option + --attach is used to attach to an existing process. Emit error + and quit when they are used together. */ + gdbserver_usage (stderr); + exit (1); + } + initialize_async_io (); initialize_low (); initialize_event_loop ();