This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [RFC] Add hardware breapoints in procfs.c


Sorry, I sent the wrong version of the patch.
I started to write another patch that 
tries to find the watchpoint stop address
in procinfo struct.

Correct patch is below.

Pierre

> -----Message d'origine-----
> De?: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pierre Muller
> Envoyé?: Thursday, May 14, 2009 11:25 PM
> À?: gdb-patches@sourceware.org
> Objet?: [RFC] Add hardware breapoints in procfs.c
> 
> I postponed this part of my original patch
> for procfs.c
> 
>   I don't know if all platforms using
> procfs.c code will work with that code,
> and I have access only to a i386 OpenSolaris.
>  For that target, it works,
> but only once the program is started...
> 
>  Can someone test other targets?
> 
> Pierre
> 
2009-05-14  Pierre Muller  <muller@ics.u-strasbg.fr>
 
 	* procfs.c (procfs_insert_hw_breakpoint,
procfs_remove_hw_breakpoint):
 	New functions.
 	(procfs_use_watchpoints): Register new hardware breakpoint related
 	target functions.

Index: procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/procfs.c,v
retrieving revision 1.107
diff -u -p -r1.107 procfs.c
--- procfs.c    11 May 2009 11:13:08 -0000      1.107
+++ procfs.c    14 May 2009 21:16:54 -0000
@@ -5387,6 +5387,20 @@ procfs_region_ok_for_hw_watchpoint (CORE
   return 1;
 }

+static int
+procfs_insert_hw_breakpoint (struct bp_target_info *bp_tgt)
+{
+  CORE_ADDR addr = bp_tgt->placed_address;
+  return procfs_set_watchpoint (inferior_ptid, addr, 1, hw_execute, 0);
+}
+
+static int
+procfs_remove_hw_breakpoint (struct bp_target_info *bp_tgt)
+{
+  CORE_ADDR addr = bp_tgt->placed_address;
+  return procfs_set_watchpoint (inferior_ptid, addr, 0, 0, 0);
+}
+
 void
 procfs_use_watchpoints (struct target_ops *t)
 {
@@ -5394,6 +5408,8 @@ procfs_use_watchpoints (struct target_op
   t->to_insert_watchpoint = procfs_insert_watchpoint;
   t->to_remove_watchpoint = procfs_remove_watchpoint;
   t->to_region_ok_for_hw_watchpoint = procfs_region_ok_for_hw_watchpoint;
+  t->to_insert_hw_breakpoint = procfs_insert_hw_breakpoint;
+  t->to_remove_hw_breakpoint = procfs_remove_hw_breakpoint;
 }

 /*



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]