Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Cc: Hui Zhu <hui_zhu@mentor.com>, Yao Qi <Yao_Qi@mentor.com>
Subject: Fix tracepoints in extended-remote mode regression (Re: Fix error when gdb connect to a stub that tracepoint is running[1/2] Add a flag initialized to struct trace_status)
Date: Tue, 20 Mar 2012 18:50:00 -0000	[thread overview]
Message-ID: <4F68D171.5050709@redhat.com> (raw)
In-Reply-To: <4F4FC4AD.3020501@redhat.com>

On 03/01/2012 06:49 PM, Pedro Alves wrote:

> 
> 2012-03-01  Pedro Alves  <palves@redhat.com>
> 	    Hui Zhu  <hui_zhu@mentor.com>
> 	    Yao Qi  <yao@codesourcery.com>
> 
> 	* remote.c (struct remote_state): New field `starting_up'.
> 	(remote_start_remote): Set and clear it.
> 	(remote_can_download_tracepoint): If starting up, return false.


This misses clearing `starting_up' on early return paths of remote_start_remote,
an so remote_can_download_tracepoint always return false in extended-remote mode.
With the extended-remote board, but not with the regular remote board:

Running ../../../src/gdb/testsuite/gdb.trace/change-loc.exp ...
FAIL: gdb.trace/change-loc.exp: 1 trace: tfind frame 0
FAIL: gdb.trace/change-loc.exp: 2 trace: tfind frame 2
FAIL: gdb.trace/change-loc.exp: 1 ftrace: running to main in runto
FAIL: gdb.trace/change-loc.exp: 1 ftrace: Can't run to main
FAIL: gdb.trace/change-loc.exp: 2 ftrace: run to main (the program exited)
FAIL: gdb.trace/change-loc.exp: 2 ftrace: tstart
...
(snip yet more fails)

This fixes it.  Applied on mainline and 7.4.

2012-03-20  Pedro Alves  <palves@redhat.com>

	* remote.c (remote_start_remote): Clear `rs->starting_up' on early
	returns.
---
 gdb/remote.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Index: src/gdb/remote.c
===================================================================
--- src.orig/gdb/remote.c
+++ src/gdb/remote.c
@@ -3268,6 +3268,7 @@ remote_start_remote (int from_tty, struc

 	  /* We're connected, but not running.  Drop out before we
 	     call start_remote.  */
+	  rs->starting_up = 0;
 	  return;
 	}
       else
@@ -3374,6 +3375,7 @@ remote_start_remote (int from_tty, struc

 	  /* We're connected, but not running.  Drop out before we
 	     call start_remote.  */
+	  rs->starting_up = 0;
 	  return;
 	}


      parent reply	other threads:[~2012-03-20 18:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-01 14:47 Fix error when gdb connect to a stub that tracepoint is running[1/2] Add a flag initialized to struct trace_status Hui Zhu
2012-03-01 18:26 ` Pedro Alves
2012-03-01 18:49   ` Pedro Alves
2012-03-05  2:26     ` Hui Zhu
2012-03-11 16:13       ` Hui Zhu
2012-03-13 13:46         ` Pedro Alves
2012-03-13 22:21           ` Pedro Alves
2012-03-20 18:50     ` Pedro Alves [this message]

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=4F68D171.5050709@redhat.com \
    --to=palves@redhat.com \
    --cc=Yao_Qi@mentor.com \
    --cc=gdb-patches@sourceware.org \
    --cc=hui_zhu@mentor.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