|
From: Nicholas N. <nj...@cs...> - 2007-03-28 22:09:54
|
On Wed, 28 Mar 2007, Emre Can Sezer wrote:
> I am writing a tool for Valgrind v2.4.0. I currently check memory writes
> and want to add a functionality that checks whether the destination memory
> is within the client address space. Is there an easy way to check for this
> from the tool?
>
> If the client address space boundary is hardcoded in the valgrind source
> files, where can I find it?
>
> Or is there an easy way to check for stack base(s) from the tool?
I'd recommend using a current SVN (pre-3.3.0) version. 2.4.0 is really old,
no longer supported, and there have been *many* changes (for the better) to
Valgrind since then.
3.2.3 has these stack inspection functions, in include/pub_tool_machine.h:
/ This iterator lets you inspect each live thread's stack bounds. The
// params are all 'out' params. Returns False at the end.
extern void VG_(thread_stack_reset_iter) ( void );
extern Bool VG_(thread_stack_next) ( ThreadId* tid, Addr* stack_min,
Addr* stack_max );
I think 2.4.0 had a similar way to get the information, but I can't remember
the exact details. You should hopefully be able to work it out with the
above function prototypes and by looking at the code a bit.
Nick
|