Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@redhat.com>
Subject: [PATCH 12/16] move use_threadinfo_query and use_threadextra_query into struct remote_state
Date: Fri, 28 Jun 2013 17:40:00 -0000	[thread overview]
Message-ID: <1372441229-305-13-git-send-email-tromey@redhat.com> (raw)
In-Reply-To: <1372441229-305-1-git-send-email-tromey@redhat.com>

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/remote.c | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/gdb/remote.c b/gdb/remote.c
index 6c71ac1..d7650b1 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -396,6 +396,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.  */
@@ -1437,17 +1447,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 *sigint_remote_twice_token;
 static struct async_signal_handler *sigint_remote_token;
@@ -2797,7 +2796,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);
@@ -2845,7 +2844,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;
 }
@@ -2890,7 +2889,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 ();
@@ -2911,7 +2910,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));
@@ -4358,8 +4357,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)
     {
-- 
1.8.1.4


  parent reply	other threads:[~2013-06-28 17:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 17:40 [PATCH v2 00/16] Tom Tromey
2013-06-28 17:40 ` [PATCH 16/16] move some static thread state into remote_state Tom Tromey
2013-06-28 17:40 ` [PATCH 11/16] move some statics from remote_read_qxfer into struct remote_state Tom Tromey
2013-07-01 16:07   ` Pedro Alves
2013-07-01 18:06     ` Tom Tromey
2013-06-28 17:40 ` [PATCH 06/16] push remote_traceframe_number " Tom Tromey
2013-06-28 17:40 ` Tom Tromey [this message]
2013-06-28 17:40 ` [PATCH 04/16] push remote_desc " Tom Tromey
2013-06-28 17:40 ` [PATCH 01/16] use the libiberty crc code Tom Tromey
2013-06-28 17:40 ` [PATCH 10/16] push last_sent_step into struct remote_state Tom Tromey
2013-06-28 17:40 ` [PATCH 13/16] move sizeof_pkt into remote_trace_find Tom Tromey
2013-06-28 17:40 ` [PATCH 02/16] make remote_protocol_features "const" Tom Tromey
2013-06-28 17:40 ` [PATCH 14/16] move async_client_callback and async_client_context into remote_state Tom Tromey
2013-07-01 16:07   ` Pedro Alves
2013-07-01 18:06     ` Tom Tromey
2013-06-28 17:40 ` [PATCH 05/16] push general_thread and continue_thread into struct remote_state Tom Tromey
2013-06-28 17:40 ` [PATCH 07/16] push last_pass_packet " Tom Tromey
2013-06-28 17:40 ` [PATCH 03/16] Add new_remote_state Tom Tromey
2013-07-01 16:05   ` Pedro Alves
2013-07-01 18:05     ` Tom Tromey
2013-06-28 17:40 ` [PATCH 15/16] move remote_stopped_by_watchpoint_p and remote_watch_data_address into remote_state Tom Tromey
2013-06-28 17:40 ` [PATCH 08/16] push last_program_signals_packet into struct remote_state Tom Tromey
2013-06-28 17:44 ` [PATCH 09/16] push last_sent_signal " Tom Tromey
2013-07-01 16:07 ` [PATCH v2 00/16] Pedro Alves
  -- strict thread matches above, loose matches on Subject: below --
2013-06-21 17:25 [PATCH 00/16] clean up remote.c state Tom Tromey
2013-06-21 17:25 ` [PATCH 12/16] move use_threadinfo_query and use_threadextra_query into struct remote_state Tom Tromey

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=1372441229-305-13-git-send-email-tromey@redhat.com \
    --to=tromey@redhat.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