From: Tom Tromey Date: Wed, 14 Aug 2013 18:17:13 +0000 (+0000) Subject: move remote_stopped_by_watchpoint_p and remote_watch_data_address into remote_state X-Git-Tag: binutils-2_24-branchpoint~270 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ee154beebfe8b88abc7c6b12960b0493151c0e33;p=thirdparty%2Fbinutils-gdb.git move remote_stopped_by_watchpoint_p and remote_watch_data_address into remote_state 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 522d86c8658..f81f9be96df 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2013-08-14 Tom Tromey + + * 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. + 2013-08-14 Tom Tromey * remote.c (struct remote_state) private. */ @@ -789,17 +796,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; @@ -5843,6 +5839,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) { @@ -5858,8 +5856,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; @@ -5985,7 +5983,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; @@ -8426,17 +8424,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; }