]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Added VG_(thread_get_stack_size)().
authorBart Van Assche <bvanassche@acm.org>
Sat, 29 Mar 2008 09:25:53 +0000 (09:25 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sat, 29 Mar 2008 09:25:53 +0000 (09:25 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7799

coregrind/m_machine.c
include/pub_tool_machine.h

index 42bdc17cf06d17bdd5476e25ab761f1c414ffaaa..3bf1246d2cab3d25543df270949603fa163b22dc 100644 (file)
@@ -223,6 +223,13 @@ Addr VG_(thread_get_stack_max)(ThreadId tid)
    return VG_(threads)[tid].client_stack_highest_word;
 }
 
+SizeT VG_(thread_get_stack_size)(ThreadId tid)
+{
+   vg_assert(0 <= tid && tid < VG_N_THREADS && tid != VG_INVALID_THREADID);
+   vg_assert(VG_(threads)[tid].status != VgTs_Empty);
+   return VG_(threads)[tid].client_stack_szB;
+}
+
 //-------------------------------------------------------------
 /* Details about the capabilities of the underlying (host) CPU.  These
    details are acquired by (1) enquiring with the CPU at startup, or
index c8556b53e1ff05431c588f1b54a69d39396ca2e8..bb9a4cc2a22bda35524b8064619adec4ae694fe8 100644 (file)
@@ -105,6 +105,9 @@ extern Bool VG_(thread_stack_next)       ( /*MOD*/ThreadId* tid,
 // Returns .client_stack_highest_word for the given thread
 extern Addr VG_(thread_get_stack_max) ( ThreadId tid );
 
+// Returns how many bytes have been allocated for the stack of the given thread
+extern Addr VG_(thread_get_stack_size) ( ThreadId tid );
+
 // Given a pointer to a function as obtained by "& functionname" in C,
 // produce a pointer to the actual entry point for the function.  For
 // most platforms it's the identity function.  Unfortunately, on