From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1122 invoked by alias); 28 Jun 2013 17:40:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 920 invoked by uid 89); 28 Jun 2013 17:40:54 -0000 X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 28 Jun 2013 17:40:53 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5SHekS8002268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 28 Jun 2013 13:40:51 -0400 Received: from barimba.redhat.com (ovpn-113-102.phx2.redhat.com [10.3.113.102]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5SHea0b010167; Fri, 28 Jun 2013 13:40:46 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey 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 Message-Id: <1372441229-305-13-git-send-email-tromey@redhat.com> In-Reply-To: <1372441229-305-1-git-send-email-tromey@redhat.com> References: <1372441229-305-1-git-send-email-tromey@redhat.com> X-SW-Source: 2013-06/txt/msg00913.txt.bz2 This moves the use_threadextra_query and use_threadinfo_query globals into remote_state. * remote.c (struct remote_state) : 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