From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2183 invoked by alias); 17 Jun 2014 14:44:24 -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 2171 invoked by uid 89); 17 Jun 2014 14:44:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,UNWANTED_LANGUAGE_BODY autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Jun 2014 14:44:22 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5HED7V2027954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 17 Jun 2014 10:13:07 -0400 Received: from blade.nx (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5HED6ew028303 for ; Tue, 17 Jun 2014 10:13:06 -0400 Received: from blade.nx (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id D92A2262484 for ; Tue, 17 Jun 2014 15:13:04 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Subject: [PATCH 09/15] Merge i386_update_inferior_debug_regs Date: Tue, 17 Jun 2014 14:44:00 -0000 Message-Id: <1403014378-4349-10-git-send-email-gbenson@redhat.com> In-Reply-To: <1403014378-4349-1-git-send-email-gbenson@redhat.com> References: <1403014378-4349-1-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00592.txt.bz2 This commit synchronizes the i386_update_inferior_debug_regs functions in i386-nat.c and i386-low.c. gdb/ 2014-06-17 Gary Benson * i386-nat.c (i386_update_inferior_debug_regs) : New parameter. All uses updated. gdb/gdbserver/ 2014-06-17 Gary Benson * i386-low.c (i386_update_inferior_debug_regs) : Renamed to state. --- gdb/ChangeLog | 5 +++++ gdb/gdbserver/ChangeLog | 10 ++++++++++ gdb/gdbserver/i386-low.c | 12 ++++++------ gdb/i386-nat.c | 17 ++++++++--------- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/gdb/gdbserver/i386-low.c b/gdb/gdbserver/i386-low.c index 54dd4b8..8c50838 100644 --- a/gdb/gdbserver/i386-low.c +++ b/gdb/gdbserver/i386-low.c @@ -417,27 +417,27 @@ Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n"), return retval; } -/* Update the inferior debug registers state, in INF_STATE, with the +/* Update the inferior debug registers state, in STATE, with the new debug registers state, in NEW_STATE. */ static void -i386_update_inferior_debug_regs (struct i386_debug_reg_state *inf_state, +i386_update_inferior_debug_regs (struct i386_debug_reg_state *state, struct i386_debug_reg_state *new_state) { int i; ALL_DEBUG_REGISTERS (i) { - if (I386_DR_VACANT (new_state, i) != I386_DR_VACANT (inf_state, i)) + if (I386_DR_VACANT (new_state, i) != I386_DR_VACANT (state, i)) i386_dr_low_set_addr (new_state, i); else - gdb_assert (new_state->dr_mirror[i] == inf_state->dr_mirror[i]); + gdb_assert (new_state->dr_mirror[i] == state->dr_mirror[i]); } - if (new_state->dr_control_mirror != inf_state->dr_control_mirror) + if (new_state->dr_control_mirror != state->dr_control_mirror) i386_dr_low_set_control (new_state); - *inf_state = *new_state; + *state = *new_state; } /* Insert a watchpoint to watch a memory region which starts at diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c index 6520549..a64cdab 100644 --- a/gdb/i386-nat.c +++ b/gdb/i386-nat.c @@ -526,14 +526,13 @@ Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n"), return retval; } -/* Update the inferior's debug registers with the new debug registers - state, in NEW_STATE, and then update our local mirror to match. */ +/* Update the inferior debug registers state, in STATE, with the + new debug registers state, in NEW_STATE. */ static void -i386_update_inferior_debug_regs (struct i386_debug_reg_state *new_state) +i386_update_inferior_debug_regs (struct i386_debug_reg_state *state, + struct i386_debug_reg_state *new_state) { - struct i386_debug_reg_state *state - = i386_debug_reg_state (ptid_get_pid (inferior_ptid)); int i; ALL_DEBUG_REGISTERS (i) @@ -586,7 +585,7 @@ i386_insert_watchpoint (struct target_ops *self, } if (retval == 0) - i386_update_inferior_debug_regs (&local_state); + i386_update_inferior_debug_regs (state, &local_state); if (debug_hw_points) i386_show_dr (state, "insert_watchpoint", addr, len, type); @@ -626,7 +625,7 @@ i386_remove_watchpoint (struct target_ops *self, } if (retval == 0) - i386_update_inferior_debug_regs (&local_state); + i386_update_inferior_debug_regs (state, &local_state); if (debug_hw_points) i386_show_dr (state, "remove_watchpoint", addr, len, type); @@ -761,7 +760,7 @@ i386_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch, addr, len_rw) ? EBUSY : 0; if (retval == 0) - i386_update_inferior_debug_regs (&local_state); + i386_update_inferior_debug_regs (state, &local_state); if (debug_hw_points) i386_show_dr (state, "insert_hwbp", addr, 1, hw_execute); @@ -787,7 +786,7 @@ i386_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch, addr, len_rw); if (retval == 0) - i386_update_inferior_debug_regs (&local_state); + i386_update_inferior_debug_regs (state, &local_state); if (debug_hw_points) i386_show_dr (state, "remove_hwbp", addr, 1, hw_execute); -- 1.7.1