From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28176 invoked by alias); 27 Jun 2013 14:02:42 -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 28142 invoked by uid 89); 27 Jun 2013 14:02:41 -0000 X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_XP autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 27 Jun 2013 14:02:41 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UsCmV-0000uh-NQ from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 27 Jun 2013 07:02:39 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 27 Jun 2013 07:02:39 -0700 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.2.247.3; Thu, 27 Jun 2013 07:02:38 -0700 From: Yao Qi To: Subject: [PATCH 1/3] Tweak gdb.trace/backtrace.exp Date: Thu, 27 Jun 2013 14:02:00 -0000 Message-ID: <1372341726-5485-2-git-send-email-yao@codesourcery.com> In-Reply-To: <1372341726-5485-1-git-send-email-yao@codesourcery.com> References: <1372341726-5485-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-06/txt/msg00820.txt.bz2 Hi, When I write test for command 'tdump' on selected frame, I find backtrace.exp is a good place. However, backtrace.exp needs some cleanups here and there. This is what this patch does. gdb/testsuite: 2013-06-27 Yao Qi * gdb.trace/backtrace.exp: Don't invoke 'get_exit' and 'gdb_start'. Invoke 'prepare_for_testing' instead of 'gdb_compile'. Use gdb_test_no_output to issue commands 'tstart' and 'tstop'. --- gdb/testsuite/gdb.trace/backtrace.exp | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp index e6447ac..5349f02 100644 --- a/gdb/testsuite/gdb.trace/backtrace.exp +++ b/gdb/testsuite/gdb.trace/backtrace.exp @@ -17,21 +17,20 @@ load_lib "trace-support.exp" +standard_testfile actions.c +set executable $testfile +set expfile $testfile.exp -gdb_exit -gdb_start +if [prepare_for_testing $expfile $executable $srcfile \ + [list debug nowarnings]] { + untested "failed to prepare for trace tests" + return -1 +} -standard_testfile actions.c -if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ - executable {debug nowarnings}] != "" } { - untested backtrace.exp +if ![runto_main] { + fail "Can't run to main to check for trace support" return -1 } -gdb_load $binfile -gdb_test "tstop" ".*" "" -gdb_test "tfind none" ".*" "" -runto_main -gdb_reinitialize_dir $srcdir/$subdir if { ![gdb_target_supports_trace] } then { unsupported "Current target does not support trace" @@ -156,14 +155,14 @@ gdb_trace_setactions "8.6: setup TP to collect stack mem cast expr" \ "$tdp6" \ "collect $fpreg, \(\*\(void \*\*\) \($spreg\)\) @ 64" "^$" -gdb_test "tstart" ".*" "" +gdb_test_no_output "tstart" "" gdb_test "break end" ".*" "" gdb_test "continue" \ "Continuing.*Breakpoint $decimal, end.*" \ "run trace experiment" -gdb_test "tstop" ".*" "" +gdb_test_no_output "tstop" "" proc gdb_backtrace_tdp_1 { msg } { global gdb_prompt -- 1.7.7.6