[RFA]: Watchpoints per thread patch

Jeff Johnston jjohnstn@redhat.com
Tue Oct 19 23:57:00 GMT 2004


The following patch adds needed support for the ia64 and s390 platforms.  For 
these platforms, watchpoints need to be inserted / removed on each thread so as 
to work across all threads.  The patch adds support for detecting this at 
configuration time and setting a new flag WATCHPOINTS_PER_THREAD.  This flag is 
used when inserting/removing watchpoints and when a new thread event occurs.

This patch in itself does not give these platforms threaded watchpoint support 
to pass the watchthreads.exp test case, but I am breaking up my bigger patch 
that works for x86, x86_64, and ia64.  It still fails on the S390 but gets part 
marks because threaded watchpoints actually trigger properly however the S390 
cannot determine which watchpoint gets triggered when multiple watchpoint events 
occur. On ia64, the watchthreads.exp test case will fail differently than before 
because the low-level register and watchpoint code does not properly calculate 
the LWP for accessing registers so we end up eating through the maximum number 
of watchpoints quicker than anticipated.  I have a subsequent patch for getting 
the LWP reliably, but this subsequent patch may be made unnecessary depending on 
what Daniel does with ptids and the thread-db layer.  Regardless of Daniel's 
redesign, the watchpoints still must be inserted/removed on each thread.

Ok to commit?

-- Jeff J.

2004-10-19  Jeff Johnston  <jjohnstn@redhat.com>

         * configure.host: For ia64 and s390 platforms, support watchpoints
         per thread.
         * configure.in: Set WATCHPOINTS_PER_THREAD flag if platform
         has watchpoints per thread.
	* config.in: Regenerated.
	* configure: Ditto.
         * thread.c (restore_current_thread): Add new silent flag argument.
         Do not issue message if switching threads and the silent flag is
         set.  Change all existing callers to call with new argument.
         Add call to find_thread_pid to safeguard against accessing an
         incomplete or invalid thread list item.
         (thread_switch_and_call): New function.
         * breakpoint.h: Define incomplete struct thread_info type.
         (insert_watchpoints_for_new_thread): New prototype.
         * breakpoint.c (insert_watchpoints_for_new_thread): New function.
         (insert_one_watchpoint): Ditto.
         (insert_watchpoint): Ditto.
         (remove_one_watchpoint): Ditto.
         (remove_watchpoint): Ditto.
         (remove_breakpoint): Call remove_watchpoint instead of
         target_remove_watchpoint.
         (insert_bp_location): Call insert_watchpoint instead of
         target_insert_watchpoint.
         (print_it_typical): Support watchpoints occurring at the same
         time as thread events.
         * thread-db.c (attach_thread)[WATCHPOINTS_PER_THREAD]: Call
         insert_watchpoints_for_new_thread.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: threadswitch.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20041019/6dc9830f/attachment.ksh>


More information about the Gdb-patches mailing list