This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
h/w watchpoint pointer initialization patch.
- From: Jitendra Pawar <jitendra at linsyssoft dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 17 Jan 2006 15:04:33 +0530
- Subject: h/w watchpoint pointer initialization patch.
Hi All,
While debugging cvs gdb, I put a h/w watch point, when this watch point
hits gdb calls target_insert_watchpoint macro. This macro defination is
present in target.h as bellow:
#define target_insert_watchpoint(addr, len, type) \
(*current_target.to_insert_watchpoint) (addr, len, type)
In case of remote debugging *current_target.to_insert_watchpoint points
to remote_target_insert_watchpoint function, but while native debugging
it should points to <host_arch>_insert_watchpoint (e.g.
i386_insert_watchpoint) instead it points to return_minus_one function.
This patch removes declaration of macros in file gdb/config/i386/nm-
i386.h for insertion and removal of h/w watchpoints. Instead it
initializes register access methods in gdb/i386-linux-nat.c file.
That fixes the above problem.
thanks
- Jitendra
--- src.orig/gdb/i386-linux-nat.c 2005-09-10 23:41:02.000000000 +0530
+++ src/gdb/i386-linux-nat.c 2006-01-16 19:31:29.000000000 +0530
@@ -842,6 +842,8 @@
/* Add our register access methods. */
t->to_fetch_registers = i386_linux_fetch_inferior_registers;
t->to_store_registers = i386_linux_store_inferior_registers;
+ t->to_insert_watchpoint = i386_insert_watchpoint;
+ t->to_remove_watchpoint = i386_remove_watchpoint;
/* Register the target. */
add_target (t);
--- src.orig/gdb/config/i386/nm-i386.h 2004-10-08 23:00:48.000000000 +0530
+++ src/gdb/config/i386/nm-i386.h 2006-01-17 12:31:37.299432944 +0530
@@ -97,14 +97,6 @@
#define target_stopped_data_address(target, x) i386_stopped_data_address(x)
-/* Use these macros for watchpoint insertion/removal. */
-
-#define target_insert_watchpoint(addr, len, type) \
- i386_insert_watchpoint (addr, len, type)
-
-#define target_remove_watchpoint(addr, len, type) \
- i386_remove_watchpoint (addr, len, type)
-
#define target_insert_hw_breakpoint(addr, shadow) \
i386_insert_hw_breakpoint (addr, shadow)