From patchwork Fri Mar 21 08:32:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Zhu X-Patchwork-Id: 203 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx21.g.dreamhost.com (caibbdcaaahb.dreamhost.com [208.113.200.71]) by wilcox.dreamhost.com (Postfix) with ESMTP id 229E6360164 for ; Fri, 21 Mar 2014 01:33:10 -0700 (PDT) Received: by homiemail-mx21.g.dreamhost.com (Postfix, from userid 14314964) id CBB9BC5359D; Fri, 21 Mar 2014 01:33:09 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx21.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx21.g.dreamhost.com (Postfix) with ESMTPS id 980F8CDAA34 for ; Fri, 21 Mar 2014 01:33:09 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:content-type:content-transfer-encoding; q=dns; s= default; b=wWVzWX3C10ozgeKO026VQkWCFa/ZExHWCLIR1DMJ5LPjC/VRI4xD+ fzlIjpuAU3LGoFaRBE+EvNyNuEo6ai1h5JNrSO58usRfXHJ/TGBWoCLw31pLZeRx gs61oJx7YYCHUJoR8CKbZoYpOhPdNJBADDJodHiq7+ZovyvEfdDVb8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:content-type:content-transfer-encoding; s=default; bh=l ytiYRHvnJd+RZ0iMkUQbx6aUdo=; b=BJ3exgnO2Uo4MOE3C6rBjyKHLrCNWVzDk iNYCVLd9hXZebjehc+EFy1616KovjWYwNbNWPnqX+cZ6105DcLvaw/HUI/rH+97T YMwvOcgO5Dt66whcsoEkFDbg9f2au+MTfRpSEyxOzDga7Amb519aNnXaPAWmE9o8 +VaUjHLQpM= Received: (qmail 30418 invoked by alias); 21 Mar 2014 08:33:08 -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 30408 invoked by uid 89); 21 Mar 2014 08:33:07 -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 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Mar 2014 08:33:05 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WQusw-0007Dh-Ef from Hui_Zhu@mentor.com ; Fri, 21 Mar 2014 01:33:02 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 21 Mar 2014 01:33:02 -0700 Received: from localhost.localdomain (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.2.247.3; Fri, 21 Mar 2014 01:33:01 -0700 Message-ID: <532BF93B.3040601@mentor.com> Date: Fri, 21 Mar 2014 16:32:59 +0800 From: Hui Zhu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: gdb-patches ml CC: Pedro Alves Subject: Ping: [PATCH] Fix PR breakpoints/16494: gdb.base/dprintf.exp agent-printf failures with non-Z0-supporting gdbservers X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in After the patch that commited by Pedro, the GDB can throw error about gdbserver doesn't support agent commands. But the test still get this error because the it doesn't try handle the error when send dprintf to gdbserver. So I make this patch. It test OK and pass regression test in x86_64-linux and powerpc-linux. Thanks, Hui 2014-03-11 Hui Zhu PR breakpoints/16494 * gdb.base/dprintf.exp: Add second check to make sure current target support breakpoints that have target side commands. * gdb.base/mi-dprintf.exp: Ditto. * lib/mi-support.exp (mi_run_cmd_full): Add handle for error. --- a/gdb/testsuite/gdb.base/dprintf.exp +++ b/gdb/testsuite/gdb.base/dprintf.exp @@ -109,6 +109,24 @@ gdb_test_multiple "set dprintf-style age } if $target_can_dprintf { + # Second check to make sure current target support breakpoints that have target side commands + gdb_run_cmd + + gdb_test "" "Breakpoint" + + set msg "Send dprintf to target" + gdb_test_multiple "continue" $msg { + -re "Warning:.*Target doesn't support breakpoints that have target side commands.*\r\n$gdb_prompt $" { + set target_can_dprintf 0 + pass "$msg - cannot do" + } + -re ".*$gdb_prompt $" { + pass "$msg - can do" + } + } +} + +if $target_can_dprintf { gdb_run_cmd gdb_test "" "Breakpoint" @@ -120,7 +138,7 @@ if $target_can_dprintf { 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 2 times" + "\[\r\n\]\tbreakpoint already hit 3 times" "\[\r\n\]3 dprintf" "\[\r\n\]\tbreakpoint already hit 2 times" "\[\r\n\] agent-printf \"At foo entry\\\\n\"" --- a/gdb/testsuite/gdb.mi/mi-dprintf.exp +++ b/gdb/testsuite/gdb.mi/mi-dprintf.exp @@ -140,6 +140,14 @@ gdb_expect { } if $target_can_dprintf { + # Second check to make sure current target support breakpoints that have target side commands + if {[mi_run_cmd] < 0} { + set target_can_dprintf 0 + unsupported "send dprintf to target" + } +} + +if $target_can_dprintf { mi_run_cmd mi_expect_stop ".*" ".*" ".*" ".*" ".*" "" "mi expect stop" --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -893,6 +893,7 @@ proc mi_run_cmd_full {use_mi_command arg send_gdb "${run_prefix}continue\n" gdb_expect 60 { -re "${run_match}\\^running\[\r\n\]+\\*running,thread-id=\"\[^\"\]+\"\r\n$mi_gdb_prompt" {} + -re "${run_match}\\^error.*" {return -1} default {} } return 0