From: Hui Zhu <hui_zhu@mentor.com>
To: Pedro Alves <palves@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] testsuite tfind.exp: If current target don't support trace, try gdbserver.
Date: Thu, 29 Mar 2012 14:02:00 -0000 [thread overview]
Message-ID: <4F746B2A.6000302@mentor.com> (raw)
In-Reply-To: <4F742F7D.1070602@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1652 bytes --]
Hi Pedro,
On 03/29/12 17:46, Pedro Alves wrote:
> On 03/29/2012 10:29 AM, Hui Zhu wrote:
>
>> On 03/29/12 17:23, Pedro Alves wrote:
>>> On 03/29/2012 10:17 AM, Hui Zhu wrote:
>>>
>>>> Hi,
>>>>
>>>> When we want to test the trace function that in gdb.trace directory, we will got a lot of UNSUPPORTED. To use this testcase, we need follow way in http://sourceware.org/gdb/wiki/TestingGDB#Testing_gdbserver_in_a_native_configuration.
>>>>
>>>> So I post a patch add some code if current target don't support trace, try gdbserver in tfind.exp.
>>>> If this patch goes OK. I will post patch for other testsuite that support by gdbserver.
>>>
>>>
>>> NAK. If the current target doesn't support tracing, the right thing to
>>> do is to skip the test, as we do currently.
>>>
>>
>> That is because it didn't use target remote, most trace function is together with target remote, right?
>
>
> There are of course remote targets that also don't support tracing. Not all GDBserver
> ports support tracing, or we could even be testing against a server other than GDBserver
> (qemu, for example). Technically, native targets could also support tracing. See e.g., Yao's
> push towards using an IPA with the native target.
>
I agree with you. It really affect current test.
So I add a var TRACE_TRY_GDBSERVER in this check, then the test will try
gdbserver only when set TRACE_TRY_GDBSERVER. Then for the people that
don't care about try gdbserver when test tracepoint, he can set
TRACE_TRY_GDBSERVER with himself.
Thanks,
Hui
2012-03-29 Hui Zhu <hui_zhu@mentor.com>
* gdb.trace/tfind.exp: If current target don't support trace,
try gdbserver.
[-- Attachment #2: testsuite_trace_use_gdbserver.txt --]
[-- Type: text/plain, Size: 1037 bytes --]
---
testsuite/gdb.trace/tfind.exp | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
--- a/testsuite/gdb.trace/tfind.exp
+++ b/testsuite/gdb.trace/tfind.exp
@@ -36,10 +36,32 @@ gdb_test "tfind none" ".*" ""
runto_main
gdb_reinitialize_dir $srcdir/$subdir
-if { ![gdb_target_supports_trace] } then {
- unsupported "Current target does not support trace"
- return 1;
+if ![gdb_target_supports_trace] {
+ global TRACE_TRY_GDBSERVER
+
+ if ![info exists TRACE_TRY_GDBSERVER] {
+ unsupported "target does not support trace"
+ return -1;
+ }
+
+ load_lib gdbserver-support.exp
+
+ clean_restart $testfile
+ if { [skip_gdbserver_tests] } {
+ unsupported "target does not support trace"
+ return -1;
+ }
+
+ gdb_test "disconnect" ".*"
+
+ gdbserver_run ""
+ gdb_reinitialize_dir $srcdir/$subdir
+
+ if ![gdb_target_supports_trace] {
+ unsupported "target does not support trace"
+ return -1;
+ }
}
# If testing on a remote host, download the source file.
next prev parent reply other threads:[~2012-03-29 14:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-29 9:18 Hui Zhu
2012-03-29 9:24 ` Pedro Alves
2012-03-29 9:29 ` Hui Zhu
2012-03-29 9:46 ` Pedro Alves
2012-03-29 14:02 ` Hui Zhu [this message]
2012-03-29 14:13 ` Pedro Alves
2012-03-29 14:23 ` Hui Zhu
2012-03-29 14:26 ` Pedro Alves
2012-03-29 14:39 ` Hui Zhu
2012-03-29 14:40 ` Pedro Alves
2012-03-29 14:43 ` Hui Zhu
2012-03-29 15:00 ` Pedro Alves
2012-03-29 15:27 ` Hui Zhu
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=4F746B2A.6000302@mentor.com \
--to=hui_zhu@mentor.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