on m_machine.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3983
}
}
+// 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 = 1; tid < VG_N_THREADS; tid++) {
+ if (VG_(threads)[tid].status == VgTs_Empty) continue;
+ if ( p ( VG_(get_SP)(tid),
+ VG_(threads)[tid].client_stack_highest_word, d ) )
+ return tid;
+ }
+ return VG_INVALID_THREADID;
+}
/*--------------------------------------------------------------------*/
/*--- end ---*/
#include "pub_core_basics.h"
#include "pub_core_threadstate.h"
#include "pub_core_libcassert.h"
-#include "pub_core_machine.h" // For VG_(get_SP)
/*------------------------------------------------------------*/
/*--- Data structures. ---*/
return VG_INVALID_THREADID;
}
-/* 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 = 1; tid < VG_N_THREADS; tid++) {
- if (VG_(threads)[tid].status == VgTs_Empty) continue;
-
- if ( p ( VG_(get_SP)(tid),
- VG_(threads)[tid].client_stack_highest_word, d ) )
- return tid;
- }
- return VG_INVALID_THREADID;
-}
-
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
// doing leak checking.
extern void VG_(apply_to_GP_regs)(void (*f)(UWord val));
+// 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, void* d ),
+ void* d );
+
#endif // __PUB_TOOL_MACHINE_H
/*--------------------------------------------------------------------*/
/* Get the TID of the thread which currently has the CPU. */
extern ThreadId VG_(get_running_tid) ( void );
-/* 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, void* d ),
- void* d );
-
#endif // __PUB_TOOL_THREADSTATE_H
/*--------------------------------------------------------------------*/
#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"
#include "valgrind.h" // For {MALLOC,FREE}LIKE_BLOCK