mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-11 14:01:48 +00:00
Support AT_EXECFN in the ELF auxv, filling it in with the path of
the client executable valgrind is starting. Based on a patch from John Reiser. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10885
This commit is contained in:
@@ -258,6 +258,10 @@ static HChar** setup_client_env ( HChar** origenv, const HChar* toolname)
|
||||
#define AT_RANDOM 25
|
||||
#endif /* AT_RANDOM */
|
||||
|
||||
#ifndef AT_EXECFN
|
||||
#define AT_EXECFN 31
|
||||
#endif /* AT_EXECFN */
|
||||
|
||||
#ifndef AT_SYSINFO
|
||||
#define AT_SYSINFO 32
|
||||
#endif /* AT_SYSINFO */
|
||||
@@ -439,6 +443,8 @@ Addr setup_client_stack( void* init_sp,
|
||||
stringsize += VG_(strlen)(cauxv->u.a_ptr) + 1;
|
||||
else if (cauxv->a_type == AT_RANDOM)
|
||||
stringsize += 16;
|
||||
else if (cauxv->a_type == AT_EXECFN)
|
||||
stringsize += VG_(strlen)(VG_(args_the_exename)) + 1;
|
||||
auxsize += sizeof(*cauxv);
|
||||
}
|
||||
|
||||
@@ -709,6 +715,11 @@ Addr setup_client_stack( void* init_sp,
|
||||
strtab += 16;
|
||||
break;
|
||||
|
||||
case AT_EXECFN:
|
||||
/* points to the executable filename */
|
||||
auxv->u.a_ptr = copy_str(&strtab, VG_(args_the_exename));
|
||||
break;
|
||||
|
||||
default:
|
||||
/* stomp out anything we don't know about */
|
||||
VG_(debugLog)(2, "initimg",
|
||||
|
||||
Reference in New Issue
Block a user