From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2844 invoked by alias); 29 Jul 2014 10:07:26 -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 2828 invoked by uid 89); 29 Jul 2014 10:07:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 29 Jul 2014 10:07:24 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6TA7MAB017072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Jul 2014 06:07:22 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6TA7Kta018238; Tue, 29 Jul 2014 06:07:21 -0400 Message-ID: <53D77258.60306@redhat.com> Date: Tue, 29 Jul 2014 10:27:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Yao Qi , Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] make "set debug target" take effect immediately References: <1406574267-5212-1-git-send-email-tromey@redhat.com> <53D74AE0.3050404@codesourcery.com> In-Reply-To: <53D74AE0.3050404@codesourcery.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-07/txt/msg00714.txt.bz2 On 07/29/2014 08:18 AM, Yao Qi wrote: > On 07/29/2014 03:04 AM, Tom Tromey wrote: >> diff --git a/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp b/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp >> index a196f68..dd793bd 100644 >> --- a/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp >> +++ b/gdb/testsuite/gdb.base/sss-bp-on-user-bp-2.exp >> @@ -76,7 +76,7 @@ if { $hardware_step } { >> return >> } >> >> -gdb_test_no_output "set debug target 0" >> +gdb_test "set debug target 0" "->to_log_command.*\\)" >> >> set line_re "\[^\r\n\]*" > > Tom, > Beside this change, we still need to update the pattern to match the > output of "set debug target 1". We match "target_resume " nowadays, > but it doesn't exist in the output at all, because of the recent target > delegation changes. In sss-bp-on-user-bp-2.exp, we have > > gdb_test_no_output "set debug target 1" > set hardware_step 0 > set test "probe target hardware step" > gdb_test_multiple "si" $test { > -re "target_resume \\(\[^\r\n\]+, step, .*$gdb_prompt $" { > ^^^^^^^^^^^^^ > set hardware_step 1 > pass $test > } > -re "$gdb_prompt $" { > pass $test > } > } > > We need to replace "target_resume" with "to_resume" in the pattern, > otherwise, hardware_step is always zero, which is wrong. Definitely. Thanks for noticing that. > Even > hardware_step is zero on x86, the test only fails once in about 10 runs. > That may be the reason we didn't find the mistake before. Yep. For reference, git 829155c9 says: "The problem is that we had just resumed the target and the native GNU/Linux target can't read memory off of a running thread. Most of the time, we get "lucky", because we manage to read memory before the kernel actually schedules the target to run." -- Thanks, Pedro Alves