From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8052 invoked by alias); 12 Dec 2012 04:13:13 -0000 Received: (qmail 7265 invoked by uid 22791); 12 Dec 2012 04:13:10 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Dec 2012 04:13:03 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Tidgt-0001DL-7o from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Tue, 11 Dec 2012 20:13:03 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 11 Dec 2012 20:13:03 -0800 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Tue, 11 Dec 2012 20:13:02 -0800 From: Yao Qi To: Subject: [PATCH 1/3] Test of breakpoint output for dprintf Date: Wed, 12 Dec 2012 04:13:00 -0000 Message-ID: <1355285581-28889-2-git-send-email-yao@codesourcery.com> In-Reply-To: <1355285581-28889-1-git-send-email-yao@codesourcery.com> References: <1355285581-28889-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain 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: 2012-12/txt/msg00374.txt.bz2 Hi, We don't have a test to check the output of 'info breakpoints' and fields in "=breakpoint-created" notificiation, which are all related to 'print_one_breakpoint_location'. This patch adds tests for dprintf. Is it OK? gdb/testsuite: 2012-12-12 Yao Qi * gdb.base/dprintf.exp: Check the output of 'info breakpoints' for dprintf. * gdb.mi/mi-breakpoint-changed.exp (test_insert_delete_modify): Check the fields in "=breakpoint-created" for dprintf. --- gdb/testsuite/gdb.base/dprintf.exp | 13 +++++++++++++ gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp | 2 +- 2 files changed, 14 insertions(+), 1 deletions(-) diff --git a/gdb/testsuite/gdb.base/dprintf.exp b/gdb/testsuite/gdb.base/dprintf.exp index bd0615b..979ceaf 100644 --- a/gdb/testsuite/gdb.base/dprintf.exp +++ b/gdb/testsuite/gdb.base/dprintf.exp @@ -43,6 +43,13 @@ gdb_test "dprintf foo,\"At foo entry\\n\"" \ gdb_test "dprintf $dp_location1,\"arg=%d, g=%d\\n\", arg, g" \ "Dprintf .*" +gdb_test "info breakpoints" "3\[\t \]+dprintf .* +\[\t \]+printf \"At foo entry\\\\n\". +\[\t \]+continue. +4\[\t \]+dprintf .* +\[\t \]+printf \"arg=%d, g=%d\\\\n\", arg, g. +\[\t \]+continue." "dprintf info 1" + gdb_test "break $bp_location1" \ "Breakpoint .*" @@ -107,6 +114,12 @@ if $target_can_dprintf { gdb_test "continue" "Breakpoint \[0-9\]+, foo .*" "2nd dprintf, agent" + gdb_test "info breakpoints" "3\[\t \]+dprintf .* +\[\t \]+breakpoint already hit 2 times. +\[\t \]+agent-printf \"At foo entry\\\\n\". +4\[\t \]+dprintf .* +\[\t \]+breakpoint already hit 2 times. +\[\t \]+agent-printf \"arg=%d, g=%d\\\\n\", arg, g.*" "info dprintf 2" } gdb_test "set dprintf-style foobar" "Undefined item: \"foobar\"." \ diff --git a/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp b/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp index ec10032..df6101c 100644 --- a/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp +++ b/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp @@ -96,7 +96,7 @@ proc test_insert_delete_modify { } { $test set test "dprintf marker, \"arg\" \"" mi_gdb_test $test \ - {.*=breakpoint-created,bkpt=\{number="6",type="dprintf".*\}.*\n\^done} \ + {.*=breakpoint-created,bkpt=\{number="6",type="dprintf".*,script=\{\"printf \\\\\"arg\\\\\" \\\\\"\",\"continue\"\}.*\}\r\n\^done} \ $test # 2. when modifying condition -- 1.7.7.6