This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] breakpoint-in-ro-region.exp: Support targets stopping in mid-line after "si"
- From: Andreas Krebbel <krebbel at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 4 Mar 2015 09:41:23 -0000
- Subject: [binutils-gdb] breakpoint-in-ro-region.exp: Support targets stopping in mid-line after "si"
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c214c7cfd38006369e1da13644000ce2e180a5fa
commit c214c7cfd38006369e1da13644000ce2e180a5fa
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
Date: Wed Mar 4 10:40:40 2015 +0100
breakpoint-in-ro-region.exp: Support targets stopping in mid-line after "si"
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.
Diff:
---
gdb/testsuite/ChangeLog | 6 ++++++
gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp | 5 +++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 159414e..f47ac96 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2015-03-04 Andreas Arnez <arnez@linux.vnet.ibm.com>
+ * 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.
+
+2015-03-04 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
* gdb.base/catch-syscall.exp (test_catch_syscall_multi_arch): Set
the 'arch1' variable for "s390*-linux*" targets.
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)"
}