Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Stan Shebs <stan@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH/commit] Handle errors in tracepoint target agent
Date: Fri, 26 Mar 2010 13:38:00 -0000	[thread overview]
Message-ID: <201003261338.36658.pedro@codesourcery.com> (raw)
In-Reply-To: <4BACAB4A.2060005@codesourcery.com>

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  <pedro@codesourcery.com>

	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);


  reply	other threads:[~2010-03-26 13:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26  1:56 Stan Shebs
2010-03-26 11:13 ` Pedro Alves
2010-03-26 12:40   ` Stan Shebs
2010-03-26 13:38     ` Pedro Alves [this message]
2010-03-26 14:17       ` Pedro Alves
2010-03-26 11:40 ` Pedro Alves
2010-03-26 12:50   ` Stan Shebs
2010-03-26 14:44     ` Pedro Alves
2010-03-26 15:20       ` Stan Shebs
2010-03-26 15:28         ` Eli Zaretskii
2010-03-26 15:53         ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201003261338.36658.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=stan@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox