Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH] Add test for string evaluation with "debug expression" on
Date: Tue, 15 Jul 2014 17:26:00 -0000	[thread overview]
Message-ID: <1405444764-17309-1-git-send-email-simon.marchi@ericsson.com> (raw)

As Joel pointed out in...
https://sourceware.org/ml/gdb-patches/2014-07/msg00391.html
...it would be nice to add a test for that.

Tested on Linux x86_64 (Ubuntu 14.10).

gdb/testsuite/ChangeLog

2014-07-15  Simon Marchi  <simon.marchi@ericsson.com>

	* gdb.base/debug-expr.exp: Test string evaluation with
	"debug expression" on.
---
 gdb/testsuite/gdb.base/debug-expr.exp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gdb/testsuite/gdb.base/debug-expr.exp b/gdb/testsuite/gdb.base/debug-expr.exp
index d7c82b0..5576091 100644
--- a/gdb/testsuite/gdb.base/debug-expr.exp
+++ b/gdb/testsuite/gdb.base/debug-expr.exp
@@ -50,3 +50,8 @@ gdb_test_no_output "set debug expression 1"
 # This caused gdb to segfault.
 test_debug_expr "print /x {char\[4\]} array" \
     "\[$\]$decimal = \\{0x0, 0x1, 0x2, 0x3\\}"
+
+# This caused gdb to output garbage and possibly segfault
+gdb_test "print \"hello\"" \
+    ".*OP_STRING\[^\r\n\]*Language-specific string type: 0.*\[\r\n\]\\$$decimal = \"hello\"\[\r\n\].*" \
+    "String evaluation with debug expr"
-- 
2.0.0


             reply	other threads:[~2014-07-15 17:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15 17:26 Simon Marchi [this message]
2014-07-16 13:34 ` Joel Brobecker
2014-07-16 17:52   ` Simon Marchi

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=1405444764-17309-1-git-send-email-simon.marchi@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    /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