+2010-03-26 Pedro Alves <pedro@codesourcery.com>
+
+ * tracepoint.c (current_trace_status): Don't make sure error_desc
+ is non-NULL here.
+ (parse_trace_status): Release a previous error_desc string, and
+ set it to NULL by default. If stop reason is tracepoint_error,
+ make sure error_desc is not left NULL.
+
2010-03-26 Pedro Alves <pedro@codesourcery.com>
* tracepoint.c (trace_save): Remove X from tracepoint error
struct trace_status *
current_trace_status ()
{
- /* Ensure this is never NULL. */
- if (!trace_status.error_desc)
- trace_status.error_desc = "";
return &trace_status;
}
ts->running_known = 1;
ts->running = (*p++ == '1');
ts->stop_reason = trace_stop_reason_unknown;
- ts->error_desc = "";
+ xfree (ts->error_desc);
+ ts->error_desc = NULL;
ts->traceframe_count = -1;
ts->traceframes_created = -1;
ts->buffer_free = -1;
end = hex2bin (p1, ts->error_desc, (p2 - p1) / 2);
ts->error_desc[end] = '\0';
}
+ else
+ ts->error_desc = xstrdup ("");
+
p = unpack_varlen_hex (++p2, &val);
ts->stopping_tracepoint = val;
ts->stop_reason = tracepoint_error;