From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46878 invoked by alias); 6 Apr 2016 03:15:49 -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 46861 invoked by uid 89); 6 Apr 2016 03:15:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=BAYES_00,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=Hx-spam-relays-external:sk:cable-1, H*r:sk:cable-1, H*RU:sk:cable-1, 032 X-HELO: smtp.electronicbox.net Received: from smtp.electronicbox.net (HELO smtp.electronicbox.net) (96.127.255.82) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 06 Apr 2016 03:15:47 +0000 Received: from localhost.localdomain (cable-192.222.137.139.electronicbox.net [192.222.137.139]) by smtp.electronicbox.net (Postfix) with ESMTP id DB38E440E7F; Tue, 5 Apr 2016 23:15:45 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 2/4] Fix annota-input-while-running.exp remote check Date: Wed, 06 Apr 2016 03:15:00 -0000 Message-Id: <1459912543-15328-2-git-send-email-simon.marchi@polymtl.ca> In-Reply-To: <1459912543-15328-1-git-send-email-simon.marchi@polymtl.ca> References: <1459912543-15328-1-git-send-email-simon.marchi@polymtl.ca> X-SW-Source: 2016-04/txt/msg00109.txt.bz2 The comment says that we can't use runto_main here becore it doesn't know how to handle annotation. Instead, the test puts a breakpoint at main and calls run by hand. Therefore, it can't work with stub targets, since they can't "run". The check should be then changed to check the use_gdb_stub variable instead of [is_remote target]. But as an alternative, we can just use runto_main and enable annotations after, since the "run to main" part is not really part of what we want to test. I also removed the "set test..." line that is unused. gdb/testsuite/ChangeLog: * gdb.base/annota-input-while-running.exp: Don't check for [is_remote target]. Enable annotations after running to main. Remove unused "set test..." line. --- .../gdb.base/annota-input-while-running.exp | 25 ++++++---------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/gdb/testsuite/gdb.base/annota-input-while-running.exp b/gdb/testsuite/gdb.base/annota-input-while-running.exp index 9a0ca84..adc96e4 100644 --- a/gdb/testsuite/gdb.base/annota-input-while-running.exp +++ b/gdb/testsuite/gdb.base/annota-input-while-running.exp @@ -16,23 +16,18 @@ # Test that annotations support doesn't leave GDB's terminal settings # into effect when we run a foreground command. -if [is_remote target] then { - # We cannot use runto_main because of the different prompt we get - # when using annotation level 2. - return 0 -} - standard_testfile if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug] == -1} { return -1 } -# Break at main - -gdb_test "break main" \ - "Breakpoint.*at.* file .*$srcfile.*\\." \ - "breakpoint main" +# Because runto_main doesn't know how to handle the prompt with annotations, +# run to main before we set the annotation level. +if ![runto_main] then { +- fail "Can't run to main" +- return 1 +} # NOTE: this prompt is OK only when the annotation level is > 1 # NOTE: When this prompt is in use the gdb_test procedure cannot be @@ -59,16 +54,8 @@ proc gdb_annota_test {command pattern message} { } # Set the annotation level to 2. - -set test "annotation set at level 2" gdb_annota_test "set annotate 2" ".*" "annotation set at level 2" -# Run to main. - -gdb_annota_test "run" \ - "\r\n\032\032post-prompt.*\r\n\r\n\032\032stopped.*" \ - "run until main breakpoint" - set test "delete breakpoints" gdb_test_multiple "delete" $test { -re "Delete all breakpoints. .y or n." { -- 2.8.0