vg_assert (kind == access_watchpoint
|| kind == read_watchpoint
|| kind == write_watchpoint);
- dlog(1, "tid %d VG_(is_watched) %s addr %p szB %d\n",
+ dlog(1, "tid %u VG_(is_watched) %s addr %p szB %d\n",
tid, VG_(ppPointKind) (kind), C2v(addr), szB);
for (i = 0; i < n_elems; i++) {
data from its parent */
static void gdbserver_cleanup_in_child_after_fork(ThreadId me)
{
- dlog(1, "thread %d gdbserver_cleanup_in_child_after_fork pid %d\n",
+ dlog(1, "thread %u gdbserver_cleanup_in_child_after_fork pid %d\n",
me, VG_(getpid) ());
/* finish connection inheritated from parent */
Addr saved_pc;
dlog(1,
- "entering call_gdbserver %s ... pid %d tid %d status %s "
+ "entering call_gdbserver %s ... pid %d tid %u status %s "
"sched_jmpbuf_valid %d\n",
ppCallReason (reason),
VG_(getpid) (), tid, VG_(name_of_ThreadStatus)(tst->status),
Otherwise we just return to continue executing the
current block. */
if (VG_(get_IP) (tid) != saved_pc) {
- dlog(1, "tid %d %s PC changed from %s to %s\n",
+ dlog(1, "tid %u %s PC changed from %s to %s\n",
tid, VG_(name_of_ThreadStatus) (tst->status),
sym(saved_pc, /* is_code */ True),
sym(VG_(get_IP) (tid), /* is_code */ True));
ptrace handling. */
vg_assert2(0,
"vgdb did not took control. Did you kill vgdb ?\n"
- "busy %d vgdb_interrupted_tid %d\n",
+ "busy %d vgdb_interrupted_tid %u\n",
busy, vgdb_interrupted_tid);
#else /* defined(VGO_solaris) */
/* On Solaris, this code is run within the context of an agent thread
From here onwards, function calls are ok: it is
safe to call valgrind core functions: all threads are blocked in
a system call or are yielding or ... */
- dlog(1, "invoke_gdbserver running_tid %d vgdb_interrupted_tid %d\n",
+ dlog(1, "invoke_gdbserver running_tid %u vgdb_interrupted_tid %u\n",
VG_(running_tid), vgdb_interrupted_tid);
call_gdbserver (vgdb_interrupted_tid, vgdb_reason);
vgdb_interrupted_tid = 0;
dlog(1,
- "exit invoke_gdbserver running_tid %d\n", VG_(running_tid));
+ "exit invoke_gdbserver running_tid %u\n", VG_(running_tid));
give_control_back_to_vgdb();
vg_assert2(0, "end of invoke_gdbserver reached");
ThreadId tid)
{
dlog(1, "VG core calling %s "
- "vki_nr %d %s gdb_nr %d %s tid %d\n",
+ "vki_nr %d %s gdb_nr %u %s tid %u\n",
who,
info->si_signo, VG_(signame)(info->si_signo),
target_signal_from_host (info->si_signo),
void VG_(gdbserver_exit) (ThreadId tid, VgSchedReturnCode tids_schedretcode)
{
- dlog(1, "VG core calling VG_(gdbserver_exit) tid %d will exit\n", tid);
+ dlog(1, "VG core calling VG_(gdbserver_exit) tid %u will exit\n", tid);
if (remote_connected()) {
/* Make sure vgdb knows we are about to die and why. */
switch(tids_schedretcode) {
VG_(umsg)
("nr of calls to gdbserver: %d\n"
"single stepping %d\n"
- "interrupts intr_tid %d gs_non_busy %d gs_busy %d tid_non_intr %d\n"
+ "interrupts intr_tid %u gs_non_busy %d gs_busy %d tid_non_intr %d\n"
"gdbserved addresses %d (-1 = not initialized)\n"
"watchpoints %d (-1 = not initialized)\n"
"vgdb-error %d\n"
VG_(dmsg)("current sigmask value { ");
for (i = 1; i <= _VKI_NSIG; i++) {
if (VG_(sigismember)(&cursigset, i))
- VG_(dmsg)("%u ", i);
+ VG_(dmsg)("%d ", i);
}
VG_(dmsg)("}\n");
}
else if (a >= 'a' && a <= 'f')
return a - 'a' + 10;
else
- error ("Reply contains invalid hex digit 0x%x\n", a);
+ error ("Reply contains invalid hex digit 0x%x\n", (unsigned)a);
return 0;
}
cc = readchar (1);
if (cc > 0)
- dlog(3, "[received '%c' (0x%x)]\n", cc, cc);
+ dlog(3, "[received '%c' (0x%x)]\n", cc, (unsigned)cc);
if (cc <= 0) {
if (cc == 0)
break;
dlog (0, "Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s\n",
- (c1 << 4) + c2, csum, buf);
+ (unsigned)(c1 << 4) + c2, (unsigned)csum, buf);
if (!ensure_write_remote_desc()) {
dlog(1, "getpkt(write nack) no write_remote_desc");
}
((struct inferior_list_entry *)current_inferior)->id;
gdb_id_from_wait = thread_to_gdb_id (current_inferior);
- dlog(1, "Writing resume reply for %ld\n", thread_from_wait);
+ dlog(1, "Writing resume reply for %lu\n", thread_from_wait);
/* This if (1) ought to be unnecessary. But remote_wait in GDB
will claim this event belongs to inferior_ptid if we do not
specify a thread, and there's no way for gdbserver to know
VG_(show_all_errors)(/* verbosity */ 2, /* xml */ False);
break;
case 1: // n_errs_found
- VG_(printf) ("n_errs_found %d n_errs_shown %d (vgdb-error %d) %s\n",
+ VG_(printf) ("n_errs_found %u n_errs_shown %u (vgdb-error %d) %s\n",
VG_(get_n_errs_found) (),
VG_(get_n_errs_shown) (),
VG_(dyn_vgdb_error),
len = (PBUFSIZ + POVERHSIZ) / 2;
char status[len];
if (tst->thread_name) {
- VG_(snprintf) (status, sizeof(status), "tid %d %s %s",
+ VG_(snprintf) (status, sizeof(status), "tid %u %s %s",
tst->tid,
VG_(name_of_ThreadStatus)(tst->status),
tst->thread_name);
} else {
- VG_(snprintf) (status, sizeof(status), "tid %d %s",
+ VG_(snprintf) (status, sizeof(status), "tid %u %s",
tst->tid,
VG_(name_of_ThreadStatus)(tst->status));
}
UWord *client_auxv = VG_(client_auxv);
unsigned int client_auxv_len = 0;
while (*client_auxv != 0) {
- dlog(4, "auxv %lld %llx\n",
+ dlog(4, "auxv %llu %llx\n",
(ULong)*client_auxv,
(ULong)*(client_auxv+1));
client_auxv++;
client_auxv_len += 2 * sizeof(UWord);
}
client_auxv_len += 2 * sizeof(UWord);
- dlog(4, "auxv len %d\n", client_auxv_len);
+ dlog(4, "auxv len %u\n", client_auxv_len);
if (ofs >= client_auxv_len)
n = -1;
/* Protocol features query. */
if (strncmp ("qSupported", arg_own_buf, 10) == 0
&& (arg_own_buf[10] == ':' || arg_own_buf[10] == '\0')) {
- VG_(sprintf) (arg_own_buf, "PacketSize=%x", PBUFSIZ - 1);
+ VG_(sprintf) (arg_own_buf, "PacketSize=%x", (UInt)PBUFSIZ - 1);
/* Note: max packet size including frame and checksum, but without
trailing null byte, which is not sent/received. */
VG_(umsg) ("\nChild exited with status %d\n", zignal);
if (status == 'X')
VG_(umsg) ("\nChild terminated with signal = 0x%x (%s)\n",
- target_signal_to_host (zignal),
+ (UInt)target_signal_to_host (zignal),
target_signal_to_name (zignal));
if (status == 'W' || status == 'X') {
VG_(umsg) ("Process exiting\n");
}
#endif
error ("Valgrind GDBSERVER bug: (do_target_signal_to_host):"
- " unrecognized target signal %d\n", oursig);
+ " unrecognized target signal %u\n", oursig);
*oursig_ok = 0;
return 0;
}
char *image_ptid(unsigned long ptid)
{
static char result[50]; // large enough
- VG_(sprintf) (result, "id %ld", ptid);
+ VG_(sprintf) (result, "id %lu", ptid);
return result;
}
#define get_thread(inf) ((struct thread_info *)(inf))
/* call add_thread for all valgrind threads not known in gdb all_threads */
for (tid = 1; tid < VG_N_THREADS; tid++) {
-#define LOCAL_THREAD_TRACE " ti* %p vgtid %d status %s as gdb ptid %s lwpid %d\n", \
+#define LOCAL_THREAD_TRACE " ti* %p vgtid %u status %s as gdb ptid %s lwpid %d\n", \
ti, tid, VG_(name_of_ThreadStatus) (ts->status), \
image_ptid (ptid), ts->os_state.lwpid
if (*ourstatus == 'X') {
sig = target_signal_from_host(exit_code_to_report);
exit_code_to_report = 0;
- dlog(1, "exit valgrind_wait status X signal %d\n", sig);
+ dlog(1, "exit valgrind_wait status X signal %u\n", sig);
return sig;
}
}
stop_pc = (*the_low_target.get_pc) ();
dlog(1,
- "exit valgrind_wait status T ptid %s stop_pc %s signal %d\n",
+ "exit valgrind_wait status T ptid %s stop_pc %s signal %u\n",
image_ptid (wptid), sym (stop_pc), sig);
return sig;
}
if (mod && VG_(debugLog_getLevel)() > 1) {
char bufimage [2*size + 1];
heximage (bufimage, buf, size);
- dlog(3, "fetched register %d size %d name %s value %s tid %d status %s\n",
+ dlog(3, "fetched register %d size %d name %s value %s tid %u status %s\n",
regno, size, the_low_target.reg_defs[regno].name, bufimage,
tid, VG_(name_of_ThreadStatus) (tst->status));
}
heximage (bufimage, buf, size);
dlog(2,
"stored register %d size %d name %s value %s "
- "tid %d status %s\n",
+ "tid %u status %s\n",
regno, size, the_low_target.reg_defs[regno].name, bufimage,
tid, VG_(name_of_ThreadStatus) (tst->status));
}
// Check we can read at least 2 address at the beginning of dtv.
CHECK_DEREF(dtv, 2*sizeof(CORE_ADDR), "dtv 2 first entries");
- dlog (2, "tid %d dtv %p\n", tst->tid, (void*)dtv);
+ dlog (2, "tid %u dtv %p\n", tst->tid, (void*)dtv);
// Check we can read the modid
CHECK_DEREF(lm+lm_modid_offset, sizeof(unsigned long int), "link_map modid");
{
ThreadState *tst = (ThreadState *) inferior_target_data (current_inferior);
ThreadId tid = tst->tid;
- dlog(1, "set_desired_inferior use_general %d found %p tid %d lwpid %d\n",
+ dlog(1, "set_desired_inferior use_general %d found %p tid %u lwpid %d\n",
use_general, found, tid, tst->os_state.lwpid);
}
}
{
va_list args;
if (sr_isError (sr))
- VG_(umsg) ("error %ld %s\n", sr_Err(sr), VG_(strerror) (sr_Err(sr)));
+ VG_(umsg) ("error %lu %s\n", sr_Err(sr), VG_(strerror) (sr_Err(sr)));
else
VG_(umsg) ("sr_perror called with no error!!!\n");
va_start (args, string);