From patchwork Mon Jul 20 11:35:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 7750 Received: (qmail 104301 invoked by alias); 20 Jul 2015 11:35:56 -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 104223 invoked by uid 89); 20 Jul 2015 11:35:56 -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-f45.google.com Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com) (209.85.220.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 20 Jul 2015 11:35:53 +0000 Received: by padck2 with SMTP id ck2so99887399pad.0 for ; Mon, 20 Jul 2015 04:35:51 -0700 (PDT) X-Received: by 10.70.136.129 with SMTP id qa1mr18161262pdb.81.1437392151361; Mon, 20 Jul 2015 04:35:51 -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.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Jul 2015 04:35:51 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 4/8] Test --wrapper when restarting process. Date: Mon, 20 Jul 2015 12:35:22 +0100 Message-Id: <1437392126-29503-5-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 My patch series will affect the code starting inferior in GDBserver (callees of start_inferior), so we need tests to cover how start_inferior is used in different cases. In server.c:process_serial_event, start_inferior is used when GBDserver receives 'R' packet, and this patch is to add a test for this path, and see how --wrapper option works when the process is restarted. gdb/testsuite: 2015-07-17 Yao Qi * gdb.server/ext-wrapper.exp: Test --wrapper option when restarting process. --- gdb/testsuite/gdb.server/ext-wrapper.exp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gdb/testsuite/gdb.server/ext-wrapper.exp b/gdb/testsuite/gdb.server/ext-wrapper.exp index 2ddd3a8..ac5f14a 100644 --- a/gdb/testsuite/gdb.server/ext-wrapper.exp +++ b/gdb/testsuite/gdb.server/ext-wrapper.exp @@ -47,6 +47,26 @@ gdb_test "run" "Breakpoint.* marker .*" "run to marker" gdb_test "print d" "\\$${decimal} = ${hex} \"1\".*" +# Restart the process. +with_test_prefix "restart" { + # Disable vRun packet and clear remote exec-file, so that GDB will + # use R packet to restart the process. + gdb_test_no_output "set remote run-packet off" + gdb_test_no_output "set remote exec-file" + set test "run to marker" + gdb_test_multiple "run" $test { + -re {Start it from the beginning\? \(y or n\) $} { + send_gdb "y\n" + exp_continue + } + -re "Breakpoint.* marker .*\r\n$gdb_prompt $" { + pass $test + } + } + + gdb_test "print d" "\\$${decimal} = ${hex} \"1\".*" +} + gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y" gdb_test_no_output "monitor exit"