Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* h/w watchpoint pointer initialization patch.
@ 2006-01-17  9:35 Jitendra Pawar
  2006-01-22 20:22 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Jitendra Pawar @ 2006-01-17  9:35 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 831 bytes --]

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


[-- Attachment #2: hw_watchpt_pointer_initialization.patch --]
[-- Type: text/x-patch, Size: 1088 bytes --]

--- 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)
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-01-22 20:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-17  9:35 h/w watchpoint pointer initialization patch Jitendra Pawar
2006-01-22 20:22 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox