aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Eager <eager@eagercon.com>2012-07-19 18:27:17 +0000
committerMichael Eager <eager@eagercon.com>2012-07-19 18:27:17 +0000
commit961bd387ba464dbd902efdf2dd97b57f32835472 (patch)
treecc042ee2d8f0fba1c3812c199d7526705dedb9a7
parent90f47860e1849087fb8233186cdee3a34740b9d9 (diff)
downloadgdb-961bd387ba464dbd902efdf2dd97b57f32835472.zip
gdb-961bd387ba464dbd902efdf2dd97b57f32835472.tar.gz
gdb-961bd387ba464dbd902efdf2dd97b57f32835472.tar.bz2
2012-07-19 Michael Eager <eager@eagercon.com>
* i386-low.c (Z_packet_to_hw_type): Add Z_PACKET_HW_BP, translate to hw_execute. * linux-x86-low.c (x86_insert_point, x86_remove_point): Call i386_low_insert_watchpoint, i386_low_remove_watchpoint to add/del hardware breakpoint.
-rw-r--r--gdb/gdbserver/ChangeLog8
-rw-r--r--gdb/gdbserver/i386-low.c3
-rw-r--r--gdb/gdbserver/linux-x86-low.c19
3 files changed, 22 insertions, 8 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 3757add..fab5e7c 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,11 @@
+2012-07-19 Michael Eager <eager@eagercon.com>
+
+ * i386-low.c (Z_packet_to_hw_type): Add Z_PACKET_HW_BP, translate
+ to hw_execute.
+ * linux-x86-low.c (x86_insert_point, x86_remove_point):
+ Call i386_low_insert_watchpoint, i386_low_remove_watchpoint to add/del
+ hardware breakpoint.
+
2012-07-07 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdbserver/linux-low.c (initialize_low): Call
diff --git a/gdb/gdbserver/i386-low.c b/gdb/gdbserver/i386-low.c
index 902a9e9..b47392f 100644
--- a/gdb/gdbserver/i386-low.c
+++ b/gdb/gdbserver/i386-low.c
@@ -410,6 +410,7 @@ Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n",
return retval;
}
+#define Z_PACKET_HW_BP '1'
#define Z_PACKET_WRITE_WP '2'
#define Z_PACKET_READ_WP '3'
#define Z_PACKET_ACCESS_WP '4'
@@ -421,6 +422,8 @@ Z_packet_to_hw_type (char type)
{
switch (type)
{
+ case Z_PACKET_HW_BP:
+ return hw_execute;
case Z_PACKET_WRITE_WP:
return hw_write;
case Z_PACKET_READ_WP:
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
index 4ea284e..1215bae 100644
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -561,7 +561,7 @@ x86_insert_point (char type, CORE_ADDR addr, int len)
struct process_info *proc = current_process ();
switch (type)
{
- case '0':
+ case '0': /* software-breakpoint */
{
int ret;
@@ -572,11 +572,13 @@ x86_insert_point (char type, CORE_ADDR addr, int len)
done_accessing_memory ();
return ret;
}
- case '2':
- case '3':
- case '4':
+ case '1': /* hardware-breakpoint */
+ case '2': /* write watchpoint */
+ case '3': /* read watchpoint */
+ case '4': /* access watchpoint */
return i386_low_insert_watchpoint (&proc->private->arch_private->debug_reg_state,
type, addr, len);
+
default:
/* Unsupported. */
return 1;
@@ -589,7 +591,7 @@ x86_remove_point (char type, CORE_ADDR addr, int len)
struct process_info *proc = current_process ();
switch (type)
{
- case '0':
+ case '0': /* software-breakpoint */
{
int ret;
@@ -600,9 +602,10 @@ x86_remove_point (char type, CORE_ADDR addr, int len)
done_accessing_memory ();
return ret;
}
- case '2':
- case '3':
- case '4':
+ case '1': /* hardware-breakpoint */
+ case '2': /* write watchpoint */
+ case '3': /* read watchpoint */
+ case '4': /* access watchpoint */
return i386_low_remove_watchpoint (&proc->private->arch_private->debug_reg_state,
type, addr, len);
default: