Daniel Jacobowitz wrote: > On Wed, Oct 20, 2004 at 01:27:15PM -0400, Andrew Cagney wrote: > >>the underlying target (ia64-linux-nat, ...) can locally override the >>method and handle the problem. The code's the same, but how it is wired >>up is different >> >>Sound reasonable to all? > > > I think that sounds pretty good. Hopefully the changes involved will > be pretty small, since I imagine that most GNU/Linux targets with > hardware watchpoints will want it. > The attached patch is the rework of my original attempt. It no longer uses configuration or magic defines. Per Mark's suggestion, it uses an observer to handle inserting watchpoints on a new thread and only the low-level code knows about inserting/removing watchpoints on all threads. Ok to commit? -- Jeff J. 2004-10-27 Jeff Johnston * breakpoint.c (insert_watchpoints_for_new_thread): New function. * breakpoint.h (insert_watchpoints_for_new_thread): New prototype. * ia64-linux-nat.c (ia64_linux_insert_one_watchpoint): New function. (ia64_linux_insert_watchpoint_callback): Ditto. (ia64_linux_insert_watchpoint): Change to iterate through lwps and insert the specified watchpoint per thread. (ia64_linux_remove_one_watchpoint): New function. (ia64_linux_remove_watchpoint_callback): Ditto. (ia64_linux_remove_watchpoint): Change to iterate through lwps and remove the specified watchpoint for each thread. (ia64_linux_new_thread): New thread observer. (_initialize_ia64_linux_nat): New function. Initialize new thread observer. * thread-db.c (attach_thread): Notify any observers of the new thread event. * s390-nat.c (s390_tid): New function. (s390_inferior_tid): Change to call s390_tid. (s390_remove_one_watchpoint): New function. (s390_remove_watchpoint_callback): Ditto. (s390_remove_watchpoint): Change to iterate through lwps and remove the specified watchpoint for each thread. (s390_insert_one_watchpoint): New function. (s390_insert_watchpoint_callback): Ditto. (s390_insert_watchpoint): Change to iterate through lwps and insert the specified watchpoint on each thread. (s390_new_thread): New thread observer. (_initialize_s390_nat): New function. Initialize new thread observer. doc/ChangeLog: 2004-10-27 Jeff Johnston * observer.texi (new_thread): New observer.