From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1317 invoked by alias); 28 Feb 2013 13:17:14 -0000 Received: (qmail 1297 invoked by uid 22791); 28 Feb 2013 13:17:13 -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; Thu, 28 Feb 2013 13:17:00 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UB3M3-0007mS-Io from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 28 Feb 2013 05:16:59 -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); Thu, 28 Feb 2013 05:16:59 -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; Thu, 28 Feb 2013 05:16:59 -0800 From: Yao Qi To: Subject: [PATCH 3/4] Test dprintf breakpoint works correctly with other breakpoints Date: Thu, 28 Feb 2013 13:17:00 -0000 Message-ID: <1362057362-25324-3-git-send-email-yao@codesourcery.com> In-Reply-To: <1362057362-25324-1-git-send-email-yao@codesourcery.com> References: <1361192891-29341-1-git-send-email-yao@codesourcery.com> <1362057362-25324-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: 2013-02/txt/msg00736.txt.bz2 gdb/testsuite: 2013-02-28 Yao Qi * gdb.base/dprintf.exp: Test dprintf breakpoints works correctly with other breakpoints setting on the same address. --- gdb/testsuite/gdb.base/dprintf.exp | 49 ++++++++++++++++++++++++++++++----- 1 files changed, 42 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/gdb.base/dprintf.exp b/gdb/testsuite/gdb.base/dprintf.exp index ffbd3f2..22c740a 100644 --- a/gdb/testsuite/gdb.base/dprintf.exp +++ b/gdb/testsuite/gdb.base/dprintf.exp @@ -40,8 +40,11 @@ gdb_breakpoint "main" gdb_test "dprintf foo,\"At foo entry\\n\"" \ "Dprintf .*" +# Set two dprintf breakpoints at the same location. gdb_test "dprintf $dp_location1,\"arg=%d, g=%d\\n\", arg, g" \ - "Dprintf .*" + "Dprintf .*" +gdb_test "dprintf $dp_location1,\"g=%d, arg=%d\\n\", g, arg" \ + "Dprintf .*" gdb_test_sequence "info breakpoints" "dprintf info 1" { "\[\r\n\]Num Type Disp Enb Address +What" @@ -50,6 +53,8 @@ gdb_test_sequence "info breakpoints" "dprintf info 1" { "\[\r\n\] printf \"At foo entry\\\\n\"" "\[\r\n\]4 dprintf" "\[\r\n\] printf \"arg=%d, g=%d\\\\n\", arg, g" + "\[\r\n\]5 dprintf" + "\[\r\n\] printf \"g=%d, arg=%d\\\\n\", g, arg" } gdb_test "break $bp_location1" \ @@ -76,22 +81,52 @@ if ![target_info exists gdb,noinferiorio] { gdb_test "" "Breakpoint" - gdb_test "continue" "At foo entry.*arg=1234, g=1234.*" "1st dprintf, call" + # Test two dprintf breakpoints on the same location are executed. + gdb_test "continue" \ + "At foo entry.*arg=1234, g=1234\\r\\n.*g=1234, arg=1234\\r\\n.*" \ + "1st dprintf, call" - gdb_test "continue" "At foo entry.*arg=1235, g=2222.*" "2nd dprintf, call" + gdb_test "continue" \ + "At foo entry.*arg=1235, g=2222\\r\\n.*g=2222, arg=1235\\r\\n.*" \ + "2nd dprintf, call" gdb_test_no_output "set dprintf-function fprintf" "Set dprintf function" gdb_test_no_output "set dprintf-channel stderr" "Set dprintf channel" + # Set breakpoint on foo, and test dprintf set at the same address + # behaves correctly. + gdb_test "break foo" "Note: breakpoint ${decimal} also set at pc ${hex}.*" + gdb_test_no_output "set \$foo_breakpoint_number = \$bpnum" + # Hit the breakpoint on foo, and the command of dprintf + # breakpoint on foo is executed as well. + gdb_test "continue" \ + "Continuing\.\\r\\nAt foo entry\\r.*Breakpoint .*" \ + "continue" + gdb_test "delete \$foo_breakpoint_number" + gdb_run_cmd gdb_test "" "Breakpoint" - gdb_test "continue" "At foo entry.*arg=1234, g=1234.*" \ + gdb_test "continue" \ + "At foo entry.*arg=1234, g=1234\\r\\n.*g=1234, arg=1234\\r\\n.*" \ "1st dprintf, fprintf" - gdb_test "continue" "At foo entry.*arg=1235, g=2222.*" \ + gdb_test "continue" \ + "At foo entry.*arg=1235, g=2222\\r\\n.*g=2222, arg=1235\\r\\n.*" \ "2nd dprintf, fprintf" + + gdb_test_sequence "info breakpoints" "dprintf info 2" { + "\[\r\n\]Num Type Disp Enb Address +What" + "\[\r\n\]2 breakpoint" + "\[\r\n\]\tbreakpoint already hit 1 time" + "\[\r\n\]3 dprintf" + "\[\r\n\]\tbreakpoint already hit 2 times" + "\[\r\n\] call \\(void\\\) fprintf \\(stderr,\"At foo entry\\\\n\"\\)" + "\[\r\n\]4 dprintf" + "\[\r\n\]\tbreakpoint already hit 2 times" + "\[\r\n\] call \\(void\\) fprintf \\(stderr,\"arg=%d, g=%d\\\\n\", arg, g\\)" + } } set target_can_dprintf 1 @@ -116,8 +151,8 @@ if $target_can_dprintf { gdb_test "continue" "Breakpoint \[0-9\]+, foo .*" "2nd dprintf, agent" - gdb_test_sequence "info breakpoints" "dprintf info 2" { - "\[\r\n\]Num Type Disp Enb Address What" + gdb_test_sequence "info breakpoints" "dprintf info 3" { + "\[\r\n\]Num Type Disp Enb Address +What" "\[\r\n\]2 breakpoint" "\[\r\n\]\tbreakpoint already hit 2 times" "\[\r\n\]3 dprintf" -- 1.7.7.6