]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Added functions for querying the properties of the alternate stack.
authorBart Van Assche <bvanassche@acm.org>
Thu, 2 Sep 2010 14:38:38 +0000 (14:38 +0000)
committerBart Van Assche <bvanassche@acm.org>
Thu, 2 Sep 2010 14:38:38 +0000 (14:38 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11324

coregrind/m_machine.c
include/pub_tool_machine.h

index 250a21c7ed4338cab469867e2a54656796a46d83..7a7e1e1c17a621bcd905d3f19fdfc977d81e2254 100644 (file)
@@ -310,6 +310,20 @@ SizeT VG_(thread_get_stack_size)(ThreadId tid)
    return VG_(threads)[tid].client_stack_szB;
 }
 
+Addr VG_(thread_get_altstack_min)(ThreadId tid)
+{
+   vg_assert(0 <= tid && tid < VG_N_THREADS && tid != VG_INVALID_THREADID);
+   vg_assert(VG_(threads)[tid].status != VgTs_Empty);
+   return (Addr)VG_(threads)[tid].altstack.ss_sp;
+}
+
+SizeT VG_(thread_get_altstack_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].altstack.ss_size;
+}
+
 //-------------------------------------------------------------
 /* Details about the capabilities of the underlying (host) CPU.  These
    details are acquired by (1) enquiring with the CPU at startup, or
index c9d77dd72621aed34f1ea096a051c6e0d11dd7ae..5d89c708d1cb0f4f04aa200036dd6524abee0510 100644 (file)
@@ -148,6 +148,14 @@ 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 );
 
+// Returns the bottommost address of the alternate signal stack.
+// See also the man page of sigaltstack().
+extern Addr VG_(thread_get_altstack_min) ( ThreadId tid );
+
+// Returns how many bytes have been allocated for the alternate signal stack.
+// See also the man page of sigaltstack().
+extern SizeT VG_(thread_get_altstack_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