From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH] Fix a bug on uploading tsv
Date: Mon, 03 Sep 2012 15:32:00 -0000 [thread overview]
Message-ID: <1346686250-17361-1-git-send-email-yao@codesourcery.com> (raw)
Hi,
When writing a test case to 'tsv changed notification', I find when GDB
re-connects (connects again after disconnect) to remote target, only one
tsv is uploaded, and the rest tsv in target are not uploaded. This patch
is to fix this bug.
This patch is to remove incorrectly checking condition '!cur_tpoint' in
function cmd_qtsv. cur_tpoint is set to non-NULL after calling cmd_qtfp,
that is to say, target tracepoints are uploaded to GDB. However, we upload
TSV first and upload tracepoints second in GDB, as we can see in
remote.c:remote_start_remote,
/* Possibly the target has been engaged in a trace run started
previously; find out where things are at. */
if (remote_get_trace_status (current_trace_status ()) != -1)
{
struct uploaded_tp *uploaded_tps = NULL;
struct uploaded_tsv *uploaded_tsvs = NULL;
if (current_trace_status ()->running)
printf_filtered (_("Trace is already running on the target.\n"));
/* Get trace state variables first, they may be checked when
parsing uploaded commands. */
remote_upload_trace_state_variables (&uploaded_tsvs);
merge_uploaded_trace_state_variables (&uploaded_tsvs);
remote_upload_tracepoints (&uploaded_tps);
merge_uploaded_tracepoints (&uploaded_tps);
}
So it is wrong to check condition '!cur_tpoint' because 'cur_tpoint'
is always NULL when calling cmd_qtsv, and we should remove it.
Regression tested on x86_64-linux. OK?
gdb/gdbserver:
2012-09-03 Yao Qi <yao@codesourcery.com>
* tracepoint.c (cmd_qtsv): Adjust debug message.
Remove an incorrect condition checking.
---
gdb/gdbserver/tracepoint.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 9d62bb6..3e0a7ce 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -3873,15 +3873,9 @@ cmd_qtfv (char *packet)
static void
cmd_qtsv (char *packet)
{
- trace_debug ("Returning first trace state variable definition");
+ trace_debug ("Returning additional trace state variable definition");
- if (!cur_tpoint)
- {
- /* This case would normally never occur, but be prepared for
- GDB misbehavior. */
- strcpy (packet, "l");
- }
- else if (cur_tsv)
+ if (cur_tsv)
{
cur_tsv = cur_tsv->next;
if (cur_tsv)
--
1.7.7.6
next reply other threads:[~2012-09-03 15:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-03 15:32 Yao Qi [this message]
2012-09-03 15:43 ` Pedro Alves
2012-09-04 1:48 ` Yao Qi
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=1346686250-17361-1-git-send-email-yao@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/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