From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 662 invoked by alias); 28 Jun 2013 17:40:52 -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 583 invoked by uid 89); 28 Jun 2013 17:40:52 -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:51 +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 r5SHenl1011709 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 28 Jun 2013 13:40:50 -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 r5SHea0e010167; Fri, 28 Jun 2013 13:40:48 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 15/16] move remote_stopped_by_watchpoint_p and remote_watch_data_address into remote_state Date: Fri, 28 Jun 2013 17:40:00 -0000 Message-Id: <1372441229-305-16-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/msg00912.txt.bz2 This moves the globals remote_stopped_by_watchpoint_p and remote_watch_data_address into remote_state. * remote.c (struct remote_state) : New fields. (remote_stopped_by_watchpoint_p, remote_watch_data_address): Remove. (process_stop_reply, remote_wait_as) (remote_check_watch_resources, remote_stopped_data_address): Update. --- gdb/remote.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index 8641094..56c6f6c 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -410,6 +410,13 @@ struct remote_state void (*async_client_callback) (enum inferior_event_type event_type, void *context); void *async_client_context; + + /* This is set to the data address of the access causing the target + to stop for a watchpoint. */ + CORE_ADDR remote_watch_data_address; + + /* This is non-zero if target stopped for a watchpoint. */ + int remote_stopped_by_watchpoint_p; }; /* Private data that we'll store in (struct thread_info)->private. */ @@ -792,17 +799,6 @@ packet_reg_from_pnum (struct remote_arch_state *rsa, LONGEST pnum) return NULL; } -/* FIXME: graces/2002-08-08: These variables should eventually be - bound to an instance of the target object (as in gdbarch-tdep()), - when such a thing exists. */ - -/* This is set to the data address of the access causing the target - to stop for a watchpoint. */ -static CORE_ADDR remote_watch_data_address; - -/* This is non-zero if target stopped for a watchpoint. */ -static int remote_stopped_by_watchpoint_p; - static struct target_ops remote_ops; static struct target_ops extended_remote_ops; @@ -5846,6 +5842,8 @@ process_stop_reply (struct stop_reply *stop_reply, if (status->kind != TARGET_WAITKIND_EXITED && status->kind != TARGET_WAITKIND_SIGNALLED) { + struct remote_state *rs = get_remote_state (); + /* Expedited registers. */ if (stop_reply->regcache) { @@ -5861,8 +5859,8 @@ process_stop_reply (struct stop_reply *stop_reply, VEC_free (cached_reg_t, stop_reply->regcache); } - remote_stopped_by_watchpoint_p = stop_reply->stopped_by_watchpoint_p; - remote_watch_data_address = stop_reply->watch_data_address; + rs->remote_stopped_by_watchpoint_p = stop_reply->stopped_by_watchpoint_p; + rs->remote_watch_data_address = stop_reply->watch_data_address; remote_notice_new_inferior (ptid, 0); demand_private_info (ptid)->core = stop_reply->core; @@ -5988,7 +5986,7 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options) buf = rs->buf; - remote_stopped_by_watchpoint_p = 0; + rs->remote_stopped_by_watchpoint_p = 0; /* We got something. */ rs->waiting_for_stop_reply = 0; @@ -8429,17 +8427,20 @@ remote_check_watch_resources (int type, int cnt, int ot) static int remote_stopped_by_watchpoint (void) { - return remote_stopped_by_watchpoint_p; + struct remote_state *rs = get_remote_state (); + + return rs->remote_stopped_by_watchpoint_p; } static int remote_stopped_data_address (struct target_ops *target, CORE_ADDR *addr_p) { + struct remote_state *rs = get_remote_state (); int rc = 0; if (remote_stopped_by_watchpoint ()) { - *addr_p = remote_watch_data_address; + *addr_p = rs->remote_watch_data_address; rc = 1; } -- 1.8.1.4