This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/3] Use command "monitor set debug 0" to check the connection
- From: Yao Qi <yao at codesourcery dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 10 Oct 2014 21:48:18 +0800
- Subject: Re: [PATCH 3/3] Use command "monitor set debug 0" to check the connection
- Authentication-results: sourceware.org; auth=none
- References: <543404EF dot 4010306 at redhat dot com> <1412749679-27076-1-git-send-email-yao at codesourcery dot com> <1412749679-27076-4-git-send-email-yao at codesourcery dot com> <543547FC dot 30306 at redhat dot com> <87zjd6rlof dot fsf at codesourcery dot com> <5437A902 dot 6040701 at redhat dot com>
Pedro Alves <palves@redhat.com> writes:
> So I think we should do "set remote trace-status-packet on" before
> the "tstatus".
>
Sure.
> I know that the test originally didn't use "tstatus",
> but it's really the packet we should be testing for exercising
> that remote_get_trace_status's exception swallowing code,
> which was very much related to the original bug this test covered,
> see:
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=15275
>
> https://sourceware.org/ml/gdb-patches/2013-03/msg00691.html
Thanks for the information. I remember the first half of the
story, but forget the second half. How about the patch below?
--
Yao (éå)
Subject: [PATCH] Enable qTStatus packet in case it is disabled
Nowadays, we are using command "tstatus" to send a packet to GDBserver
in order to check the connection. However, on the target doesn't
support tracepoint, the following error is emitted before sending any
packet to GDBserver.
tstatus^M
Trace can not be run on this target.^M
(gdb) FAIL: gdb.server/server-kill.exp: tstatus
qTStatus is disabled after receiving the empty reply during connecting
to the remote target. When the test executes command "tstatus" again,
remote_get_trace_status returns -1 at the very beginning, and no RSP
packet is sent out.
This patch is to enable qTStatus packet again.
gdb/testsuite:
2014-10-10 Yao Qi <yao@codesourcery.com>
* gdb.server/server-kill.exp: Execute command
"set remote trace-status-packet on" before "tstatus".
diff --git a/gdb/testsuite/gdb.server/server-kill.exp b/gdb/testsuite/gdb.server/server-kill.exp
index 83c11f2..53d8e9a 100644
--- a/gdb/testsuite/gdb.server/server-kill.exp
+++ b/gdb/testsuite/gdb.server/server-kill.exp
@@ -52,6 +52,11 @@ if {$server_pid == "" } {
remote_exec target "kill -9 $server_pid"
+# Enable trace status packet which is disabled after the connection
+# if the remote target doesn't support tracepoint at all. Otherwise,
+# no RSP packet is sent out.
+gdb_test_no_output "set remote trace-status-packet on"
+
# Force GDB to talk with GDBserver, so that we can get the
# "connection closed" error.
gdb_test "tstatus" {Remote connection closed|Remote communication error\. Target disconnected\.: Connection reset by peer\.}