From: Nicholas Nethercote Date: Tue, 2 Nov 2004 13:06:32 +0000 (+0000) Subject: 64-bit cleanness: X-Git-Tag: svn/VALGRIND_3_0_0~1402 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d98a43bc4fa25dd4a679674eb2f3a0a96455970a;p=thirdparty%2Fvalgrind.git 64-bit cleanness: - Use SizeT instead of UInt for new_mem_stack and all the related functions. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2907 --- diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c index c5e2b51eba..14b188a578 100644 --- a/addrcheck/ac_main.c +++ b/addrcheck/ac_main.c @@ -250,8 +250,7 @@ static __inline__ UChar get_abits4_ALIGNED ( Addr a ) /*------------------------------------------------------------*/ static /* __inline__ */ -void set_address_range_perms ( Addr a, UInt len, - UInt example_a_bit ) +void set_address_range_perms ( Addr a, SizeT len, UInt example_a_bit ) { UChar abyte8; UInt sm_off; @@ -357,14 +356,14 @@ void set_address_range_perms ( Addr a, UInt len, /* Set permissions for address ranges ... */ -static void ac_make_noaccess ( Addr a, UInt len ) +static void ac_make_noaccess ( Addr a, SizeT len ) { PROF_EVENT(35); DEBUG("ac_make_noaccess(%p, %x)\n", a, len); set_address_range_perms ( a, len, VGM_BIT_INVALID ); } -static void ac_make_accessible ( Addr a, UInt len ) +static void ac_make_accessible ( Addr a, SizeT len ) { PROF_EVENT(38); DEBUG("ac_make_accessible(%p, %x)\n", a, len); @@ -449,7 +448,7 @@ ESP_UPDATE_HANDLERS ( make_aligned_word_accessible, /* Block-copy permissions (needed for implementing realloc()). */ -static void ac_copy_address_range_state ( Addr src, Addr dst, UInt len ) +static void ac_copy_address_range_state ( Addr src, Addr dst, SizeT len ) { UInt i; @@ -469,7 +468,7 @@ static void ac_copy_address_range_state ( Addr src, Addr dst, UInt len ) know what it is. */ static __inline__ -Bool ac_check_accessible ( Addr a, UInt len, Addr* bad_addr ) +Bool ac_check_accessible ( Addr a, SizeT len, Addr* bad_addr ) { UInt i; UChar abit; @@ -488,7 +487,7 @@ Bool ac_check_accessible ( Addr a, UInt len, Addr* bad_addr ) /* The opposite; check that an address range is inaccessible. */ static -Bool ac_check_noaccess ( Addr a, UInt len, Addr* bad_addr ) +Bool ac_check_noaccess ( Addr a, SizeT len, Addr* bad_addr ) { UInt i; UChar abit; @@ -535,7 +534,7 @@ Bool ac_check_readable_asciiz ( Addr a, Addr* bad_addr ) static __inline__ void ac_check_is_accessible ( CorePart part, ThreadId tid, - Char* s, Addr base, UInt size, Bool isWrite ) + Char* s, Addr base, SizeT size, Bool isWrite ) { Bool ok; Addr bad_addr; @@ -573,14 +572,14 @@ void ac_check_is_accessible ( CorePart part, ThreadId tid, static void ac_check_is_writable ( CorePart part, ThreadId tid, - Char* s, Addr base, UInt size ) + Char* s, Addr base, SizeT size ) { ac_check_is_accessible ( part, tid, s, base, size, /*isWrite*/True ); } static void ac_check_is_readable ( CorePart part, ThreadId tid, - Char* s, Addr base, UInt size ) + Char* s, Addr base, SizeT size ) { ac_check_is_accessible ( part, tid, s, base, size, /*isWrite*/False ); } @@ -605,7 +604,7 @@ void ac_check_is_readable_asciiz ( CorePart part, ThreadId tid, } static -void ac_new_mem_startup( Addr a, UInt len, Bool rr, Bool ww, Bool xx ) +void ac_new_mem_startup( Addr a, SizeT len, Bool rr, Bool ww, Bool xx ) { /* Ignore the permissions, just make it readable. Seems to work... */ DEBUG("new_mem_startup(%p, %u, rr=%u, ww=%u, xx=%u)\n", a,len,rr,ww,xx); @@ -613,13 +612,13 @@ void ac_new_mem_startup( Addr a, UInt len, Bool rr, Bool ww, Bool xx ) } static -void ac_new_mem_heap ( Addr a, UInt len, Bool is_inited ) +void ac_new_mem_heap ( Addr a, SizeT len, Bool is_inited ) { ac_make_accessible(a, len); } static -void ac_set_perms (Addr a, UInt len, Bool rr, Bool ww, Bool xx) +void ac_set_perms (Addr a, SizeT len, Bool rr, Bool ww, Bool xx) { DEBUG("ac_set_perms(%p, %u, rr=%u ww=%u, xx=%u)\n", a, len, rr, ww, xx); diff --git a/coregrind/toolfuncs.def b/coregrind/toolfuncs.def index 1a98ea72f9..73ff43e3de 100644 --- a/coregrind/toolfuncs.def +++ b/coregrind/toolfuncs.def @@ -179,16 +179,16 @@ Bool, expensive_sanity_check ## malloc() et al. See above how to do this.) ## These ones occur at startup, upon some signals, and upon some syscalls -void, new_mem_startup, Addr a, UInt len, Bool rr, Bool ww, Bool xx -void, new_mem_stack_signal, Addr a, UInt len -void, new_mem_brk, Addr a, UInt len -void, new_mem_mmap, Addr a, UInt len, Bool rr, Bool ww, Bool xx +void, new_mem_startup, Addr a, SizeT len, Bool rr, Bool ww, Bool xx +void, new_mem_stack_signal, Addr a, SizeT len +void, new_mem_brk, Addr a, SizeT len +void, new_mem_mmap, Addr a, SizeT len, Bool rr, Bool ww, Bool xx -void, copy_mem_remap, Addr from, Addr to, UInt len -void, change_mem_mprotect, Addr a, UInt len, Bool rr, Bool ww, Bool xx -void, die_mem_stack_signal, Addr a, UInt len -void, die_mem_brk, Addr a, UInt len -void, die_mem_munmap, Addr a, UInt len +void, copy_mem_remap, Addr from, Addr to, SizeT len +void, change_mem_mprotect, Addr a, SizeT len, Bool rr, Bool ww, Bool xx +void, die_mem_stack_signal, Addr a, SizeT len +void, die_mem_brk, Addr a, SizeT len +void, die_mem_munmap, Addr a, SizeT len ## These ones are called when %esp changes. A tool could track these itself ## (except for ban_mem_stack) but it's much easier to use the core's help. @@ -204,26 +204,26 @@ void, new_mem_stack_8, Addr new_ESP void, new_mem_stack_12, Addr new_ESP void, new_mem_stack_16, Addr new_ESP void, new_mem_stack_32, Addr new_ESP -void, new_mem_stack, Addr a, UInt len +void, new_mem_stack, Addr a, SizeT len void, die_mem_stack_4, Addr die_ESP void, die_mem_stack_8, Addr die_ESP void, die_mem_stack_12, Addr die_ESP void, die_mem_stack_16, Addr die_ESP void, die_mem_stack_32, Addr die_ESP -void, die_mem_stack, Addr a, UInt len +void, die_mem_stack, Addr a, SizeT len ## Used for redzone at end of thread stacks -void, ban_mem_stack, Addr a, UInt len +void, ban_mem_stack, Addr a, SizeT len ## These ones occur around syscalls, signal handling, etc -void, pre_mem_read, CorePart part, ThreadId tid, Char* s, Addr a, UInt size +void, pre_mem_read, CorePart part, ThreadId tid, Char* s, Addr a, SizeT size void, pre_mem_read_asciiz, CorePart part, ThreadId tid, Char* s, Addr a -void, pre_mem_write, CorePart part, ThreadId tid, Char* s, Addr a, UInt size +void, pre_mem_write, CorePart part, ThreadId tid, Char* s, Addr a, SizeT size ## Not implemented yet -- have to add in lots of places, which is a ## pain. Won't bother unless/until there's a need. -## void (*post_mem_read) ( ThreadState* tst, Char* s, Addr a, UInt size ); -void, post_mem_write, Addr a, UInt size +## void (*post_mem_read) ( ThreadState* tst, Char* s, Addr a, SizeT size ); +void, post_mem_write, Addr a, SizeT size ## Register events -- if `shadow_regs' need is set, all should probably be diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c index 9560d247f3..c6a57ddd83 100644 --- a/helgrind/hg_main.c +++ b/helgrind/hg_main.c @@ -1585,7 +1585,7 @@ Bool cleanmx(Mutex *mx) { } static -void set_address_range_state ( Addr a, UInt len /* in bytes */, +void set_address_range_state ( Addr a, SizeT len /* in bytes */, VgeInitStatus status ) { Addr end; @@ -1660,19 +1660,19 @@ void set_address_range_state ( Addr a, UInt len /* in bytes */, } -static void make_segment_readable ( Addr a, UInt len ) +static void make_segment_readable ( Addr a, SizeT len ) { //PROF_EVENT(??); PPP set_address_range_state ( a, len, Vge_SegmentInit ); } -static void make_writable ( Addr a, UInt len ) +static void make_writable ( Addr a, SizeT len ) { //PROF_EVENT(36); PPP set_address_range_state( a, len, Vge_VirginInit ); } -static void make_readable ( Addr a, UInt len ) +static void make_readable ( Addr a, SizeT len ) { //PROF_EVENT(37); PPP set_address_range_state( a, len, Vge_VirginInit ); @@ -1680,7 +1680,7 @@ static void make_readable ( Addr a, UInt len ) /* Block-copy states (needed for implementing realloc()). */ -static void copy_address_range_state(Addr src, Addr dst, UInt len) +static void copy_address_range_state(Addr src, Addr dst, SizeT len) { UInt i; @@ -1693,25 +1693,25 @@ static void copy_address_range_state(Addr src, Addr dst, UInt len) } // SSS: put these somewhere better -static void eraser_mem_read (Addr a, UInt data_size, ThreadId tid); -static void eraser_mem_write(Addr a, UInt data_size, ThreadId tid); +static void eraser_mem_read (Addr a, SizeT data_size, ThreadId tid); +static void eraser_mem_write(Addr a, SizeT data_size, ThreadId tid); static void eraser_mem_help_read_1(Addr a) REGPARM(1); static void eraser_mem_help_read_2(Addr a) REGPARM(1); static void eraser_mem_help_read_4(Addr a) REGPARM(1); -static void eraser_mem_help_read_N(Addr a, UInt size) REGPARM(2); +static void eraser_mem_help_read_N(Addr a, SizeT size) REGPARM(2); static void eraser_mem_help_write_1(Addr a, UInt val) REGPARM(2); static void eraser_mem_help_write_2(Addr a, UInt val) REGPARM(2); static void eraser_mem_help_write_4(Addr a, UInt val) REGPARM(2); -static void eraser_mem_help_write_N(Addr a, UInt size) REGPARM(2); +static void eraser_mem_help_write_N(Addr a, SizeT size) REGPARM(2); static void bus_lock(void); static void bus_unlock(void); static void eraser_pre_mem_read(CorePart part, ThreadId tid, - Char* s, Addr base, UInt size ) + Char* s, Addr base, SizeT size ) { if (tid > 50) { VG_(printf)("pid = %d, s = `%s`, part = %d\n", tid, s, part); VG_(skin_panic)("a");} eraser_mem_read(base, size, tid); @@ -1726,7 +1726,7 @@ void eraser_pre_mem_read_asciiz(CorePart part, ThreadId tid, static void eraser_pre_mem_write(CorePart part, ThreadId tid, - Char* s, Addr base, UInt size ) + Char* s, Addr base, SizeT size ) { eraser_mem_write(base, size, tid); } @@ -1734,7 +1734,7 @@ void eraser_pre_mem_write(CorePart part, ThreadId tid, static -void eraser_new_mem_startup( Addr a, UInt len, Bool rr, Bool ww, Bool xx ) +void eraser_new_mem_startup( Addr a, SizeT len, Bool rr, Bool ww, Bool xx ) { /* Ignore the permissions, just make it readable. Seems to work... */ make_segment_readable(a, len); @@ -1742,7 +1742,7 @@ void eraser_new_mem_startup( Addr a, UInt len, Bool rr, Bool ww, Bool xx ) static -void eraser_new_mem_heap ( Addr a, UInt len, Bool is_inited ) +void eraser_new_mem_heap ( Addr a, SizeT len, Bool is_inited ) { if (is_inited) { make_readable(a, len); @@ -1752,7 +1752,7 @@ void eraser_new_mem_heap ( Addr a, UInt len, Bool is_inited ) } static -void eraser_set_perms (Addr a, UInt len, +void eraser_set_perms (Addr a, SizeT len, Bool rr, Bool ww, Bool xx) { if (rr) make_readable(a, len); @@ -1761,13 +1761,13 @@ void eraser_set_perms (Addr a, UInt len, } static -void eraser_new_mem_stack_private(Addr a, UInt len) +void eraser_new_mem_stack_private(Addr a, SizeT len) { set_address_range_state(a, len, Vge_NonVirginInit); } static -void eraser_new_mem_stack(Addr a, UInt len) +void eraser_new_mem_stack(Addr a, SizeT len) { set_address_range_state(a, len, Vge_VirginInit); } @@ -3034,7 +3034,7 @@ static void eraser_mem_read_word(Addr a, ThreadId tid) } } -static void eraser_mem_read(Addr a, UInt size, ThreadId tid) +static void eraser_mem_read(Addr a, SizeT size, ThreadId tid) { Addr end; @@ -3139,7 +3139,7 @@ static void eraser_mem_write_word(Addr a, ThreadId tid) } } -static void eraser_mem_write(Addr a, UInt size, ThreadId tid) +static void eraser_mem_write(Addr a, SizeT size, ThreadId tid) { Addr end; @@ -3167,7 +3167,7 @@ REGPARM(1) static void eraser_mem_help_read_4(Addr a) eraser_mem_read(a, 4, VG_(get_current_tid)()); } -REGPARM(2) static void eraser_mem_help_read_N(Addr a, UInt size) +REGPARM(2) static void eraser_mem_help_read_N(Addr a, SizeT size) { eraser_mem_read(a, size, VG_(get_current_tid)()); } @@ -3187,7 +3187,7 @@ REGPARM(2) static void eraser_mem_help_write_4(Addr a, UInt val) if (*(UInt *)a != val) eraser_mem_write(a, 4, VG_(get_current_tid)()); } -REGPARM(2) static void eraser_mem_help_write_N(Addr a, UInt size) +REGPARM(2) static void eraser_mem_help_write_N(Addr a, SizeT size) { eraser_mem_write(a, size, VG_(get_current_tid)()); } @@ -3374,7 +3374,7 @@ void SK_(print_debug_usage)(void) void SK_(post_clo_init)(void) { - void (*stack_tracker)(Addr a, UInt len); + void (*stack_tracker)(Addr a, SizeT len); if (clo_execontext) { execontext_map = VG_(malloc)(sizeof(ExeContextMap *) * 65536); diff --git a/memcheck/mac_malloc_wrappers.c b/memcheck/mac_malloc_wrappers.c index e272f205f6..23f59b65b7 100644 --- a/memcheck/mac_malloc_wrappers.c +++ b/memcheck/mac_malloc_wrappers.c @@ -45,13 +45,13 @@ static SizeT cmalloc_bs_mallocd = 0; UInt VG_(vg_malloc_redzone_szB) = 16; /* Function pointers for the two tools to track interesting events. */ -void (*MAC_(new_mem_heap)) ( Addr a, UInt len, Bool is_inited ) = NULL; -void (*MAC_(ban_mem_heap)) ( Addr a, UInt len ) = NULL; -void (*MAC_(die_mem_heap)) ( Addr a, UInt len ) = NULL; -void (*MAC_(copy_mem_heap))( Addr from, Addr to, UInt len ) = NULL; +void (*MAC_(new_mem_heap)) ( Addr a, SizeT len, Bool is_inited ) = NULL; +void (*MAC_(ban_mem_heap)) ( Addr a, SizeT len ) = NULL; +void (*MAC_(die_mem_heap)) ( Addr a, SizeT len ) = NULL; +void (*MAC_(copy_mem_heap))( Addr from, Addr to, SizeT len ) = NULL; /* Function pointers for internal sanity checking. */ -Bool (*MAC_(check_noaccess))( Addr a, UInt len, Addr* bad_addr ) = NULL; +Bool (*MAC_(check_noaccess))( Addr a, SizeT len, Addr* bad_addr ) = NULL; /*------------------------------------------------------------*/ diff --git a/memcheck/mac_shared.h b/memcheck/mac_shared.h index b009e511a3..d9a84abd89 100644 --- a/memcheck/mac_shared.h +++ b/memcheck/mac_shared.h @@ -277,13 +277,13 @@ extern VgHashTable MAC_(malloc_list); extern VgHashTable MAC_(mempool_list); /* Function pointers for the two tools to track interesting events. */ -extern void (*MAC_(new_mem_heap)) ( Addr a, UInt len, Bool is_inited ); -extern void (*MAC_(ban_mem_heap)) ( Addr a, UInt len ); -extern void (*MAC_(die_mem_heap)) ( Addr a, UInt len ); -extern void (*MAC_(copy_mem_heap))( Addr from, Addr to, UInt len ); +extern void (*MAC_(new_mem_heap)) ( Addr a, SizeT len, Bool is_inited ); +extern void (*MAC_(ban_mem_heap)) ( Addr a, SizeT len ); +extern void (*MAC_(die_mem_heap)) ( Addr a, SizeT len ); +extern void (*MAC_(copy_mem_heap))( Addr from, Addr to, SizeT len ); /* Function pointers for internal sanity checking. */ -extern Bool (*MAC_(check_noaccess))( Addr a, UInt len, Addr* bad_addr ); +extern Bool (*MAC_(check_noaccess))( Addr a, SizeT len, Addr* bad_addr ); /* Used in describe_addr() */ extern Bool (*MAC_(describe_addr_supp)) ( Addr a, AddrInfo* ai ); @@ -357,8 +357,8 @@ extern REGPARM(1) void MAC_(new_mem_stack_16) ( Addr old_ESP ); extern REGPARM(1) void MAC_(die_mem_stack_16) ( Addr old_ESP ); extern REGPARM(1) void MAC_(new_mem_stack_32) ( Addr old_ESP ); extern REGPARM(1) void MAC_(die_mem_stack_32) ( Addr old_ESP ); -extern void MAC_(die_mem_stack) ( Addr a, UInt len); -extern void MAC_(new_mem_stack) ( Addr a, UInt len); +extern void MAC_(die_mem_stack) ( Addr a, SizeT len); +extern void MAC_(new_mem_stack) ( Addr a, SizeT len); /*------------------------------------------------------------*/ @@ -520,13 +520,13 @@ void REGPARM(1) MAC_(die_mem_stack_32)(Addr new_ESP) \ } \ } \ \ -void MAC_(new_mem_stack) ( Addr a, UInt len ) \ +void MAC_(new_mem_stack) ( Addr a, SizeT len ) \ { \ PROF_EVENT(115); \ UNALIGNED_NEW ( a, len ); \ } \ \ -void MAC_(die_mem_stack) ( Addr a, UInt len ) \ +void MAC_(die_mem_stack) ( Addr a, SizeT len ) \ { \ PROF_EVENT(125); \ UNALIGNED_DIE ( a, len ); \ diff --git a/memcheck/mc_include.h b/memcheck/mc_include.h index 948cef8ab6..9d97925254 100644 --- a/memcheck/mc_include.h +++ b/memcheck/mc_include.h @@ -129,17 +129,17 @@ extern REGPARM(1) UInt MC_(helperc_LOADV1) ( Addr ); extern REGPARM(1) UInt MC_(helperc_LOADV2) ( Addr ); extern REGPARM(1) UInt MC_(helperc_LOADV4) ( Addr ); -extern REGPARM(2) void MC_(fpu_write_check) ( Addr addr, Int size ); -extern REGPARM(2) void MC_(fpu_read_check) ( Addr addr, Int size ); +extern REGPARM(2) void MC_(fpu_write_check) ( Addr addr, SizeT size ); +extern REGPARM(2) void MC_(fpu_read_check) ( Addr addr, SizeT size ); /* For client requests */ -extern void MC_(make_noaccess) ( Addr a, UInt len ); -extern void MC_(make_readable) ( Addr a, UInt len ); -extern void MC_(make_writable) ( Addr a, UInt len ); +extern void MC_(make_noaccess) ( Addr a, SizeT len ); +extern void MC_(make_readable) ( Addr a, SizeT len ); +extern void MC_(make_writable) ( Addr a, SizeT len ); -extern Bool MC_(check_writable) ( Addr a, UInt len, Addr* bad_addr ); -extern Bool MC_(check_readable) ( Addr a, UInt len, Addr* bad_addr ); +extern Bool MC_(check_writable) ( Addr a, SizeT len, Addr* bad_addr ); +extern Bool MC_(check_readable) ( Addr a, SizeT len, Addr* bad_addr ); extern void MC_(detect_memory_leaks) ( void ); @@ -147,7 +147,7 @@ extern Int MC_(get_or_set_vbits_for_client) ( ThreadId tid, Addr dataV, Addr vbitsV, - UInt size, + SizeT size, Bool setting /* True <=> set vbits, False <=> get vbits */ ); diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index a8369cfadf..34dff45d4c 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -99,8 +99,8 @@ static UInt mc_rd_V1_SLOWLY ( Addr a ); static void mc_wr_V4_SLOWLY ( Addr a, UInt vbytes ); static void mc_wr_V2_SLOWLY ( Addr a, UInt vbytes ); static void mc_wr_V1_SLOWLY ( Addr a, UInt vbytes ); -static void mc_fpu_read_check_SLOWLY ( Addr addr, Int size ); -static void mc_fpu_write_check_SLOWLY ( Addr addr, Int size ); +static void mc_fpu_read_check_SLOWLY ( Addr addr, SizeT size ); +static void mc_fpu_write_check_SLOWLY ( Addr addr, SizeT size ); /*------------------------------------------------------------*/ /*--- Data defns. ---*/ @@ -266,7 +266,7 @@ static void __inline__ set_vbytes4_ALIGNED ( Addr a, UInt vbytes ) /*--- Setting permissions over address ranges. ---*/ /*------------------------------------------------------------*/ -static void set_address_range_perms ( Addr a, UInt len, +static void set_address_range_perms ( Addr a, SizeT len, UInt example_a_bit, UInt example_v_bit ) { @@ -389,24 +389,24 @@ static void set_address_range_perms ( Addr a, UInt len, /* Set permissions for address ranges ... */ -void MC_(make_noaccess) ( Addr a, UInt len ) +void MC_(make_noaccess) ( Addr a, SizeT len ) { PROF_EVENT(35); - DEBUG("MC_(make_noaccess)(%p, %x)\n", a, len); + DEBUG("MC_(make_noaccess)(%p, %llu)\n", a, (ULong)len); set_address_range_perms ( a, len, VGM_BIT_INVALID, VGM_BIT_INVALID ); } -void MC_(make_writable) ( Addr a, UInt len ) +void MC_(make_writable) ( Addr a, SizeT len ) { PROF_EVENT(36); - DEBUG("MC_(make_writable)(%p, %x)\n", a, len); + DEBUG("MC_(make_writable)(%p, %llu)\n", a, (ULong)len); set_address_range_perms ( a, len, VGM_BIT_VALID, VGM_BIT_INVALID ); } -void MC_(make_readable) ( Addr a, UInt len ) +void MC_(make_readable) ( Addr a, SizeT len ) { PROF_EVENT(37); - DEBUG("MC_(make_readable)(%p, 0x%x)\n", a, len); + DEBUG("MC_(make_readable)(%p, %llu)\n", a, (ULong)len); set_address_range_perms ( a, len, VGM_BIT_VALID, VGM_BIT_VALID ); } @@ -491,9 +491,9 @@ ESP_UPDATE_HANDLERS ( make_aligned_word_writable, ); /* Block-copy permissions (needed for implementing realloc()). */ -static void mc_copy_address_range_state ( Addr src, Addr dst, UInt len ) +static void mc_copy_address_range_state ( Addr src, Addr dst, SizeT len ) { - UInt i; + SizeT i; DEBUG("mc_copy_address_range_state\n"); @@ -516,9 +516,9 @@ static void mc_copy_address_range_state ( Addr src, Addr dst, UInt len ) returns False, and if bad_addr is non-NULL, sets *bad_addr to indicate the lowest failing address. Functions below are similar. */ -Bool MC_(check_noaccess) ( Addr a, UInt len, Addr* bad_addr ) +Bool MC_(check_noaccess) ( Addr a, SizeT len, Addr* bad_addr ) { - UInt i; + SizeT i; UChar abit; PROF_EVENT(42); for (i = 0; i < len; i++) { @@ -533,9 +533,9 @@ Bool MC_(check_noaccess) ( Addr a, UInt len, Addr* bad_addr ) return True; } -Bool MC_(check_writable) ( Addr a, UInt len, Addr* bad_addr ) +Bool MC_(check_writable) ( Addr a, SizeT len, Addr* bad_addr ) { - UInt i; + SizeT i; UChar abit; PROF_EVENT(42); for (i = 0; i < len; i++) { @@ -550,9 +550,9 @@ Bool MC_(check_writable) ( Addr a, UInt len, Addr* bad_addr ) return True; } -Bool MC_(check_readable) ( Addr a, UInt len, Addr* bad_addr ) +Bool MC_(check_readable) ( Addr a, SizeT len, Addr* bad_addr ) { - UInt i; + SizeT i; UChar abit; UChar vbyte; @@ -603,7 +603,7 @@ static Bool mc_check_readable_asciiz ( Addr a, Addr* bad_addr ) static void mc_check_is_writable ( CorePart part, ThreadId tid, Char* s, - Addr base, UInt size ) + Addr base, SizeT size ) { Bool ok; Addr bad_addr; @@ -634,7 +634,7 @@ void mc_check_is_writable ( CorePart part, ThreadId tid, Char* s, static void mc_check_is_readable ( CorePart part, ThreadId tid, Char* s, - Addr base, UInt size ) + Addr base, SizeT size ) { Bool ok; Addr bad_addr; @@ -688,15 +688,16 @@ void mc_check_is_readable_asciiz ( CorePart part, ThreadId tid, static -void mc_new_mem_startup( Addr a, UInt len, Bool rr, Bool ww, Bool xx ) +void mc_new_mem_startup( Addr a, SizeT len, Bool rr, Bool ww, Bool xx ) { /* Ignore the permissions, just make it readable. Seems to work... */ - DEBUG("mc_new_mem_startup(%p, %u, rr=%u, ww=%u, xx=%u)\n", a,len,rr,ww,xx); + DEBUG("mc_new_mem_startup(%p, %llu, rr=%u, ww=%u, xx=%u)\n", + a,(ULong)len,rr,ww,xx); MC_(make_readable)(a, len); } static -void mc_new_mem_heap ( Addr a, UInt len, Bool is_inited ) +void mc_new_mem_heap ( Addr a, SizeT len, Bool is_inited ) { if (is_inited) { MC_(make_readable)(a, len); @@ -706,9 +707,10 @@ void mc_new_mem_heap ( Addr a, UInt len, Bool is_inited ) } static -void mc_set_perms (Addr a, UInt len, Bool rr, Bool ww, Bool xx) +void mc_set_perms (Addr a, SizeT len, Bool rr, Bool ww, Bool xx) { - DEBUG("mc_set_perms(%p, %u, rr=%u ww=%u, xx=%u)\n", a, len, rr, ww, xx); + DEBUG("mc_set_perms(%p, %llu, rr=%u ww=%u, xx=%u)\n", + a, (ULong)len, rr, ww, xx); if (rr) MC_(make_readable)(a, len); else if (ww) MC_(make_writable)(a, len); else MC_(make_noaccess)(a, len); @@ -1108,7 +1110,7 @@ void MC_(helperc_value_check4_fail) ( void ) ------------------------------------------------------------------ */ REGPARM(2) -void MC_(fpu_read_check) ( Addr addr, Int size ) +void MC_(fpu_read_check) ( Addr addr, SizeT size ) { /* Ensure the read area is both addressible and valid (ie, readable). If there's an address error, don't report a value @@ -1200,7 +1202,7 @@ void MC_(fpu_read_check) ( Addr addr, Int size ) REGPARM(2) -void MC_(fpu_write_check) ( Addr addr, Int size ) +void MC_(fpu_write_check) ( Addr addr, SizeT size ) { /* Ensure the written area is addressible, and moan if otherwise. If it is addressible, make it valid, otherwise invalid. @@ -1290,7 +1292,7 @@ void MC_(fpu_write_check) ( Addr addr, Int size ) there's an addr error, don't report a value error even if it exists. */ -void mc_fpu_read_check_SLOWLY ( Addr addr, Int size ) +void mc_fpu_read_check_SLOWLY ( Addr addr, SizeT size ) { Int i; Bool aerr = False; @@ -1316,7 +1318,7 @@ void mc_fpu_read_check_SLOWLY ( Addr addr, Int size ) /* Generic version. Test for addr errors. Valid addresses are given valid values, and invalid addresses invalid values. */ -void mc_fpu_write_check_SLOWLY ( Addr addr, Int size ) +void mc_fpu_write_check_SLOWLY ( Addr addr, SizeT size ) { Int i; Addr a_here; @@ -1350,7 +1352,7 @@ Int MC_(get_or_set_vbits_for_client) ( ThreadId tid, Addr dataV, Addr vbitsV, - UInt size, + SizeT size, Bool setting /* True <=> set vbits, False <=> get vbits */ ) { @@ -1358,8 +1360,8 @@ Int MC_(get_or_set_vbits_for_client) ( Bool addressibleV = True; UInt* data = (UInt*)dataV; UInt* vbits = (UInt*)vbitsV; - UInt szW = size / 4; /* sigh */ - UInt i; + SizeT szW = size / 4; /* sigh */ + SizeT i; UInt* dataP = NULL; /* bogus init to keep gcc happy */ UInt* vbitsP = NULL; /* ditto */