From: Nicholas Nethercote Date: Mon, 29 Nov 2004 15:45:31 +0000 (+0000) Subject: Minor 64-bit cleanups, mostly comments. X-Git-Tag: svn/VALGRIND_3_0_0~1178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a1cef27ad839e5a1762bfc629351d83cc34fc16;p=thirdparty%2Fvalgrind.git Minor 64-bit cleanups, mostly comments. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3140 --- diff --git a/coregrind/linux/syscalls.c b/coregrind/linux/syscalls.c index 84bab5b6a7..726dc1d1f5 100644 --- a/coregrind/linux/syscalls.c +++ b/coregrind/linux/syscalls.c @@ -253,6 +253,8 @@ PRE(sys_syslog, MayBlock) PRINT("sys_syslog (%d, %p, %d)", ARG1,ARG2,ARG3); PRE_REG_READ3(long, "syslog", int, type, char *, bufp, int, len); switch (ARG1) { + // The kernel uses magic numbers here, rather than named constants, + // therefore so do we. case 2: case 3: case 4: PRE_MEM_WRITE( "syslog(bufp)", ARG2, ARG3); break; diff --git a/coregrind/vg_dwarf.c b/coregrind/vg_dwarf.c index aff343f8d1..cbb90df3d2 100644 --- a/coregrind/vg_dwarf.c +++ b/coregrind/vg_dwarf.c @@ -202,6 +202,8 @@ int process_extended_line_op( SegInfo *si, Char*** fnames, case DW_LNE_set_address: /* XXX: Pointer size could be 8 */ + // (and there may be other 32-bit assumptions within this file? + // not sure... --njn) vg_assert(pointer_size == 4); adr = *((Addr *)data); if (0) VG_(printf)("smr.a := %p\n", adr ); diff --git a/coregrind/vg_scheduler.c b/coregrind/vg_scheduler.c index 7d193feb4f..dfc2913cf5 100644 --- a/coregrind/vg_scheduler.c +++ b/coregrind/vg_scheduler.c @@ -426,7 +426,7 @@ void VG_(scheduler_init) ( void ) vg_assert(tid_main == 1); VG_(threads)[tid_main].status = VgTs_Runnable; - VG_(threads)[tid_main].stack_highest_word = VG_(clstk_end) - 4; + VG_(threads)[tid_main].stack_highest_word = VG_(clstk_end) - sizeof(UWord); VG_(threads)[tid_main].stack_base = VG_(clstk_base); VG_(threads)[tid_main].stack_size = VG_(client_rlimit_stack).rlim_cur; @@ -1824,7 +1824,7 @@ void do__apply_in_new_thread ( ThreadId parent_tid, VG_(threads)[tid].stack_size = new_stk_szb; VG_(threads)[tid].stack_highest_word = new_stack + new_stk_szb - - VG_AR_CLIENT_STACKBASE_REDZONE_SZB; /* -4 ??? */; + - VG_AR_CLIENT_STACKBASE_REDZONE_SZB; /* - sizeof(UWord) ??? */; } /* Having got memory to hold the thread's stack: diff --git a/coregrind/vg_signals.c b/coregrind/vg_signals.c index 0093c4dfa3..b8eb72f069 100644 --- a/coregrind/vg_signals.c +++ b/coregrind/vg_signals.c @@ -981,6 +981,9 @@ void VG_(kill_self)(Int sigNo) // Core dumping is disabled until someone can work out how to abstract out // the arch-specific and word-size-specific parts neatly. +// +// Note that the code below is not 64-bit clean! +// #if 0 /* Dump core