Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 07/14] Support in remote target.
Date: Thu, 03 May 2012 13:13:00 -0000	[thread overview]
Message-ID: <1336050869-29605-8-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1336050869-29605-1-git-send-email-yao@codesourcery.com>

This patch is to support remote target.

gdb:

2012-04-12  Yao Qi  <yao@codesourcery.com>

	* remote.c (remote_is_non_stop_p): New.
	(init_remote_ops): Install remote_is_non_stop_p.
	(remote_add_inferior): Set tp->control.resumed to 1.
	(add_current_inferior_and_thread): Likewise.
	(extended_remote_attach_1): Likewise.
---
 gdb/remote.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/gdb/remote.c b/gdb/remote.c
index 68864d1..6d58aca 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1506,8 +1506,9 @@ remote_add_inferior (int fake_pid_p, int pid, int attached)
 static void
 remote_add_thread (ptid_t ptid, int running)
 {
-  add_thread (ptid);
+  struct thread_info *tp = add_thread (ptid);
 
+  tp->control.resumed = 1;
   set_executing (ptid, running);
   set_running (ptid, running);
 }
@@ -3227,6 +3228,7 @@ add_current_inferior_and_thread (void)
   struct remote_state *rs = get_remote_state ();
   int fake_pid_p = 0;
   ptid_t ptid;
+  struct thread_info *tp;
 
   inferior_ptid = null_ptid;
 
@@ -3252,7 +3254,8 @@ add_current_inferior_and_thread (void)
   remote_add_inferior (fake_pid_p, ptid_get_pid (inferior_ptid), -1);
 
   /* Add the main thread.  */
-  add_thread_silent (inferior_ptid);
+  tp = add_thread_silent (inferior_ptid);
+  tp->control.resumed = 1;
 }
 
 static void
@@ -4441,11 +4444,14 @@ extended_remote_attach_1 (struct target_ops *target, char *args, int from_tty)
     }
   else
     {
+      struct thread_info *tp;
+
       /* Now, if we have thread information, update inferior_ptid.  */
       inferior_ptid = remote_current_thread (inferior_ptid);
 
       /* Add the main thread to the thread list.  */
-      add_thread_silent (inferior_ptid);
+      tp = add_thread_silent (inferior_ptid);
+      tp->control.resumed = 1;
     }
 
   /* Next, if the target can specify a description, read it.  We do
@@ -10900,6 +10906,12 @@ remote_can_use_agent (void)
   return (remote_protocol_packets[PACKET_QAgent].support != PACKET_DISABLE);
 }
 
+static int
+remote_is_non_stop_p (void)
+{
+  return non_stop;
+}
+
 static void
 init_remote_ops (void)
 {
@@ -10965,6 +10977,7 @@ Specify the serial device it is connected to\n\
   remote_ops.to_can_async_p = remote_can_async_p;
   remote_ops.to_is_async_p = remote_is_async_p;
   remote_ops.to_async = remote_async;
+  remote_ops.to_is_non_stop_p = remote_is_non_stop_p;
   remote_ops.to_terminal_inferior = remote_terminal_inferior;
   remote_ops.to_terminal_ours = remote_terminal_ours;
   remote_ops.to_supports_non_stop = remote_supports_non_stop;
-- 
1.7.0.4


  parent reply	other threads:[~2012-05-03 13:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-03 13:12 [PATCH v4 0/14] Run all-stop on non-stop target Yao Qi
2012-05-03 13:12 ` [PATCH 03/14] Change parameters of adjust_pc_after_break Yao Qi
2012-05-03 13:12 ` [PATCH 01/14] Fix displaced stepping debug log Yao Qi
2012-05-03 15:01   ` Pedro Alves
2012-05-03 13:13 ` [PATCH 08/14] Uninstall infrun_async_inferior_event token in remote target Yao Qi
2012-05-03 13:13 ` [PATCH 09/14] Set thread's state in infcall Yao Qi
2012-05-03 13:13 ` [PATCH 10/14] watchthreads-reorder.exp: Don't assume there is no infrun output after prompt Yao Qi
2012-05-03 13:13 ` [PATCH 05/14] Support in linux-nat target Yao Qi
2012-05-03 13:13 ` [PATCH 12/14] manythreads.exp: Adjust to handle threads appearing/disappearing after "Program received signal SIGFOO" Yao Qi
2012-05-03 13:13 ` [PATCH 14/14] kfail gdb/13858 Yao Qi
2012-05-03 13:13 ` [PATCH 11/14] Fix fails in gdb.trace/pending.exp Yao Qi
2012-05-03 13:13 ` [PATCH 02/14] Move displaced_step_fixup bits out to displaced_step_next Yao Qi
2012-05-03 13:13 ` [PATCH 13/14] ia64-sigill.exp: Don't assume there's no infrun output after the prompt Yao Qi
2012-05-03 13:13 ` Yao Qi [this message]
2012-05-03 13:13 ` [PATCH 06/14] Flip to set target-async on by default and NEWS Yao Qi
2012-05-03 13:14 ` [PATCH 04/14] Run all-stop on non-stop Yao Qi
2012-05-03 14:23 ` [PATCH v4 0/14] Run all-stop on non-stop target Pedro Alves
2012-05-03 14:38   ` Yao Qi
2012-05-09 17:46     ` Pedro Alves
2012-05-10 12:09       ` Yao Qi
2012-05-10 14:21         ` Pedro Alves
2012-05-26 11:08           ` 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=1336050869-29605-8-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