This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/7] Move rs->support_vCont_t to a separate struct


This is a refactor patch to move field 'support_vCont_t' to a separate
struct 'support_v_cont', to prepare for adding more fields in it in
the next patch.

gdb:

2013-03-11  Yao Qi  <yao@codesourcery.com>

	* remote.c (struct support_v_cont): New.
	(struct remote_state) <support_vCont_t>: Remove.
	<support_vCont>: New field.
	(remote_vcont_probe, remote_stop_ns): Update.
---
 gdb/remote.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/gdb/remote.c b/gdb/remote.c
index 4978fca..ae0ae7e 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -247,6 +247,14 @@ static struct cmd_list_element *remote_cmdlist;
 static struct cmd_list_element *remote_set_cmdlist;
 static struct cmd_list_element *remote_show_cmdlist;
 
+/* The status of the stub supports for various vCont; packets.  */
+
+struct support_v_cont
+{
+  /* True if the stub reports support for vCont;t.  */
+  int t;
+};
+
 /* Description of the remote protocol state for the currently
    connected target.  This is per-target state, and independent of the
    selected architecture.  */
@@ -304,8 +312,8 @@ struct remote_state
   /* True if the stub reports support for non-stop mode.  */
   int non_stop_aware;
 
-  /* True if the stub reports support for vCont;t.  */
-  int support_vCont_t;
+  /* The status of the stub supports for various vCont; packets.  */
+  struct support_v_cont support_vCont;
 
   /* True if the stub reports support for conditional tracepoints.  */
   int cond_tracepoints;
@@ -4635,7 +4643,7 @@ remote_vcont_probe (struct remote_state *rs)
       support_S = 0;
       support_c = 0;
       support_C = 0;
-      rs->support_vCont_t = 0;
+      rs->support_vCont.t = 0;
       while (p && *p == ';')
 	{
 	  p++;
@@ -4648,7 +4656,7 @@ remote_vcont_probe (struct remote_state *rs)
 	  else if (*p == 'C' && (*(p + 1) == ';' || *(p + 1) == 0))
 	    support_C = 1;
 	  else if (*p == 't' && (*(p + 1) == ';' || *(p + 1) == 0))
-	    rs->support_vCont_t = 1;
+	    rs->support_vCont.t = 1;
 
 	  p = strchr (p, ';');
 	}
@@ -4997,7 +5005,7 @@ remote_stop_ns (ptid_t ptid)
   if (remote_protocol_packets[PACKET_vCont].support == PACKET_SUPPORT_UNKNOWN)
     remote_vcont_probe (rs);
 
-  if (!rs->support_vCont_t)
+  if (!rs->support_vCont.t)
     error (_("Remote server does not support stopping threads"));
 
   if (ptid_equal (ptid, minus_one_ptid)
-- 
1.7.7.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]