From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28908 invoked by alias); 13 Mar 2013 09:55:58 -0000 Received: (qmail 28833 invoked by uid 22791); 13 Mar 2013 09:55:57 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Mar 2013 09:55:50 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UFiPV-0002IP-VV from Yao_Qi@mentor.com ; Wed, 13 Mar 2013 02:55:50 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 13 Mar 2013 02:55:49 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Wed, 13 Mar 2013 02:55:48 -0700 Message-ID: <51404CE2.8000008@codesourcery.com> Date: Wed, 13 Mar 2013 09:55:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Tom Tromey CC: Subject: Re: [PATCH v3 14/15] Test on saving tracepoint defs: CTF References: <1362800844-27940-1-git-send-email-yao@codesourcery.com> <1362800844-27940-15-git-send-email-yao@codesourcery.com> <87zjy8cqq7.fsf@fleche.redhat.com> In-Reply-To: <87zjy8cqq7.fsf@fleche.redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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 X-SW-Source: 2013-03/txt/msg00568.txt.bz2 On 03/13/2013 04:23 AM, Tom Tromey wrote: > standard_output_file if you don't mind. > 'standard_output_file' is used in the patch 13/15, and save the file name in 'tracefile'. We use $tracefile here. > Yao> +gdb_test_multiple "target ctf ${testfile}.ctf" "" { > Yao> + -re "Undefined target command: \"ctf ${testfile}.ctf\"\. Try \"help target\"\.\r\n$gdb_prompt $" { > Yao> + } > Yao> + -re ".*\r\n$gdb_prompt $" { > Yao> + gdb_exit > Yao> + gdb_start > Yao> + gdb_reinitialize_dir $srcdir/$subdir > Yao> + gdb_file_cmd $binfile > Yao> + gdb_test "target ctf ${testfile}.ctf" ".*" \ > Yao> + "change to ctf target" > Yao> + check_tracepoint "ctf" > > It seems very iffy to me to restart gdb inside a call to gdb_test_multiple. > I would instead recommend setting a flag and checking it outside this > command. Fixed as you suggested. -- Yao (齐尧) gdb/testsuite: 2013-03-11 Yao Qi * gdb.trace/actions.exp: Save trace data to CTF. Change to ctf target if GDB supports, read CTF data in ctf target, and check the actions of tracepoints. * gdb.trace/while-stepping.exp: Likewise. --- gdb/testsuite/gdb.trace/actions.exp | 23 +++++++++++++++++++++++ gdb/testsuite/gdb.trace/while-stepping.exp | 23 +++++++++++++++++++++++ 2 files changed, 46 insertions(+), 0 deletions(-) diff --git a/gdb/testsuite/gdb.trace/actions.exp b/gdb/testsuite/gdb.trace/actions.exp index 5fa1b97..74db104 100644 --- a/gdb/testsuite/gdb.trace/actions.exp +++ b/gdb/testsuite/gdb.trace/actions.exp @@ -310,6 +310,8 @@ gdb_test_no_output "tstop" "" set tracefile [standard_output_file ${testfile}] gdb_test "tsave ${tracefile}.tf" \ "Trace data saved to file '${tracefile}.tf'\.\\r" +gdb_test "tsave -ctf ${tracefile}.ctf" \ + "Trace data saved to directory '${tracefile}.ctf'\.\\r" # Restart GDB and read the trace data in tfile target. gdb_exit @@ -319,3 +321,24 @@ gdb_file_cmd $binfile gdb_test "target tfile ${tracefile}.tf" ".*" \ "change to tfile target" check_tracepoint "tfile" + +# Try to read ctf data if GDB supports. +set gdb_can_read_ctf_data 0 +gdb_test_multiple "target ctf" "" { + -re "Undefined target command: \"ctf\"\. Try \"help target\"\.\r\n$gdb_prompt $" { + set gdb_can_read_ctf_data 0 + } + -re "No CTF directory specified.*\r\n$gdb_prompt $" { + set gdb_can_read_ctf_data 1 + } +} + +if { $gdb_can_read_ctf_data } { + gdb_exit + gdb_start + gdb_reinitialize_dir $srcdir/$subdir + gdb_file_cmd $binfile + gdb_test "target ctf ${tracefile}.ctf" ".*" \ + "change to ctf target" + check_tracepoint "ctf" +} diff --git a/gdb/testsuite/gdb.trace/while-stepping.exp b/gdb/testsuite/gdb.trace/while-stepping.exp index 0b823a4..c74281f 100644 --- a/gdb/testsuite/gdb.trace/while-stepping.exp +++ b/gdb/testsuite/gdb.trace/while-stepping.exp @@ -136,6 +136,8 @@ set tracefile [standard_output_file ${testfile}] gdb_test "tsave ${tracefile}.tf" \ "Trace data saved to file '${tracefile}.tf'\.\\r" \ "save tfile trace file" +gdb_test "tsave -ctf ${tracefile}.ctf" \ + "Trace data saved to directory '${tracefile}.ctf'\.\\r" # Restart GDB and read the trace data in tfile target. gdb_exit @@ -145,3 +147,24 @@ gdb_file_cmd $binfile gdb_test "target tfile ${tracefile}.tf" ".*" \ "change to tfile target" check_tracepoint "tfile" + +# Try to read ctf data if GDB supports. +set gdb_can_read_ctf_data 0 +gdb_test_multiple "target ctf" "" { + -re "Undefined target command: \"ctf\"\. Try \"help target\"\.\r\n$gdb_prompt $" { + set gdb_can_read_ctf_data 0 + } + -re "No CTF directory specified.*\r\n$gdb_prompt $" { + set gdb_can_read_ctf_data 1 + } +} + +if { $gdb_can_read_ctf_data } { + gdb_exit + gdb_start + gdb_reinitialize_dir $srcdir/$subdir + gdb_file_cmd $binfile + gdb_test "target ctf ${tracefile}.ctf" ".*" \ + "change to ctf target" + check_tracepoint "ctf" +} -- 1.7.7.6