|
From: <sv...@va...> - 2005-06-21 04:01:54
|
Author: njn
Date: 2005-06-21 05:01:51 +0100 (Tue, 21 Jun 2005)
New Revision: 3983
Log:
Moved VG_(first_matching_thread_stack), removing m_threadstate's dependen=
cy
on m_machine.
Modified:
trunk/coregrind/m_machine.c
trunk/coregrind/m_threadstate.c
trunk/include/pub_tool_machine.h
trunk/include/pub_tool_threadstate.h
trunk/massif/ms_main.c
Modified: trunk/coregrind/m_machine.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_machine.c 2005-06-21 03:52:49 UTC (rev 3982)
+++ trunk/coregrind/m_machine.c 2005-06-21 04:01:51 UTC (rev 3983)
@@ -178,8 +178,24 @@
}
}
=20
+// Try and identify a thread whose stack satisfies the predicate p, or
+// return VG_INVALID_THREADID if none do.
+ThreadId VG_(first_matching_thread_stack)
+ ( Bool (*p) ( Addr stack_min, Addr stack_max, void* d ),
+ void* d )
+{
+ ThreadId tid;
=20
+ for (tid =3D 1; tid < VG_N_THREADS; tid++) {
+ if (VG_(threads)[tid].status =3D=3D VgTs_Empty) continue;
=20
+ if ( p ( VG_(get_SP)(tid),
+ VG_(threads)[tid].client_stack_highest_word, d ) )
+ return tid;
+ }
+ return VG_INVALID_THREADID;
+}
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_threadstate.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_threadstate.c 2005-06-21 03:52:49 UTC (rev 3982)
+++ trunk/coregrind/m_threadstate.c 2005-06-21 04:01:51 UTC (rev 3983)
@@ -31,7 +31,6 @@
#include "pub_core_basics.h"
#include "pub_core_threadstate.h"
#include "pub_core_libcassert.h"
-#include "pub_core_machine.h" // For VG_(get_SP)
=20
/*------------------------------------------------------------*/
/*--- Data structures. ---*/
@@ -123,26 +122,6 @@
return VG_INVALID_THREADID;
}
=20
-/* For constructing error messages only: try and identify a thread
- whose stack satisfies the predicate p, or return VG_INVALID_THREADID
- if none do.
-*/
-ThreadId VG_(first_matching_thread_stack)
- ( Bool (*p) ( Addr stack_min, Addr stack_max, void* d ),
- void* d )
-{
- ThreadId tid;
-
- for (tid =3D 1; tid < VG_N_THREADS; tid++) {
- if (VG_(threads)[tid].status =3D=3D VgTs_Empty) continue;
-
- if ( p ( VG_(get_SP)(tid),
- VG_(threads)[tid].client_stack_highest_word, d ) )
- return tid;
- }
- return VG_INVALID_THREADID;
-}
-=20
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/include/pub_tool_machine.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/pub_tool_machine.h 2005-06-21 03:52:49 UTC (rev 3982)
+++ trunk/include/pub_tool_machine.h 2005-06-21 04:01:51 UTC (rev 3983)
@@ -74,6 +74,12 @@
// doing leak checking.
extern void VG_(apply_to_GP_regs)(void (*f)(UWord val));
=20
+// Searches through all thread stacks to see if any match. Returns
+// VG_INVALID_THREADID if none match.
+extern ThreadId VG_(first_matching_thread_stack)
+ ( Bool (*p) ( Addr stack_min, Addr stack_max, vo=
id* d ),
+ void* d );
+
#endif // __PUB_TOOL_MACHINE_H
=20
/*--------------------------------------------------------------------*/
Modified: trunk/include/pub_tool_threadstate.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/pub_tool_threadstate.h 2005-06-21 03:52:49 UTC (rev 398=
2)
+++ trunk/include/pub_tool_threadstate.h 2005-06-21 04:01:51 UTC (rev 398=
3)
@@ -46,12 +46,6 @@
/* Get the TID of the thread which currently has the CPU. */
extern ThreadId VG_(get_running_tid) ( void );
=20
-/* Searches through all thread's stacks to see if any match. Returns
- VG_INVALID_THREADID if none match. */
-extern ThreadId VG_(first_matching_thread_stack)
- ( Bool (*p) ( Addr stack_min, Addr stack_max, vo=
id* d ),
- void* d );
-
#endif // __PUB_TOOL_THREADSTATE_H
=20
/*--------------------------------------------------------------------*/
Modified: trunk/massif/ms_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/massif/ms_main.c 2005-06-21 03:52:49 UTC (rev 3982)
+++ trunk/massif/ms_main.c 2005-06-21 04:01:51 UTC (rev 3983)
@@ -43,12 +43,12 @@
#include "pub_tool_libcmman.h"
#include "pub_tool_libcprint.h"
#include "pub_tool_libcproc.h"
+#include "pub_tool_machine.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.h"
#include "pub_tool_profile.h"
#include "pub_tool_replacemalloc.h"
#include "pub_tool_stacktrace.h"
-#include "pub_tool_threadstate.h"
#include "pub_tool_tooliface.h"
=20
#include "valgrind.h" // For {MALLOC,FREE}LIKE_BLOCK
|