From patchwork Tue Mar 3 12:03:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 5430 Received: (qmail 112851 invoked by alias); 3 Mar 2015 12:03:22 -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 112840 invoked by uid 89); 3 Mar 2015 12:03:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp13.uk.ibm.com Received: from e06smtp13.uk.ibm.com (HELO e06smtp13.uk.ibm.com) (195.75.94.109) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 03 Mar 2015 12:03:11 +0000 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Mar 2015 12:03:08 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 3 Mar 2015 12:03:05 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 67EB81B0805F for ; Tue, 3 Mar 2015 12:03:22 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t23C34gI62324748 for ; Tue, 3 Mar 2015 12:03:04 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t23C34OQ009593 for ; Tue, 3 Mar 2015 05:03:04 -0700 Received: from br87z6lw.de.ibm.com (dyn-9-152-212-115.boeblingen.de.ibm.com [9.152.212.115]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t23C34Yt009568 for ; Tue, 3 Mar 2015 05:03:04 -0700 From: Andreas Arnez To: gdb-patches@sourceware.org Subject: breakpoint-in-ro-region.exp: Support targets stopping in mid-line after "si" Date: Tue, 03 Mar 2015 13:03:04 +0100 Message-ID: <87bnkaxp8n.fsf@br87z6lw.de.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15030312-0013-0000-0000-00000325AD0C X-IsSubscribed: yes On some targets each of the assignments "i = 0" in the C source for "breakpoint-in-ro-region.exp" are compiled to a single instruction. Then each "si" stops at the beginning of the next source line. But on some other targets (like s390) such an assignment compiles to multiple instructions. Then "si" may stop in mid-line, and GDB displays the PC address in addition to the source line number. This was not considered by the regexp for this case. gdb/testsuite/ChangeLog: * gdb.base/breakpoint-in-ro-region.exp (test_single_step): In the regexps for GDB's current line display, accept a hex address preceding the line number. --- gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp index d27a0bb..2c9bac0 100644 --- a/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp +++ b/gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp @@ -191,6 +191,7 @@ delete_breakpoints proc test_single_step { always_inserted auto_hw } { global gdb_prompt global decimal + global hex global supports_hbreak global hw_step @@ -215,11 +216,11 @@ proc test_single_step { always_inserted auto_hw } { gdb_assert {!$hw_step && $auto_hw == "off"} \ "$test (cannot insert sw break)" } - -re "^si\r\nNote: automatically using hardware breakpoints for read-only addresses\.\r\n${decimal}\[ \t\]+i = 0;\r\n$gdb_prompt $" { + -re "^si\r\nNote: automatically using hardware breakpoints for read-only addresses\.\r\n\(\?\:${hex}\[ \t\]\)\?${decimal}\[ \t\]+i = 0;\r\n$gdb_prompt $" { gdb_assert {!$hw_step && $auto_hw == "on" && $supports_hbreak} \ "$test (auto-hw)" } - -re "^si\r\n${decimal}\[ \t\]+i = 0;\r\n$gdb_prompt $" { + -re "^si\r\n\(\?\:${hex}\[ \t\]\)\?${decimal}\[ \t\]+i = 0;\r\n$gdb_prompt $" { gdb_assert {$hw_step || ($auto_hw == "on" && $supports_hbreak)} \ "$test (no error)" }