move use_threadinfo_query and use_threadextra_query into struct remote_state
authorTom Tromey <tromey@redhat.com>
Wed, 14 Aug 2013 18:15:01 +0000 (18:15 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 14 Aug 2013 18:15:01 +0000 (18:15 +0000)
This moves the use_threadextra_query and use_threadinfo_query globals
into remote_state.

* remote.c (struct remote_state) <use_threadinfo_query,
use_threadextra_query>: New fields.
(remote_threads_info, remote_threads_extra_info)
(remote_open_1): Update.

gdb/ChangeLog
gdb/remote.c

index 0a7ff9e8a9573bd1321f05e49ce70eaf7107b23d..1f0f1e7719a8ecfa8a69692a05800983ed1c7ccc 100644 (file)
@@ -1,3 +1,10 @@
+2013-08-14  Tom Tromey  <tromey@redhat.com>
+
+       * remote.c (struct remote_state) <use_threadinfo_query,
+       use_threadextra_query>: New fields.
+       (remote_threads_info, remote_threads_extra_info)
+       (remote_open_1): Update.
+
 2013-08-14  Tom Tromey  <tromey@redhat.com>
 
        * remote.c (struct remote_state) <finished_object,
index ccc87b3c8a5ea12bf0b33488859cde3b893de1d7..780a1be06589d4cad40645c028de0a5af59ea09b 100644 (file)
@@ -391,6 +391,16 @@ struct remote_state
   char *finished_object;
   char *finished_annex;
   ULONGEST finished_offset;
+
+  /* Should we try the 'ThreadInfo' query packet?
+
+     This variable (NOT available to the user: auto-detect only!)
+     determines whether GDB will use the new, simpler "ThreadInfo"
+     query or the older, more complex syntax for thread queries.
+     This is an auto-detect variable (set to true at each connect,
+     and set to false when the target fails to recognize it).  */
+  int use_threadinfo_query;
+  int use_threadextra_query;
 };
 
 /* Private data that we'll store in (struct thread_info)->private.  */
@@ -1434,17 +1444,6 @@ show_remote_protocol_Z_packet_cmd (struct ui_file *file, int from_tty,
     }
 }
 
-/* Should we try the 'ThreadInfo' query packet?
-
-   This variable (NOT available to the user: auto-detect only!)
-   determines whether GDB will use the new, simpler "ThreadInfo"
-   query or the older, more complex syntax for thread queries.
-   This is an auto-detect variable (set to true at each connect,
-   and set to false when the target fails to recognize it).  */
-
-static int use_threadinfo_query;
-static int use_threadextra_query;
-
 /* Tokens for use by the asynchronous signal handlers for SIGINT.  */
 static struct async_signal_handler *async_sigint_remote_twice_token;
 static struct async_signal_handler *async_sigint_remote_token;
@@ -2794,7 +2793,7 @@ remote_threads_info (struct target_ops *ops)
     }
 #endif
 
-  if (use_threadinfo_query)
+  if (rs->use_threadinfo_query)
     {
       putpkt ("qfThreadInfo");
       getpkt (&rs->buf, &rs->buf_size, 0);
@@ -2842,7 +2841,7 @@ remote_threads_info (struct target_ops *ops)
     return;
 
   /* Else fall back to old method based on jmetzler protocol.  */
-  use_threadinfo_query = 0;
+  rs->use_threadinfo_query = 0;
   remote_find_new_threads ();
   return;
 }
@@ -2887,7 +2886,7 @@ remote_threads_extra_info (struct thread_info *tp)
        return NULL;
     }
 
-  if (use_threadextra_query)
+  if (rs->use_threadextra_query)
     {
       char *b = rs->buf;
       char *endb = rs->buf + get_remote_packet_size ();
@@ -2908,7 +2907,7 @@ remote_threads_extra_info (struct thread_info *tp)
     }
 
   /* If the above query fails, fall back to the old method.  */
-  use_threadextra_query = 0;
+  rs->use_threadextra_query = 0;
   set = TAG_THREADID | TAG_EXISTS | TAG_THREADNAME
     | TAG_MOREDISPLAY | TAG_DISPLAY;
   int_to_threadref (&id, ptid_get_tid (tp->ptid));
@@ -4355,8 +4354,8 @@ remote_open_1 (char *name, int from_tty,
   rs->remote_traceframe_number = -1;
 
   /* Probe for ability to use "ThreadInfo" query, as required.  */
-  use_threadinfo_query = 1;
-  use_threadextra_query = 1;
+  rs->use_threadinfo_query = 1;
+  rs->use_threadextra_query = 1;
 
   if (target_async_permitted)
     {
This page took 0.03206 seconds and 4 git commands to generate.