From: Nicholas Nethercote Date: Mon, 1 Nov 2004 18:38:00 +0000 (+0000) Subject: Don't need to use addr_t anymore, use Addr instead, for consistency. X-Git-Tag: svn/VALGRIND_3_0_0~1410 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b48ba617e031ae4510e7cc8c8fb6216a27895f38;p=thirdparty%2Fvalgrind.git Don't need to use addr_t anymore, use Addr instead, for consistency. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2897 --- diff --git a/coregrind/stage1.c b/coregrind/stage1.c index c52d66386e..de0f45de7a 100644 --- a/coregrind/stage1.c +++ b/coregrind/stage1.c @@ -297,7 +297,7 @@ static void main2(void) foreach_map(prmap, /*dummy*/NULL); } - jmp_with_stack(info.init_eip, (addr_t)esp); + jmp_with_stack(info.init_eip, (Addr)esp); } int main(int argc, char** argv) @@ -319,7 +319,7 @@ int main(int argc, char** argv) setrlimit(RLIMIT_AS, &rlim); /* move onto another stack so we can play with the main one */ - jmp_with_stack((addr_t)main2, (addr_t)stack + sizeof(stack)); + jmp_with_stack((Addr)main2, (Addr)stack + sizeof(stack)); } /*--------------------------------------------------------------------*/ diff --git a/coregrind/ume.c b/coregrind/ume.c index aedbbadfe6..f0e02b313e 100644 --- a/coregrind/ume.c +++ b/coregrind/ume.c @@ -414,7 +414,7 @@ static int load_ELF(char *hdr, int len, int fd, const char *name, info->exe_base = minaddr + ebase; info->exe_end = maxaddr + ebase; - info->init_eip = (addr_t)entry; + info->init_eip = (Addr)entry; free(e); diff --git a/coregrind/ume.h b/coregrind/ume.h index 873b930367..b244a93d10 100644 --- a/coregrind/ume.h +++ b/coregrind/ume.h @@ -54,11 +54,8 @@ void foreach_map(int (*fn)(char *start, char *end, #error ELFSZ needs to ==32 or ==64 #endif -/* Integer type the same size as a pointer */ -typedef ESZ(Addr) addr_t; - // Jump to a new 'ip' with the stack 'sp'. -void jmp_with_stack(addr_t ip, addr_t sp) __attribute__((noreturn)); +void jmp_with_stack(Addr ip, Addr sp) __attribute__((noreturn)); /*------------------------------------------------------------*/ /*--- Loading ELF files ---*/ @@ -68,18 +65,18 @@ void jmp_with_stack(addr_t ip, addr_t sp) __attribute__((noreturn)); // inputs/outputs of do_exec(). struct exeinfo { - addr_t map_base; // IN: if non-zero, base address of mappings + Addr map_base; // IN: if non-zero, base address of mappings char** argv; // IN: the original argv - addr_t exe_base; // INOUT: lowest (allowed) address of exe - addr_t exe_end; // INOUT: highest (allowed) address + Addr exe_base; // INOUT: lowest (allowed) address of exe + Addr exe_end; // INOUT: highest (allowed) address - addr_t phdr; // OUT: address phdr was mapped at - int phnum; // OUT: number of phdrs - addr_t interp_base; // OUT: where interpreter (ld.so) was mapped - addr_t entry; // OUT: entrypoint in main executable - addr_t init_eip; // OUT: initial eip - addr_t brkbase; // OUT: base address of brk segment + Addr phdr; // OUT: address phdr was mapped at + int phnum; // OUT: number of phdrs + Addr interp_base; // OUT: where interpreter (ld.so) was mapped + Addr entry; // OUT: entrypoint in main executable + Addr init_eip; // OUT: initial eip + Addr brkbase; // OUT: base address of brk segment // These are the extra args added by #! scripts char* interp_name; // OUT: the interpreter name diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c index d7b4f00493..fd9c6b8e89 100644 --- a/coregrind/vg_main.c +++ b/coregrind/vg_main.c @@ -399,9 +399,9 @@ extern char _start[]; static void layout_remaining_space(Addr argc_addr, float ratio) { - Int ires; - void* vres; - addr_t client_size, shadow_size; + Int ires; + void* vres; + Addr client_size, shadow_size; // VG_(valgrind_base) should have been set by scan_auxv, but if not, // this is a workable approximation @@ -419,7 +419,7 @@ static void layout_remaining_space(Addr argc_addr, float ratio) VG_(client_end) = VG_(client_base) + client_size; /* where !FIXED mmap goes */ VG_(client_mapbase) = VG_(client_base) + - PGROUNDDN((addr_t)(client_size * CLIENT_HEAP_PROPORTION)); + PGROUNDDN((Addr)(client_size * CLIENT_HEAP_PROPORTION)); VG_(shadow_base) = VG_(client_end) + REDZONE_SIZE; VG_(shadow_end) = VG_(valgrind_base); @@ -926,7 +926,7 @@ static Addr setup_client_stack(void* init_sp, char **cpp; char *strtab; /* string table */ char *stringbase; - addr_t *ptr; + Addr *ptr; struct ume_auxv *auxv; const struct ume_auxv *orig_auxv; const struct ume_auxv *cauxv; @@ -935,7 +935,7 @@ static Addr setup_client_stack(void* init_sp, int argc; /* total argc */ int envc; /* total number of env vars */ unsigned stacksize; /* total client stack size */ - addr_t cl_esp; /* client stack base (initial esp) */ + Addr cl_esp; /* client stack base (initial esp) */ /* use our own auxv as a prototype */ orig_auxv = find_auxv(init_sp); @@ -1021,29 +1021,29 @@ static Addr setup_client_stack(void* init_sp, /* ==================== copy client stack ==================== */ - ptr = (addr_t *)cl_esp; + ptr = (Addr*)cl_esp; /* --- argc --- */ *ptr++ = argc; /* client argc */ /* --- argv --- */ if (info->interp_name) { - *ptr++ = (addr_t)copy_str(&strtab, info->interp_name); + *ptr++ = (Addr)copy_str(&strtab, info->interp_name); free(info->interp_name); } if (info->interp_args) { - *ptr++ = (addr_t)copy_str(&strtab, info->interp_args); + *ptr++ = (Addr)copy_str(&strtab, info->interp_args); free(info->interp_args); } for (cpp = orig_argv; *cpp; ptr++, cpp++) { - *ptr = (addr_t)copy_str(&strtab, *cpp); + *ptr = (Addr)copy_str(&strtab, *cpp); } *ptr++ = 0; /* --- envp --- */ VG_(client_envp) = (Char **)ptr; for (cpp = orig_envp; cpp && *cpp; ptr++, cpp++) - *ptr = (addr_t)copy_str(&strtab, *cpp); + *ptr = (Addr)copy_str(&strtab, *cpp); *ptr++ = 0; /* --- auxv --- */ diff --git a/coregrind/x86/jmp_with_stack.c b/coregrind/x86/jmp_with_stack.c index 1e8a55fd2c..cc74c03fd1 100644 --- a/coregrind/x86/jmp_with_stack.c +++ b/coregrind/x86/jmp_with_stack.c @@ -31,7 +31,7 @@ to simulate the initial CPU state when the kernel starts an program after exec; it therefore also clears all the other registers. */ -void jmp_with_stack(addr_t eip, addr_t esp) +void jmp_with_stack(Addr eip, Addr esp) { asm volatile ("movl %1, %%esp;" /* set esp */ "pushl %%eax;" /* push esp */ diff --git a/memcheck/tests/vgtest_ume.c b/memcheck/tests/vgtest_ume.c index dc9acadbd1..29a3eac5df 100644 --- a/memcheck/tests/vgtest_ume.c +++ b/memcheck/tests/vgtest_ume.c @@ -134,7 +134,7 @@ static void test__do_exec(void) // fprintf(stderr, "ume_go: %p %p\n", (void*)info.init_eip, (void*)esp); - jmp_with_stack(info.init_eip, (addr_t)esp); + jmp_with_stack(info.init_eip, (Addr)esp); assert(0); // UNREACHABLE }