From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8726 invoked by alias); 26 Mar 2010 13:38:46 -0000 Received: (qmail 8717 invoked by uid 22791); 26 Mar 2010 13:38:45 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Mar 2010 13:38:41 +0000 Received: (qmail 8230 invoked from network); 26 Mar 2010 13:38:40 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 26 Mar 2010 13:38:40 -0000 From: Pedro Alves To: Stan Shebs Subject: Re: [PATCH/commit] Handle errors in tracepoint target agent Date: Fri, 26 Mar 2010 13:38:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; x86_64; ; ) Cc: gdb-patches@sourceware.org References: <4BAC1426.5050003@codesourcery.com> <201003261113.40865.pedro@codesourcery.com> <4BACAB4A.2060005@codesourcery.com> In-Reply-To: <4BACAB4A.2060005@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201003261338.36658.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00883.txt.bz2 On Friday 26 March 2010 12:40:42, Stan Shebs wrote: > My interest in the subject is now totally exhausted, > we'll just do the hex strings here. Thanks. I've applied the patch below. -- Pedro Alves 2010-03-26 Pedro Alves 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. --- gdb/doc/gdb.texinfo | 5 +---- gdb/tracepoint.c | 15 +++------------ 2 files changed, 4 insertions(+), 16 deletions(-) Index: src/gdb/doc/gdb.texinfo =================================================================== --- src.orig/gdb/doc/gdb.texinfo 2010-03-26 12:54:25.000000000 +0000 +++ src/gdb/doc/gdb.texinfo 2010-03-26 12:54:30.000000000 +0000 @@ -31366,10 +31366,7 @@ The trace stopped because tracepoint @va 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. Index: src/gdb/tracepoint.c =================================================================== --- src.orig/gdb/tracepoint.c 2010-03-26 12:54:33.000000000 +0000 +++ src/gdb/tracepoint.c 2010-03-26 12:57:00.000000000 +0000 @@ -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);