diff options
author | Gary Benson <gbenson@redhat.com> | 2014-06-19 10:54:15 +0100 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2014-06-19 10:56:16 +0100 |
commit | 46e3325277e604face2848eec78247826b94d5c9 (patch) | |
tree | 37380b6866af32c0090769e4584e1cd57a033383 /gdb | |
parent | 3a8ee006fb19680c444993a99a4fe3a64dd40a39 (diff) | |
download | gdb-46e3325277e604face2848eec78247826b94d5c9.zip gdb-46e3325277e604face2848eec78247826b94d5c9.tar.gz gdb-46e3325277e604face2848eec78247826b94d5c9.tar.bz2 |
Directly call i386-dregs functions
Three target_ops functions in i386-nat.c call other local target_ops
functions. This commit changes those functions to call the functions
in i386-dregs.c directly.
gdb/
2014-06-19 Gary Benson <gbenson@redhat.com>
* i386-nat.c (i386_stopped_by_watchpoint):
Use i386_dr_stopped_by_watchpoint.
(i386_insert_hw_breakpoint): Use i386_dr_insert_watchpoint.
(i386_remove_hw_breakpoint): Use i386_dr_remove_watchpoint.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/i386-nat.c | 20 |
2 files changed, 21 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1d1dcad..f13c19a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2014-06-19 Gary Benson <gbenson@redhat.com> + * i386-nat.c (i386_stopped_by_watchpoint): + Use i386_dr_stopped_by_watchpoint. + (i386_insert_hw_breakpoint): Use i386_dr_insert_watchpoint. + (i386_remove_hw_breakpoint): Use i386_dr_remove_watchpoint. + +2014-06-19 Gary Benson <gbenson@redhat.com> + * nat/i386-dregs.c: New file. * Makefile.in (i386-dregs.o): New rule. * config/i386/cygwin.mh (NATDEPFILES): Add i386-dregs.o. diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c index 750b878..499fffb 100644 --- a/gdb/i386-nat.c +++ b/gdb/i386-nat.c @@ -208,8 +208,10 @@ i386_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p) static int i386_stopped_by_watchpoint (struct target_ops *ops) { - CORE_ADDR addr = 0; - return i386_stopped_data_address (ops, &addr); + struct i386_debug_reg_state *state + = i386_debug_reg_state (ptid_get_pid (inferior_ptid)); + + return i386_dr_stopped_by_watchpoint (state); } /* Insert a hardware-assisted breakpoint at BP_TGT->placed_address. @@ -219,8 +221,11 @@ static int i386_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt) { - return i386_insert_watchpoint (self, bp_tgt->placed_address, 1, - hw_execute, NULL) ? EBUSY : 0; + struct i386_debug_reg_state *state + = i386_debug_reg_state (ptid_get_pid (inferior_ptid)); + + return i386_dr_insert_watchpoint (state, hw_execute, + bp_tgt->placed_address, 1) ? EBUSY : 0; } /* Remove a hardware-assisted breakpoint at BP_TGT->placed_address. @@ -230,8 +235,11 @@ static int i386_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt) { - return i386_remove_watchpoint (self, bp_tgt->placed_address, 1, - hw_execute, NULL); + struct i386_debug_reg_state *state + = i386_debug_reg_state (ptid_get_pid (inferior_ptid)); + + return i386_dr_remove_watchpoint (state, hw_execute, + bp_tgt->placed_address, 1); } /* Returns the number of hardware watchpoints of type TYPE that we can |