]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Don't need to use addr_t anymore, use Addr instead, for consistency.
authorNicholas Nethercote <n.nethercote@gmail.com>
Mon, 1 Nov 2004 18:38:00 +0000 (18:38 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Mon, 1 Nov 2004 18:38:00 +0000 (18:38 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2897

coregrind/stage1.c
coregrind/ume.c
coregrind/ume.h
coregrind/vg_main.c
coregrind/x86/jmp_with_stack.c
memcheck/tests/vgtest_ume.c

index c52d66386eab4e20d0966ca17a0f154ceba6cb37..de0f45de7a62df8d11cb365aa0674a02c4327da9 100644 (file)
@@ -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));
 }
 
 /*--------------------------------------------------------------------*/
index aedbbadfe6cfee41f62476b1fbd9ba7e0f0c1b1b..f0e02b313ebd36fcb7ae3fa538b64d55294fc1b7 100644 (file)
@@ -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);
 
index 873b93036792bd8d4ca393792d372b8e36cdebc7..b244a93d105886b1066c56ea0178248f83ec03aa 100644 (file)
@@ -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
index d7b4f004930f13e223aa685727168212d47c5be6..fd9c6b8e8921a45540154c982b103c189f72737f 100644 (file)
@@ -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 --- */
index 1e8a55fd2c7f11af992964278c3a4c4e3f6a236d..cc74c03fd197cca709be25c9691a42f9b8fab6ab 100644 (file)
@@ -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 */
index dc9acadbd18727238095c3e39f4dd2a5b7642cfd..29a3eac5dfc6fa6e9959ad3c49c3b87d9aa83658 100644 (file)
@@ -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
 }