]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
additional use of RegWord
authorPetar Jovanovic <mips32r2@gmail.com>
Wed, 13 Jun 2018 16:26:14 +0000 (16:26 +0000)
committerPetar Jovanovic <mips32r2@gmail.com>
Thu, 14 Jun 2018 17:40:08 +0000 (17:40 +0000)
Follow up to "Introduce RegWord type" change.

Part of the changes required for BZ issue - #345763.

Contributed by:
  Tamara Vlahovic and Dimitrije Nikolic.

coregrind/m_aspacemgr/aspacemgr-linux.c
coregrind/m_debuginfo/debuginfo.c
coregrind/m_libcprint.c
coregrind/m_syswrap/syswrap-linux.c
coregrind/m_syswrap/syswrap-main.c

index 32173c69c214431ebb465a4335683ea2f356660c..afc041dbe3313f7ac63a886cde5c6924c366d1f4 100644 (file)
@@ -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
index c8a6124a2cb9b485cec59f1accdb28bce08a09d3..b8502936836f50a301d95a156fc3a46ae80970cc 100644 (file)
@@ -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 );
index 1069d129636a7a695738544506f9a213f63bdef2..92be7078c9726e650a7a90e336490b474f12436c 100644 (file)
@@ -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;
 }
 
index 5ed732c364137acd0d4040d0c2e7d6e03b7cebea..1d95489e899bca2096ab0343d793ec77f0265abf 100644 (file)
@@ -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);
index 250ea272ac6357f242f2b20d5ca82426d2681599..acee5b5e24608411d087de9ff05004ab0a8064d5 100644 (file)
@@ -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);