From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4985 invoked by alias); 20 Jun 2012 10:09:13 -0000 Received: (qmail 4977 invoked by uid 22791); 20 Jun 2012 10:09:11 -0000 X-SWARE-Spam-Status: No, hits=-4.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-wg0-f43.google.com (HELO mail-wg0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Jun 2012 10:08:58 +0000 Received: by wgbdr1 with SMTP id dr1so5811533wgb.12 for ; Wed, 20 Jun 2012 03:08:57 -0700 (PDT) Received: by 10.216.228.29 with SMTP id e29mr13179418weq.153.1340186937662; Wed, 20 Jun 2012 03:08:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.122.193 with HTTP; Wed, 20 Jun 2012 03:08:17 -0700 (PDT) From: Hui Zhu Date: Wed, 20 Jun 2012 10:09:00 -0000 Message-ID: Subject: [PATCH] add testsuite for for backtrace commands with tfile to test the tfile memory read To: gdb-patches ml Cc: Pedro Alves Content-Type: text/plain; charset=ISO-8859-1 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/msg00627.txt.bz2 Hi, This test is for the fix in http://sourceware.org/ml/gdb-patches/2012-06/msg00504.html I test it in amd64 and it work OK. Please help me review it. Best, Hui 2012-06-20 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 | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) --- a/testsuite/gdb.trace/tfile.exp +++ b/testsuite/gdb.trace/tfile.exp @@ -117,3 +117,55 @@ 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 +remote_file host delete bt.tf + +gdb_exit +gdb_start + +gdb_load $binfile + +runto_main + +gdb_delete_tracepoints +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 + +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"