From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8182 invoked by alias); 31 Jul 2013 00:47:37 -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 8167 invoked by uid 89); 31 Jul 2013 00:47:36 -0000 X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_50,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 31 Jul 2013 00:47:36 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1V4KZc-0003hI-1s from Yao_Qi@mentor.com ; Tue, 30 Jul 2013 17:47:28 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 30 Jul 2013 17:47:27 -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.2.247.3; Tue, 30 Jul 2013 17:47:27 -0700 Message-ID: <51F85E71.3060301@codesourcery.com> Date: Wed, 31 Jul 2013 00:47:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Pedro Alves CC: Subject: Re: [PATCH 3/3] Select the current frame in command tdump. References: <1372341726-5485-1-git-send-email-yao@codesourcery.com> <1372341726-5485-4-git-send-email-yao@codesourcery.com> <51F68DE4.4010405@redhat.com> <51F7BE1B.9050602@codesourcery.com> <51F7C00D.5010009@redhat.com> In-Reply-To: <51F7C00D.5010009@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-SW-Source: 2013-07/txt/msg00804.txt.bz2 On 07/30/2013 09:30 PM, Pedro Alves wrote: > "still works". > > Suggest: > > Test that the 'tdump' command still works Fixed. Patch 1/3 and 2/3 are committed. Patch 3/3 is committed too with the typo fix in comment. -- Yao (齐尧) gdb: 2013-07-31 Pedro Alves Yao Qi * tracepoint.c (trace_dump_command): Select the current frame. gdb/testsuite: 2013-07-31 Yao Qi * gdb.trace/backtrace.exp (gdb_backtrace_tdp_4): Test command 'tdump' on stack frame 0 and 1 respectively. --- gdb/testsuite/gdb.trace/backtrace.exp | 31 +++++++++++++++++++++++++++++++ gdb/tracepoint.c | 6 ++++++ 2 files changed, 37 insertions(+), 0 deletions(-) diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp index e40428f..c3a7ec3 100644 --- a/gdb/testsuite/gdb.trace/backtrace.exp +++ b/gdb/testsuite/gdb.trace/backtrace.exp @@ -230,6 +230,37 @@ proc gdb_backtrace_tdp_4 { msg depth traceframe } { fail "$msg (fewer than $depth stack frames found)" } } + + set output_string0 "" + # Match the output of command 'tdump' and save it in + # $output_string0. + set test "tdump on frame 0" + gdb_test_multiple "tdump" $test { + -re "tdump\[\r\n\]+(.*)\[\r\n\]+$gdb_prompt $" { + set output_string0 $expect_out(1,string) + } + } + + gdb_test "up" ".*" "" + + # Test that command 'tdump' still works properly when the + # selected frame is not the current frame, and save the output + # in $output_string1. + set test "tdump on frame 1" + set output_string1 "" + gdb_test_multiple "tdump" $test { + -re "tdump\[\r\n\]+(.*)\[\r\n\]+$gdb_prompt $" { + set output_string1 $expect_out(1,string) + } + } + + # Output of 'tdump' on frame 0 and frame 1 should be + # identical. + if ![string compare $output_string0 $output_string1] { + pass "tdump output" + } else { + fail "tdump output" + } } } diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 8b70bd3..ce61fb7 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -3065,6 +3065,12 @@ trace_dump_command (char *args, int from_tty) tracepoint_number, traceframe_number); old_chain = make_cleanup (null_cleanup, NULL); + + /* This command only makes sense for the current frame, not the + selected frame. */ + make_cleanup_restore_current_thread (); + select_frame (get_current_frame ()); + actions = all_tracepoint_actions_and_cleanup (loc->owner); trace_dump_actions (actions, 0, stepping_frame, from_tty); -- 1.7.7.6