const char *value);
static char *write_ptid (char *buf, const char *endbuf, ptid_t ptid);
-static ptid_t read_ptid (char *buf, char **obuf);
+static ptid_t read_ptid (const char *buf, const char **obuf);
static void remote_set_permissions (struct target_ops *self);
{
ULONGEST ul;
CORE_ADDR from, to, org_to;
- char *p, *pp;
+ const char *p, *pp;
int adjusted_size = 0;
int relocated = 0;
return buf;
}
-/* Extract a PTID from BUF. If non-null, OBUF is set to the to one
- passed the last parsed char. Returns null_ptid on error. */
+/* Extract a PTID from BUF. If non-null, OBUF is set to one past the
+ last parsed char. Returns null_ptid if no thread id is found, and
+ throws an error if the thread id has an invalid format. */
static ptid_t
-read_ptid (char *buf, char **obuf)
+read_ptid (const char *buf, const char **obuf)
{
- char *p = buf;
- char *pp;
+ const char *p = buf;
+ const char *pp;
ULONGEST pid = 0, tid = 0;
if (*p == 'p')
getpkt (&rs->buf, &rs->buf_size, 0);
if (rs->buf[0] == 'Q' && rs->buf[1] == 'C')
{
- char *obuf;
+ const char *obuf;
ptid_t result;
result = read_ptid (&rs->buf[2], &obuf);
if (rs->use_threadinfo_query)
{
- char *bufp;
+ const char *bufp;
putpkt ("qfThreadInfo");
getpkt (&rs->buf, &rs->buf_size, 0);
if (*p++ == 'm')
{
- parse_static_tracepoint_marker_definition (p, &p, marker);
+ parse_static_tracepoint_marker_definition (p, NULL, marker);
return 1;
}
VEC(static_tracepoint_marker_p) *markers = NULL;
struct static_tracepoint_marker *marker = NULL;
struct cleanup *old_chain;
- char *p;
+ const char *p;
/* Ask for a first packet of static tracepoint marker
definition. */
{
if (stop_reply[0] == 'T' && strlen (stop_reply) > 3)
{
- char *p;
+ const char *p;
/* Txx r:val ; r:val (...) */
p = &stop_reply[3];
/* Look for "register" named "thread". */
while (*p != '\0')
{
- char *p1;
+ const char *p1;
p1 = strchr (p, ':');
if (p1 == NULL)
{
struct remote_arch_state *rsa = get_remote_arch_state ();
ULONGEST addr;
- char *p;
+ const char *p;
int skipregs = 0;
event->ptid = null_ptid;
p = &buf[3]; /* after Txx */
while (*p)
{
- char *p1;
+ const char *p1;
int fieldsize;
p1 = strchr (p, ':');
else
{
ULONGEST pnum;
- char *p_temp;
+ const char *p_temp;
if (skipregs)
{
break;
case 'w': /* Thread exited. */
{
- char *p;
+ const char *p;
ULONGEST value;
event->ws.kind = TARGET_WAITKIND_THREAD_EXITED;
case 'W': /* Target exited. */
case 'X':
{
- char *p;
+ const char *p;
int pid;
ULONGEST value;