Author: sewardj
Date: 2007-11-25 14:06:06 +0000 (Sun, 25 Nov 2007)
New Revision: 7212

Log:
Core-tool iface changes needed to support exp-drd (Bart Van Assche).

Modified:
   trunk/coregrind/m_syswrap/syswrap-linux.c
   trunk/coregrind/m_tooliface.c
   trunk/coregrind/pub_core_tooliface.h
   trunk/include/pub_tool_tooliface.h


Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c   2007-11-25 14:01:38 UTC (rev 
7211)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c   2007-11-25 14:06:06 UTC (rev 
7212)
@@ -78,6 +78,8 @@
       VG_(printf)("thread tid %d started: stack = %p\n",
                  tid, &tid);
 
+   VG_TRACK(pre_thread_first_insn, tid);
+
    tst->os_state.lwpid = VG_(gettid)();
    tst->os_state.threadgroup = VG_(getpid)();
 

Modified: trunk/coregrind/m_tooliface.c
===================================================================
--- trunk/coregrind/m_tooliface.c       2007-11-25 14:01:38 UTC (rev 7211)
+++ trunk/coregrind/m_tooliface.c       2007-11-25 14:06:06 UTC (rev 7212)
@@ -335,6 +335,7 @@
 DEF(track_stop_client_code,      ThreadId, ULong)
 
 DEF(track_pre_thread_ll_create,  ThreadId, ThreadId)
+DEF(track_pre_thread_first_insn, ThreadId)
 DEF(track_pre_thread_ll_exit,    ThreadId)
 
 DEF(track_pre_deliver_signal,    ThreadId, Int sigNo, Bool)

Modified: trunk/coregrind/pub_core_tooliface.h
===================================================================
--- trunk/coregrind/pub_core_tooliface.h        2007-11-25 14:01:38 UTC (rev 
7211)
+++ trunk/coregrind/pub_core_tooliface.h        2007-11-25 14:06:06 UTC (rev 
7212)
@@ -209,6 +209,7 @@
    void (*track_stop_client_code) (ThreadId, ULong);
 
    void (*track_pre_thread_ll_create)(ThreadId, ThreadId);
+   void (*track_pre_thread_first_insn)(ThreadId);
    void (*track_pre_thread_ll_exit)  (ThreadId);
 
    void (*track_pre_deliver_signal) (ThreadId, Int sigNo, Bool);

Modified: trunk/include/pub_tool_tooliface.h
===================================================================
--- trunk/include/pub_tool_tooliface.h  2007-11-25 14:01:38 UTC (rev 7211)
+++ trunk/include/pub_tool_tooliface.h  2007-11-25 14:06:06 UTC (rev 7212)
@@ -588,9 +588,21 @@
    low-level thread create/quit event.  In general a few hundred
    instructions; hence a few hundred(ish) memory references could get
    misclassified each time.
+
+   pre_thread_first_insn: is called when the thread is all set up and
+   ready to go (stack in place, etc) but has not executed its first
+   instruction yet.  Gives threading tools a chance to ask questions
+   about the thread (eg, what is its initial client stack pointer)
+   that are not easily answered at pre_thread_ll_create time.
+
+   For a given thread, the call sequence is:
+      ll_create (in the parent's context)
+      first_insn (in the child's context)
+      ll_exit (in the child's context)
 */
-void VG_(track_pre_thread_ll_create)(void(*f)(ThreadId tid, ThreadId child));
-void VG_(track_pre_thread_ll_exit)  (void(*f)(ThreadId tid));
+void VG_(track_pre_thread_ll_create) (void(*f)(ThreadId tid, ThreadId child));
+void VG_(track_pre_thread_first_insn)(void(*f)(ThreadId tid));
+void VG_(track_pre_thread_ll_exit)   (void(*f)(ThreadId tid));
 
 
 /* Signal events (not exhaustive)


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to