From: Yao Qi <yao@codesourcery.com>
To: Pedro Alves <palves@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix several "set remote foo-packet on/off" commands.
Date: Tue, 01 Apr 2014 08:55:00 -0000 [thread overview]
Message-ID: <533A7E83.4070200@codesourcery.com> (raw)
In-Reply-To: <1396307414-2053-1-git-send-email-palves@redhat.com>
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.*\<MULTIPLE\>.*3\.1.* in func4.*not installed on target.*3\.2.* in func4.*not installed on target.*" \
> + "tracepoint with two locations"
> + }
> +}
> +
--
Yao (é½å°§)
next prev parent reply other threads:[~2014-04-01 8:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-31 23:53 Pedro Alves
2014-04-01 8:55 ` Yao Qi [this message]
2014-04-01 12:07 ` Pedro Alves
2014-04-01 12:25 ` [PATCH v2] " Pedro Alves
2014-04-28 19:16 ` Joel Brobecker
2014-04-29 1:01 ` Pedro Alves
2014-04-29 2:10 ` Hui Zhu
2014-04-29 12:53 ` Joel Brobecker
2014-04-29 13:07 ` Pedro Alves
2014-04-29 14:05 ` Joel Brobecker
2014-04-01 12:48 ` [PATCH] " Yao Qi
2014-04-25 18:04 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=533A7E83.4070200@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox