|
From: Petar J. <pe...@so...> - 2018-06-14 17:44:06
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=8b2fe98aca7568a821c921ba3183f7d62b35a12c commit 8b2fe98aca7568a821c921ba3183f7d62b35a12c Author: Petar Jovanovic <mip...@gm...> Date: Wed Jun 13 16:26:14 2018 +0000 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: --- coregrind/m_aspacemgr/aspacemgr-linux.c | 2 +- coregrind/m_debuginfo/debuginfo.c | 2 +- coregrind/m_libcprint.c | 4 ++-- coregrind/m_syswrap/syswrap-linux.c | 4 ++-- coregrind/m_syswrap/syswrap-main.c | 5 +++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 32173c6..afc041d 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 c8a6124..b850293 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 1069d12..92be707 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 5ed732c..1d95489 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 250ea27..acee5b5 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); |