From: Bart Van Assche Date: Tue, 10 Mar 2009 09:22:13 +0000 (+0000) Subject: Added DRD_(thread_address_on_any_stack)(). X-Git-Tag: svn/VALGRIND_3_5_0~889 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ab0d4001f98a9e568b5f83585e0715fc2dc55fb;p=thirdparty%2Fvalgrind.git Added DRD_(thread_address_on_any_stack)(). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9338 --- diff --git a/drd/drd_thread.h b/drd/drd_thread.h index 919ca92abf..d861464157 100644 --- a/drd/drd_thread.h +++ b/drd/drd_thread.h @@ -253,6 +253,27 @@ Bool DRD_(thread_address_on_stack)(const Addr a) && a < DRD_(g_threadinfo)[DRD_(g_drd_running_tid)].stack_max); } +/** + * Return true if and only if the specified address is on the stack of any + * thread. + */ +static __inline__ +Bool DRD_(thread_address_on_any_stack)(const Addr a) +{ + int i; + + for (i = 1; i < DRD_N_THREADS; i++) + { + if (DRD_(g_threadinfo)[i].vg_thread_exists + && DRD_(g_threadinfo)[i].stack_min <= a + && a < DRD_(g_threadinfo)[i].stack_max) + { + return True; + } + } + return False; +} + /** Return a pointer to the latest segment for the specified thread. */ static __inline__ Segment* DRD_(thread_get_segment)(const DrdThreadId tid)