* breakpoint-in-ro-region.exp: Support targets stopping in mid-line after "si"
@ 2015-03-03 12:03 Andreas Arnez
2015-03-03 12:25 ` Yao Qi
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Arnez @ 2015-03-03 12:03 UTC (permalink / raw)
To: gdb-patches
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)"
}
--
2.1.4
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: breakpoint-in-ro-region.exp: Support targets stopping in mid-line after "si"
2015-03-03 12:03 breakpoint-in-ro-region.exp: Support targets stopping in mid-line after "si" Andreas Arnez
@ 2015-03-03 12:25 ` Yao Qi
0 siblings, 0 replies; 2+ messages in thread
From: Yao Qi @ 2015-03-03 12:25 UTC (permalink / raw)
To: Andreas Arnez; +Cc: gdb-patches
Andreas Arnez <arnez@linux.vnet.ibm.com> writes:
> 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.
Yes, they fail on aarch64-linux too.
>
> 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.
It looks good to me.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-03 12:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-03 12:03 breakpoint-in-ro-region.exp: Support targets stopping in mid-line after "si" Andreas Arnez
2015-03-03 12:25 ` Yao Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox