+2015-08-06 Pedro Alves <palves@redhat.com>
+
+ * nat/linux-waitpid.c (my_waitpid): Only print *status if waitpid
+ returned > 0.
+
2015-08-06 Pierre Langlois <pierre.langlois@arm.com>
* common/agent.c (symbol_list) <required>: Remove.
+2015-08-06 Pedro Alves <palves@redhat.com>
+
+ * linux-low.c (linux_write_memory): Rewrite debug output to avoid
+ reading beyond the passed in buffer length.
+
2015-08-06 Pierre Langlois <pierre.langlois@arm.com>
* tracepoint.c (symbol_list) <required>: Remove.
if (debug_threads)
{
/* Dump up to four bytes. */
- unsigned int val = * (unsigned int *) myaddr;
- if (len == 1)
- val = val & 0xff;
- else if (len == 2)
- val = val & 0xffff;
- else if (len == 3)
- val = val & 0xffffff;
- debug_printf ("Writing %0*x to 0x%08lx in process %d\n",
- 2 * ((len < 4) ? len : 4), val, (long)memaddr, pid);
+ char str[4 * 2 + 1];
+ char *p = str;
+ int dump = len < 4 ? len : 4;
+
+ for (i = 0; i < dump; i++)
+ {
+ sprintf (p, "%02x", myaddr[i]);
+ p += 2;
+ }
+ *p = '\0';
+
+ debug_printf ("Writing %s to 0x%08lx in process %d\n",
+ str, (long) memaddr, pid);
}
/* Fill start and end extra bytes of buffer with existing memory data. */
}
linux_debug ("my_waitpid (%d, 0x%x): status(%x), %d\n",
- pid, flags, status ? *status : -1, ret);
+ pid, flags, (ret > 0 && status != NULL) ? *status : -1, ret);
errno = out_errno;
return ret;