VG_(printf)(
"\n"
"map_file_segment(addr=%p len=%lu prot=0x%x flags=0x%x\n"
- " dev=0x%4x ino=%d off=%ld\n"
+ " dev=0x%4x ino=%d off=%lld\n"
" filename='%s')\n",
- addr, (ULong)len, prot, flags, dev, ino, off, filename);
+ addr, len, prot, flags, dev, ino, off, filename);
if (0) VG_(show_segments)("before map_file_segment");
Int i;
Int flags;
Int width;
+ Int n_ls = 0;
Bool is_long;
/* We assume that vargs has already been initialised by the
continue;
}
flags = 0;
- is_long = False;
+ n_ls = 0;
width = 0; /* length of the field. */
if (format[i] == '(') {
flags |= VG_MSG_PAREN;
}
while (format[i] == 'l') {
i++;
- is_long = True;
+ n_ls++;
}
+ // %d means print a 32-bit integer.
+ // %ld means print a word-size integer.
+ // %lld means print a 64-bit integer.
+ if (0 == n_ls) { is_long = False; }
+ else if (1 == n_ls) { is_long = ( sizeof(void*) == sizeof(Long) ); }
+ else { is_long = True; }
+
switch (format[i]) {
case 'd': /* %d */
flags |= VG_MSG_SIGNED;
PRE(sys_ftruncate)
{
*flags |= SfMayBlock;
- PRINT("sys_ftruncate ( %d, %lld )", ARG1,(ULong)ARG2);
+ PRINT("sys_ftruncate ( %d, %ld )", ARG1,ARG2);
PRE_REG_READ2(long, "ftruncate", unsigned int, fd, unsigned long, length);
}
PRE(sys_sendfile)
{
*flags |= SfMayBlock;
- PRINT("sys_sendfile ( %d, %d, %p, %llu )", ARG1,ARG2,ARG3,(ULong)ARG4);
+ PRINT("sys_sendfile ( %d, %d, %p, %lu )", ARG1,ARG2,ARG3,ARG4);
PRE_REG_READ4(ssize_t, "sendfile",
int, out_fd, int, in_fd, vki_off_t *, offset,
vki_size_t, count);
PRE(sys_sendfile64)
{
*flags |= SfMayBlock;
- PRINT("sendfile64 ( %d, %d, %p, %llu )",ARG1,ARG2,ARG3,(ULong)ARG4);
+ PRINT("sendfile64 ( %d, %d, %p, %lu )",ARG1,ARG2,ARG3,ARG4);
PRE_REG_READ4(ssize_t, "sendfile64",
int, out_fd, int, in_fd, vki_loff_t *, offset,
vki_size_t, count);
{
Int i;
- PRINT("sys_io_submit ( %llu, %lld, %p )", (ULong)ARG1,(Long)ARG2,ARG3);
+ PRINT("sys_io_submit ( %llu, %ld, %p )", (ULong)ARG1,ARG2,ARG3);
PRE_REG_READ3(long, "io_submit",
vki_aio_context_t, ctx_id, long, nr,
struct iocb **, iocbpp);
// tl_assert(sum <= xpt->exact_ST_dbld);
// tl_assert(sum * 1.05 > xpt->exact_ST_dbld );
// if (sum != xpt->exact_ST_dbld) {
-// VG_(printf)("%ld, %ld\n", sum, xpt->exact_ST_dbld);
+// VG_(printf)("%lld, %lld\n", sum, xpt->exact_ST_dbld);
// }
}