+2010-05-07 Pedro Alves <pedro@codesourcery.com>
+
+ * remote.c (remote_query_supported_append): Use reconcat.
+ (remote_query_supported): Install a cleanup. Use reconcat.
+
2010-05-07 Pedro Alves <pedro@codesourcery.com>
* gdbarch.sh (qsupported): Delete.
while ((p = strtok (NULL, ",")) != NULL);
xfree (copy);
- p = concat (remote_support_xml, ",", xml, (char *) NULL);
- xfree (remote_support_xml);
- remote_support_xml = p;
+ remote_support_xml = reconcat (remote_support_xml,
+ remote_support_xml, ",", xml,
+ (char *) NULL);
}
#endif
}
remote_query_supported_append (char *msg, const char *append)
{
if (msg)
- {
- char *p = concat (msg, ";", append, (char *) NULL);
- xfree (msg);
- return p;
- }
+ return reconcat (msg, msg, ";", append, (char *) NULL);
else
return xstrdup (append);
}
if (remote_protocol_packets[PACKET_qSupported].support != PACKET_DISABLE)
{
char *q = NULL;
+ struct cleanup *old_chain = make_cleanup (free_current_contents, &q);
if (rs->extended)
q = remote_query_supported_append (q, "multiprocess+");
if (q)
{
- char *p = concat ("qSupported:", q, (char *) NULL);
- xfree (q);
- putpkt (p);
- xfree (p);
+ q = reconcat (q, "qSupported:", q, (char *) NULL);
+ putpkt (q);
}
else
putpkt ("qSupported");
+ do_cleanups (old_chain);
+
getpkt (&rs->buf, &rs->buf_size, 0);
/* If an error occured, warn, but do not return - just reset the