From: Petar Jovanovic Date: Wed, 13 Jun 2018 16:26:14 +0000 (+0000) Subject: additional use of RegWord X-Git-Tag: VALGRIND_3_14_0~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b2fe98aca7568a821c921ba3183f7d62b35a12c;p=thirdparty%2Fvalgrind.git additional use of RegWord Follow up to "Introduce RegWord type" change. Part of the changes required for BZ issue - #345763. Contributed by: Tamara Vlahovic and Dimitrije Nikolic. --- diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 32173c69c2..afc041dbe3 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -2654,7 +2654,7 @@ SysRes VG_(am_mmap_anon_float_valgrind)( SizeT length ) void* VG_(am_shadow_alloc)(SizeT size) { SysRes sres = VG_(am_mmap_anon_float_valgrind)( size ); - return sr_isError(sres) ? NULL : (void*)sr_Res(sres); + return sr_isError(sres) ? NULL : (void*)(Addr)sr_Res(sres); } /* Map a file at an unconstrained address for V, and update the diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index c8a6124a2c..b850293683 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -1553,7 +1553,7 @@ void VG_(di_notify_pdb_debuginfo)( Int fd_obj, Addr avma_obj, goto out; } - void* pdbimage = (void*)sr_Res(sres); + void* pdbimage = (void*)(Addr)sr_Res(sres); r = VG_(read)( fd_pdbimage, pdbimage, (Int)n_pdbimage ); if (r < 0 || r != (Int)n_pdbimage) { VG_(am_munmap_valgrind)( (Addr)pdbimage, n_pdbimage ); diff --git a/coregrind/m_libcprint.c b/coregrind/m_libcprint.c index 1069d12963..92be7078c9 100644 --- a/coregrind/m_libcprint.c +++ b/coregrind/m_libcprint.c @@ -1182,9 +1182,9 @@ const HChar *VG_(sr_as_string) ( SysRes sr ) static HChar buf[7+1+2+16+1+1]; // large enough if (sr_isError(sr)) - VG_(sprintf)(buf, "Failure(0x%lx)", sr_Err(sr)); + VG_(sprintf)(buf, "Failure(0x%" FMT_REGWORD "x)", (RegWord)sr_Err(sr)); else - VG_(sprintf)(buf, "Success(0x%lx)", sr_Res(sr)); + VG_(sprintf)(buf, "Success(0x%" FMT_REGWORD "x)", (RegWord)sr_Res(sr)); return buf; } diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 5ed732c364..1d95489e89 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -770,8 +770,8 @@ static SysRes ML_(do_fork_clone) ( ThreadId tid, UInt flags, VG_(do_atfork_parent)(tid); if (VG_(clo_trace_syscalls)) - VG_(printf)(" clone(fork): process %d created child %lu\n", - VG_(getpid)(), sr_Res(res)); + VG_(printf)(" clone(fork): process %d created child %" FMT_REGWORD "u\n", + VG_(getpid)(), (RegWord)sr_Res(res)); /* restore signal mask */ VG_(sigprocmask)(VKI_SIG_SETMASK, &fork_saved_mask, NULL); diff --git a/coregrind/m_syswrap/syswrap-main.c b/coregrind/m_syswrap/syswrap-main.c index 250ea272ac..acee5b5e24 100644 --- a/coregrind/m_syswrap/syswrap-main.c +++ b/coregrind/m_syswrap/syswrap-main.c @@ -2570,12 +2570,13 @@ VG_(fixup_guest_state_after_syscall_interrupted)( ThreadId tid, if (VG_(clo_trace_signals)) VG_(message)( Vg_DebugMsg, "interrupted_syscall: tid=%u, ip=%#lx, " - "restart=%s, sres.isErr=%s, sres.val=%lu\n", + "restart=%s, sres.isErr=%s, sres.val=%" FMT_REGWORD "u\n", tid, ip, restart ? "True" : "False", sr_isError(sres) ? "True" : "False", - sr_isError(sres) ? sr_Err(sres) : sr_Res(sres)); + sr_isError(sres) ? (RegWord)sr_Err(sres) : + (RegWord)sr_Res(sres)); vg_assert(VG_(is_valid_tid)(tid)); vg_assert(tid >= 1 && tid < VG_N_THREADS);