static void load_client ( /*OUT*/ExeInfo* info,
/*OUT*/Addr* client_ip)
{
- HChar* exe_name;
+ const HChar* exe_name;
Int ret;
SysRes res;
*/
static HChar** setup_client_env ( HChar** origenv, const HChar* toolname)
{
- HChar* preload_core = "vgpreload_core";
- HChar* ld_preload = "DYLD_INSERT_LIBRARIES=";
- HChar* dyld_cache = "DYLD_SHARED_REGION=";
- HChar* dyld_cache_value= "avoid";
- HChar* v_launcher = VALGRIND_LAUNCHER "=";
+ const HChar* preload_core = "vgpreload_core";
+ const HChar* ld_preload = "DYLD_INSERT_LIBRARIES=";
+ const HChar* dyld_cache = "DYLD_SHARED_REGION=";
+ const HChar* dyld_cache_value= "avoid";
+ const HChar* v_launcher = VALGRIND_LAUNCHER "=";
Int ld_preload_len = VG_(strlen)( ld_preload );
Int dyld_cache_len = VG_(strlen)( dyld_cache );
Int v_launcher_len = VG_(strlen)( v_launcher );
/*====================================================================*/
/* Add a string onto the string table, and return its address */
-static char *copy_str(char **tab, const char *str)
+static HChar *copy_str(HChar **tab, const HChar *str)
{
- char *cp = *tab;
- char *orig = cp;
+ HChar *cp = *tab;
+ HChar *orig = cp;
while(*str)
*cp++ = *str++;
static
Addr setup_client_stack( void* init_sp,
- char** orig_envp,
+ HChar** orig_envp,
const ExeInfo* info,
Addr clstack_end,
SizeT clstack_max_size )
{
- char **cpp;
- char *strtab; /* string table */
- char *stringbase;
+ HChar **cpp;
+ HChar *strtab; /* string table */
+ HChar *stringbase;
Addr *ptr;
unsigned stringsize; /* total size of strings in bytes */
unsigned auxsize; /* total size of auxv in bytes */
/* OK, now we know how big the client stack is */
stacksize =
sizeof(Word) + /* argc */
- (have_exename ? sizeof(char **) : 0) + /* argc[0] == exename */
- sizeof(char **)*argc + /* argv */
- sizeof(char **) + /* terminal NULL */
- sizeof(char **)*envc + /* envp */
- sizeof(char **) + /* terminal NULL */
+ (have_exename ? sizeof(HChar **) : 0) + /* argc[0] == exename */
+ sizeof(HChar **)*argc + /* argv */
+ sizeof(HChar **) + /* terminal NULL */
+ sizeof(HChar **)*envc + /* envp */
+ sizeof(HChar **) + /* terminal NULL */
auxsize + /* auxv */
VG_ROUNDUP(stringsize, sizeof(Word)); /* strings (aligned) */
client_SP = VG_ROUNDDN(client_SP, 32); /* make stack 32 byte aligned */
/* base of the string table (aligned) */
- stringbase = strtab = (char *)clstack_end
+ stringbase = strtab = (HChar *)clstack_end
- VG_ROUNDUP(stringsize, sizeof(int));
/* The max stack size */
/*OUT*/Addr* client_ip,
/*OUT*/Addr* client_toc)
{
- HChar* exe_name;
+ const HChar* exe_name;
Int ret;
SysRes res;
*/
static HChar** setup_client_env ( HChar** origenv, const HChar* toolname)
{
- HChar* preload_core = "vgpreload_core";
- HChar* ld_preload = "LD_PRELOAD=";
- HChar* v_launcher = VALGRIND_LAUNCHER "=";
+ const HChar* preload_core = "vgpreload_core";
+ const HChar* ld_preload = "LD_PRELOAD=";
+ const HChar* v_launcher = VALGRIND_LAUNCHER "=";
Int ld_preload_len = VG_(strlen)( ld_preload );
Int v_launcher_len = VG_(strlen)( v_launcher );
Bool ld_preload_done = False;
#endif /* AT_SECURE */
/* Add a string onto the string table, and return its address */
-static char *copy_str(char **tab, const char *str)
+static HChar *copy_str(HChar **tab, const HChar *str)
{
- char *cp = *tab;
- char *orig = cp;
+ HChar *cp = *tab;
+ HChar *orig = cp;
while(*str)
*cp++ = *str++;
static
Addr setup_client_stack( void* init_sp,
- char** orig_envp,
+ HChar** orig_envp,
const ExeInfo* info,
UInt** client_auxv,
Addr clstack_end,
SizeT clstack_max_size )
{
SysRes res;
- char **cpp;
- char *strtab; /* string table */
- char *stringbase;
+ HChar **cpp;
+ HChar *strtab; /* string table */
+ HChar *stringbase;
Addr *ptr;
struct auxv *auxv;
const struct auxv *orig_auxv;
/* OK, now we know how big the client stack is */
stacksize =
sizeof(Word) + /* argc */
- (have_exename ? sizeof(char **) : 0) + /* argc[0] == exename */
- sizeof(char **)*argc + /* argv */
- sizeof(char **) + /* terminal NULL */
- sizeof(char **)*envc + /* envp */
- sizeof(char **) + /* terminal NULL */
+ (have_exename ? sizeof(HChar **) : 0) + /* argc[0] == exename */
+ sizeof(HChar **)*argc + /* argv */
+ sizeof(HChar **) + /* terminal NULL */
+ sizeof(HChar **)*envc + /* envp */
+ sizeof(HChar **) + /* terminal NULL */
auxsize + /* auxv */
VG_ROUNDUP(stringsize, sizeof(Word)); /* strings (aligned) */
client_SP = VG_ROUNDDN(client_SP, 16); /* make stack 16 byte aligned */
/* base of the string table (aligned) */
- stringbase = strtab = (char *)clstack_end
+ stringbase = strtab = (HChar *)clstack_end
- VG_ROUNDUP(stringsize, sizeof(int));
clstack_start = VG_PGROUNDDN(client_SP);
VG_(memset)(&arch->vex_shadow1, 0xFF, sizeof(VexGuestS390XState));
VG_(memset)(&arch->vex_shadow2, 0x00, sizeof(VexGuestS390XState));
/* ... except SP, FPC, and IA */
- VG_(memset)((UChar *)&arch->vex_shadow1 + VG_O_STACK_PTR, 0x00, 8);
- VG_(memset)((UChar *)&arch->vex_shadow1 + VG_O_FPC_REG, 0x00, 4);
- VG_(memset)((UChar *)&arch->vex_shadow1 + VG_O_INSTR_PTR, 0x00, 8);
+ VG_(memset)(&arch->vex_shadow1 + VG_O_STACK_PTR, 0x00, 8);
+ VG_(memset)(&arch->vex_shadow1 + VG_O_FPC_REG, 0x00, 4);
+ VG_(memset)(&arch->vex_shadow1 + VG_O_INSTR_PTR, 0x00, 8);
/* Put essential stuff into the new state. */
arch->vex.guest_SP = iifii.initial_client_SP;
This routine will return True if (*func) returns True and False if
it reaches the end of the list without that happening.
*/
-static Bool scan_colsep(char *colsep, Bool (*func)(const char *))
+static Bool scan_colsep(HChar *colsep, Bool (*func)(const HChar *))
{
- char *cp, *entry;
+ HChar *cp, *entry;
int end;
if (colsep == NULL ||
end = (*cp == '\0');
if (*cp == ':' || *cp == '\0') {
- char save = *cp;
+ HChar save = *cp;
*cp = '\0';
if ((*func)(entry)) {
static HChar executable_name_in [VKI_PATH_MAX];
static HChar executable_name_out[VKI_PATH_MAX];
-static Bool match_executable(const char *entry)
+static Bool match_executable(const HChar *entry)
{
HChar buf[VG_(strlen)(entry) + VG_(strlen)(executable_name_in) + 3];
}
// Returns NULL if it wasn't found.
-HChar* ML_(find_executable) ( const HChar* exec )
+const HChar* ML_(find_executable) ( const HChar* exec )
{
vg_assert(NULL != exec);
if (VG_(strchr)(exec, '/')) {
#ifndef __PRIV_INITIMG_PATHSCAN_H
#define __PRIV_INITIMG_PATHSCAN_
-extern HChar* ML_(find_executable) ( const HChar* exec );
+extern const HChar* ML_(find_executable) ( const HChar* exec );
#endif