From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28214 invoked by alias); 20 Jun 2012 14:19:10 -0000 Received: (qmail 28203 invoked by uid 22791); 20 Jun 2012 14:19:08 -0000 X-SWARE-Spam-Status: No, hits=-4.3 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, 20 Jun 2012 14:18:47 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1ShLk6-0000KE-JX from Yao_Qi@mentor.com ; Wed, 20 Jun 2012 07:18:46 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 20 Jun 2012 07:18:06 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.1.289.1; Wed, 20 Jun 2012 07:18:45 -0700 From: Yao Qi To: CC: Hui Zhu , Pedro Alves Subject: Re: [PATCH] add testsuite for for backtrace commands with tfile to test the tfile memory read Date: Wed, 20 Jun 2012 14:19:00 -0000 Message-ID: <13678176.r1QDgNNRvQ@qiyao.dyndns.org> User-Agent: KMail/4.8.3 (Linux/3.3.7-1.fc16.i686; KDE/4.8.3; i686; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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: 2012-06/txt/msg00631.txt.bz2 On Wednesday 20 June 2012 18:08:17 Hui Zhu wrote: > +#Test the backtrace commands with tfile to test the tfile memory read > +remote_file host delete bt.tf It is better to remove temp files when the test is about to finish. > + > +gdb_exit > +gdb_start > + > +gdb_load $binfile > + These three can be replaced with "clean_restart". > +runto_main > + > +gdb_delete_tracepoints Is it needed? IIRC, all breakpoints are removed inside runto_main. > +set tp1 [gdb_gettpnum write_error_trace_file]; > + > +if { [istarget i?86-*-*] } { > + gdb_trace_setactions "Set actions for collect stack" \ > + "$tp1" \ > + "collect *(unsigned char *)\$esp@128" "^$" > +} elseif {[istarget x86_64-*-* ]} { > + gdb_trace_setactions "Set actions for collect stack" \ > + "$tp1" \ > + "collect *(unsigned char *)\$rsp@128" "^$" > +} elseif {[istarget arm*-*-* ] || [istarget mips*-*-* ]} { > + gdb_trace_setactions "Set actions for collect stack" \ > + "$tp1" \ > + "collect *(unsigned char *)\$sp@128" "^$" > +} else { > + unsupported "don't know howto use tracepoint collect stack in this > target" + continue > +} > + > +gdb_test_no_output "tstart" > +gdb_test "break done_making_trace_files" ".*" "" > +gdb_test "continue" ".*" "" > +gdb_test_no_output "tstop" > +gdb_test "tsave ./bt.tf" ".*" "" > + > +gdb_exit > +gdb_start > + > +gdb_load $binfile clean_restart > + > +gdb_test "target tfile bt.tf" "Created tracepoint.*" "load trace file > bt.tf" +gdb_test "tfind 0" \ > + "Found trace frame 0, tracepoint \[0-9\]+. > +\#0 write_error_trace_file ().*" \ > + "tfind 0 on trace file bt.tf" > + > +gdb_test "backtrace" \ > +"\#0 write_error_trace_file ().* > +\#1 .* in main .*" \ > + "backtrace on trace file bt.tf" gdb_test_sequence is convenient to match the output of bt. --=20 Yao (=E9=BD=90=E5=B0=A7)