summaryrefslogtreecommitdiffstats
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2010-03-26 15:26:29 +0000
committerPedro Alves <palves@redhat.com>2010-03-26 15:26:29 +0000
commita609a0c8aea65ad85b9be6a7cb5a18d4a1d2ea68 (patch)
treef946c750ede1eb8d23f48851334fb2d04e61ecda /gdb
parent610197fd468b01ed5bc653b19e7c720f2a8d1f8d (diff)
downloadppe42-binutils-a609a0c8aea65ad85b9be6a7cb5a18d4a1d2ea68.tar.gz
ppe42-binutils-a609a0c8aea65ad85b9be6a7cb5a18d4a1d2ea68.zip
* 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/tracepoint.c9
2 files changed, 13 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 90c01a9c00..9ae7ec1666 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
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
description.
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 95e3478750..42210d4db1 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -202,9 +202,6 @@ char *stop_reason_names[] = {
struct trace_status *
current_trace_status ()
{
- /* Ensure this is never NULL. */
- if (!trace_status.error_desc)
- trace_status.error_desc = "";
return &trace_status;
}
@@ -3157,7 +3154,8 @@ parse_trace_status (char *line, struct trace_status *ts)
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;
@@ -3201,6 +3199,9 @@ Status line: '%s'\n"), p, line);
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;
OpenPOWER on IntegriCloud