From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31265 invoked by alias); 1 Apr 2014 08:55:36 -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 31249 invoked by uid 89); 1 Apr 2014 08:55:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Apr 2014 08:55:33 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1WUuTh-0000Rq-Q0 from Yao_Qi@mentor.com ; Tue, 01 Apr 2014 01:55:29 -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); Tue, 1 Apr 2014 01:55:29 -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, 1 Apr 2014 01:55:28 -0700 Message-ID: <533A7E83.4070200@codesourcery.com> Date: Tue, 01 Apr 2014 08:55: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] Fix several "set remote foo-packet on/off" commands. References: <1396307414-2053-1-git-send-email-palves@redhat.com> In-Reply-To: <1396307414-2053-1-git-send-email-palves@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00003.txt.bz2 On 04/01/2014 07:10 AM, Pedro Alves wrote: > +/* Returns true if the multi-process extensions are in effect. */ > +static int > +remote_multi_process_p (struct remote_state *rs) > +{ > + return packet_support (PACKET_multiprocess_feature) == PACKET_ENABLE; > +} Argument 'rs' is not needed. We can remove it. However, your patch moves more gdb remote target states from 'struct remote_state' to a global state. I feel that it has conflict with the multi-target project. Not sure it is part of your plan to convert the global state to per-target state. > +# Test that setting a tracepoint while the trace experiment is ongoing > +# doesn't work when we force-disable the InstallInTrace RSP feature. > + > +proc tracepoint_install_in_trace_disabled { trace_type } { > + with_test_prefix "3 $trace_type" { > + global testfile > + global srcfile > + global pcreg > + global gdb_prompt > + > + clean_restart ${testfile} > + if ![runto_main] { > + fail "Can't run to main" > + return -1 > + } > + > + # This test only makes sense with the remote target. > + if ![gdb_is_target_remote] { > + return > + } > + > + gdb_test_no_output "delete break 1" > + > + # Set a tracepoint we'll never meet. Just to avoid the > + # complain after `tstart' later. > + gdb_test "next" ".*" > + gdb_test "trace main" \ > + "Tracepoint \[0-9\] at.* file .*$srcfile, line.*" \ > + "set tracepoint on main" > + > + gdb_test_no_output "tstart" > + > + # Force-disable the InstallInTrace RSP feature. > + gdb_test_no_output "set remote install-in-trace-packet off" > + > + # Set a tracepoint while a trace experiment is ongoing. > + set test "set tracepoint on set_tracepoint" > + gdb_test_multiple "${trace_type} set_tracepoint" $test { > + -re "Target returns error code .* too far .*$gdb_prompt $" { > + if [string equal $trace_type "ftrace"] { > + # The target was unable to install the fast tracepoint > + # (e.g., jump pad too far from tracepoint). > + pass "$test (too far)" A nit here, a fast tracepoint is not installed due to "jump pad too far" instead of "set remote install-in-trace-packet off". Do we want to emit a PASS here? IMO, UNSUPPORTED is better. Secondly, if "jump pad too far" causes fast tracepoint not installed, we should return here to skip the rest of the test, because the test below can't tell why a fast tracepoint is not installed, is it caused by "set remote install-in-trace-packet off" or "jump pad too far". > + } else { > + fail $test > + } > + } > + -re "\r\n$gdb_prompt $" { > + pass $test > + } > + } > + > + gdb_trace_setactions "set action for tracepoint" "" \ > + "collect \$$pcreg" "^$" > + > + # Make sure the tracepoint is _not_ installed on the target. > + gdb_test "info trace" \ > + "Num Type\[ \]+Disp Enb Address\[ \]+What.* > +\[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\.*3\.1.* in func4.*not installed on target.*3\.2.* in func4.*not installed on target.*" \ > + "tracepoint with two locations" > + } > +} > + -- Yao (齐尧)