The following is a modified version of my thread watchpoint patch from October/November. It removes the code I had used to switch between lwp ptids and thread ptids now that Daniel's lwp patch is in place. It uses the former version of my observer that is linux-specific and is activated in attach_thread in linux-thread-db.c. Eli, I renamed the observer as asked to indicate this. I also addressed Ulrich's comments regarding simplifying the S390 code and using the s390_fix_watch_points call to actually put the watchpoints on the new thread. Ulrich/Daniel can you take a look to verify everything is in place. Daniel, I realize that this touches files that are currently in patch state for you. I have no problem waiting for your latest patch to apply and retrofitting my changes at check-in if necessary. As I mentioned before, more is required to get ia64 threaded watchpoints to work. For S390, this change allows it to set and recognize threaded watchpoints. -- Jeff J. 2004-12-09 Jeff Johnston * breakpoint.c (insert_watchpoints_for_new_thread): New function. (print_it_typical): Do not issue an error for bp_thread_event if a subsequent event is on the chain. * 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_stopped_data_address): Call target_get_lwp to ensure the ptid has its lwp field filled in. (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 linux thread observer. * linux-nat.h (struct linux_watchpoint): New structure. * linux-thread-db.c (attach_thread): Notify all linux new thread observers. * s390-nat.c (s390_tid): 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_watchpoint_callback): New function. (s390_insert_watchpoint): Change to iterate through lwps and insert the specified watchpoint on each thread. (s390_linux_new_thread): New linux thread observer. (_initialize_s390_nat): New function. Initialize new linux thread observer. * Makefile.in (s390-nat.o, ia64-linux-nat.o): Add new header file dependencies. doc/ChangeLog 2004-12-09 Jeff Johnston * observer.texi (linux_new_thread): New observer.