From patchwork Tue Jul 15 17:19:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 2065 Received: (qmail 7976 invoked by alias); 15 Jul 2014 17:19:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 7962 invoked by uid 89); 15 Jul 2014 17:19:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg21.ericsson.net Received: from usevmg21.ericsson.net (HELO usevmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 15 Jul 2014 17:19:32 +0000 Received: from EUSAAHC004.ericsson.se (Unknown_Domain [147.117.188.84]) by usevmg21.ericsson.net (Symantec Mail Security) with SMTP id B4.76.25146.5AD05C35; Tue, 15 Jul 2014 13:16:54 +0200 (CEST) Received: from simark-hp.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.84) with Microsoft SMTP Server (TLS) id 14.3.174.1; Tue, 15 Jul 2014 13:19:30 -0400 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH] Add test for string evaluation with "debug expression" on Date: Tue, 15 Jul 2014 13:19:24 -0400 Message-ID: <1405444764-17309-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 X-IsSubscribed: yes 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 * 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"