mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-06 11:41:34 +00:00
drd: Refactor functions for starting / stopping to access stack memory
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12331
This commit is contained in:
parent
f374300062
commit
d953fbfc3c
@ -453,14 +453,19 @@ void drd_start_using_mem_w_perms(const Addr a, const SizeT len,
|
||||
* the addresses in range [ a, a + len [ may now be used by the client.
|
||||
* Assumption: stacks grow downward.
|
||||
*/
|
||||
static __inline__
|
||||
void drd_start_using_mem_stack2(const DrdThreadId tid, const Addr a,
|
||||
const SizeT len)
|
||||
{
|
||||
DRD_(thread_set_stack_min)(tid, a - VG_STACK_REDZONE_SZB);
|
||||
drd_start_using_mem(a - VG_STACK_REDZONE_SZB, len + VG_STACK_REDZONE_SZB,
|
||||
True);
|
||||
}
|
||||
|
||||
static __inline__
|
||||
void drd_start_using_mem_stack(const Addr a, const SizeT len)
|
||||
{
|
||||
DRD_(thread_set_stack_min)(DRD_(thread_get_running_tid)(),
|
||||
a - VG_STACK_REDZONE_SZB);
|
||||
drd_start_using_mem(a - VG_STACK_REDZONE_SZB,
|
||||
len + VG_STACK_REDZONE_SZB,
|
||||
True);
|
||||
drd_start_using_mem_stack2(DRD_(thread_get_running_tid)(), a, len);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -469,14 +474,20 @@ void drd_start_using_mem_stack(const Addr a, const SizeT len)
|
||||
* Assumption: stacks grow downward.
|
||||
*/
|
||||
static __inline__
|
||||
void drd_stop_using_mem_stack(const Addr a, const SizeT len)
|
||||
void drd_stop_using_mem_stack2(const DrdThreadId tid, const Addr a,
|
||||
const SizeT len)
|
||||
{
|
||||
DRD_(thread_set_stack_min)(DRD_(thread_get_running_tid)(),
|
||||
a + len - VG_STACK_REDZONE_SZB);
|
||||
DRD_(thread_set_stack_min)(tid, a + len - VG_STACK_REDZONE_SZB);
|
||||
drd_stop_using_mem(a - VG_STACK_REDZONE_SZB, len + VG_STACK_REDZONE_SZB,
|
||||
True);
|
||||
}
|
||||
|
||||
static __inline__
|
||||
void drd_stop_using_mem_stack(const Addr a, const SizeT len)
|
||||
{
|
||||
drd_stop_using_mem_stack2(DRD_(thread_get_running_tid)(), a, len);
|
||||
}
|
||||
|
||||
static
|
||||
Bool on_alt_stack(const Addr a)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user