From: Pedro Alves Date: Fri, 26 Mar 2010 13:35:06 +0000 (+0000) Subject: gdb/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=99b5e152aad13580d6a3b7feda87ad40de7ec7d2;p=binutils-gdb.git gdb/ * tracepoint.c (parse_trace_status): Don't allow plain strings in the terror description. Don't expect an X prefix. gdb/doc/ * gdb.texinfo (Tracepoint Packets): Remove mention that terror:string may be plain text, and drop mention of X prefix. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6dff8952be6..5c015a59901 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-03-26 Pedro Alves + + * tracepoint.c (parse_trace_status): Don't allow plain strings in + the terror description. Don't expect an X prefix. + 2010-03-25 Stan Shebs * tracepoint.h (trace_stop_reason): Add tracepoint_error. diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 69c2c0a5f85..c15ff122e51 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2010-03-26 Pedro Alves + + * gdb.texinfo (Tracepoint Packets): Remove mention that + terror:string may be plain text, and drop mention of X prefix. + 2010-03-26 Vladimir Prus * gdb.texinfo (GDB/MI Tracepoint Commands): Add comma after @xref. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index b11d3c0aedd..4bef3f0378d 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -31366,10 +31366,7 @@ The trace stopped because tracepoint @var{tpnum} exceeded its pass count. The trace stopped because tracepoint @var{tpnum} had an error. The string @var{text} is available to describe the nature of the error (for instance, a divide by zero in the condition expression). -@var{text} may take either of two forms; it may be plain text, but -with the restriction that no colons or other special characters are -allowed, or it may be an @code{X} followed by hex digits encoding the -text string. +@var{text} is hex encoded. @item tunknown:0 The trace stopped for some other reason. diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 447682a8686..fc364f35e02 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -3197,18 +3197,9 @@ Status line: '%s'\n"), p, line); if (p2 != p1) { int end; - ts->error_desc = (char *) xmalloc (p2 - p1 + 1); - /* See if we're doing plain text or hex encoding. */ - if (*p1 == 'X') - { - ++p1; - end = hex2bin (p1, ts->error_desc, (p2 - p1) / 2); - } - else - { - memcpy (ts->error_desc, p1, p2 - p1); - end = p2 - p1; - } + + ts->error_desc = xmalloc ((p2 - p1) / 2 + 1); + end = hex2bin (p1, ts->error_desc, (p2 - p1) / 2); ts->error_desc[end] = '\0'; } p = unpack_varlen_hex (++p2, &val);