This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Harden gdb.base/bp-permanent.exp
- From: Pedro Alves <palves at redhat dot com>
- To: Luis Gustavo <lgustavo at codesourcery dot com>, "'gdb-patches at sourceware dot org'" <gdb-patches at sourceware dot org>
- Date: Fri, 10 Apr 2015 11:04:55 +0100
- Subject: Re: [PATCH] Harden gdb.base/bp-permanent.exp
- Authentication-results: sourceware.org; auth=none
- References: <5526B296 dot 8040000 at codesourcery dot com>
On 04/09/2015 06:10 PM, Luis Machado wrote:
> diff --git a/gdb/testsuite/gdb.base/bp-permanent.exp b/gdb/testsuite/gdb.base/bp-permanent.exp
> index 81a5293..9193db8 100644
> --- a/gdb/testsuite/gdb.base/bp-permanent.exp
> +++ b/gdb/testsuite/gdb.base/bp-permanent.exp
> @@ -104,7 +104,18 @@ proc test {always_inserted sw_watchpoint} {
> # to memory manually.
> set count [expr $address_after_bp - $address_bp]
> for {set i 0} {$i < $count} {incr i} {
> - gdb_test "p /x addr_bp\[$i\] = buffer\[$i\]" " = .*"
> + gdb_test_multiple "p /x addr_bp\[$i\] = buffer\[$i\]" $test {
> + -re "Cannot access memory at address $hex.*$gdb_prompt $" {
> + # Some targets (QEMU for one) do not allow writes to the
> + # .text section. It is no use continuing with the test
> + # at this point. Just return.
Double space after period.
> + unsupported $test
Something like:
unsupported "Cannot access memory"
OK with those changes.
I'm thinking it'd be good to adjust the test to hardcode the
breakpoint instruction (on an arch by arch basis, leaving the
current generic code in place), as it'd be good to test
stepping past permanent/program trap instructions
on QEMU/Valgrind, etc. too.
Thanks,
Pedro Alves