From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8135 invoked by alias); 21 Jun 2012 11:16:20 -0000 Received: (qmail 8127 invoked by uid 22791); 21 Jun 2012 11:16:19 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,FREEMAIL_FROM,KHOP_RCVD_UNTRUST,KHOP_THREADED,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_DKIM_INVALID X-Spam-Check-By: sourceware.org Received: from mail-we0-f169.google.com (HELO mail-we0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Jun 2012 11:16:06 +0000 Received: by wefh52 with SMTP id h52so426063wef.0 for ; Thu, 21 Jun 2012 04:16:05 -0700 (PDT) Received: by 10.180.105.6 with SMTP id gi6mr1495796wib.4.1340277365418; Thu, 21 Jun 2012 04:16:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.122.193 with HTTP; Thu, 21 Jun 2012 04:15:25 -0700 (PDT) In-Reply-To: <58272362.Fy9KhpX3fQ@qiyao.dyndns.org> References: <58272362.Fy9KhpX3fQ@qiyao.dyndns.org> From: Hui Zhu Date: Thu, 21 Jun 2012 11:16:00 -0000 Message-ID: Subject: Re: [PATCH] add testsuite for for backtrace commands with tfile to test the tfile memory read To: Yao Qi Cc: gdb-patches@sourceware.org, Pedro Alves Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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/msg00655.txt.bz2 On Wed, Jun 20, 2012 at 10:44 PM, Yao Qi wrote: > Hi, Hui, > > I got some fails with your patch applied, > > FAIL: gdb.trace/tfile.exp: tstart > FAIL: gdb.trace/tfile.exp: tstop > FAIL: gdb.trace/tfile.exp: load trace file bt.tf (GDB internal error) > FAIL: gdb.trace/tfile.exp: tfind 0 on trace file bt.tf > FAIL: gdb.trace/tfile.exp: backtrace on trace file bt.tf > > On Wednesday 20 June 2012 18:08:17 Hui Zhu wrote: >> gdb_test_no_output "tstart" > > You start tracing in native, which doesn't support tracepoint. > >> +gdb_test "break done_making_trace_files" ".*" "" >> +gdb_test "continue" ".*" "" >> +gdb_test_no_output "tstop" >> +gdb_test "tsave ./bt.tf" ".*" "" > > AFAIK, in tfile.exp, trace file is generated by tfile.c and GDB only cons= umes > these trace files (basic.tf and error.tf) for test purpose. > > -- > Yao (=E9=BD=90=E5=B0=A7) Thanks for your help. Post a new version according to your comments. Thanks, Hui 2012-06-21 Hui Zhu * gdb.trace/tfile.exp: Add new test for backtrace commands with tfile to test the tfile memory read. --- testsuite/gdb.trace/tfile.exp | 57 +++++++++++++++++++++++++++++++++++++= +++++ 1 file changed, 57 insertions(+) --- a/testsuite/gdb.trace/tfile.exp +++ b/testsuite/gdb.trace/tfile.exp @@ -117,3 +117,60 @@ Not looking at any trace frame.*" \ gdb_test \ "interpreter-exec mi \"-target-select tfile basic.tf\"" \ "\\^connected.*" + +#Test the backtrace commands with tfile to test the tfile memory read +if ![gdb_target_supports_trace] { + unsupported "target does not support trace" + return -1; +} + +if ![is_remote target] { + unsupported "target is not remote" + return -1; +} + +remote_file host delete bt.tf + +clean_restart ${testfile} + +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 tar= get" + 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" ".*" "" + +clean_restart ${testfile} + +gdb_test "target tfile bt.tf" "Created tracepoint.*" "load trace file bt.t= f" +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_sequence "backtrace" "backtrace on trace file bt.tf" { + "\[\r\n\]+#0 .* write_error_trace_file \(\)" + "\[\r\n\]+#1 .* main" +} + +remote_file host delete bt.tf