This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Handle memory write errors on gdb.base/break-always.exp
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Luis Machado <lgustavo at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Tue, 14 Apr 2015 10:00:05 +0100
- Subject: Re: [PATCH] Handle memory write errors on gdb.base/break-always.exp
- Authentication-results: sourceware.org; auth=none
- References: <1428949306-15524-1-git-send-email-lgustavo at codesourcery dot com>
Luis Machado <lgustavo@codesourcery.com> writes:
Hi Luis,
> +foreach test_value {0 1} {
> + set write_test "write $test_value to breakpoint's address $bp_address"
> +
In this way, $bp_address will be shown in the test summary in gdb.sum.
This may cause some differences when we compare gdb.sum of different
runs, like:
-PASS: gdb.base/break-always.exp: write 0 to breakpoint's address 0x1111
+PASS: gdb.base/break-always.exp: write 0 to breakpoint's address 0x2222
Let's remove $bp_address from $write_test.
> + gdb_test_multiple "p /x *(char *) $bp_address = $test_value" $write_test {
> + -re "Cannot access memory at address $hex.*$gdb_prompt $" {
> + unsupported "Cannot write to address $bp_address"
We need comments to explain we may go here. Copying some messages from
your mail should be fine.
> + return -1
> + }
> + -re " = .*$gdb_prompt $" {
> + pass $write_test
> + }
> + }
> +
> + set read_test "read back $test_value from the breakpoint's address $bp_address"
> +
Remove $bp_address from $read_test.
> + gdb_test "p /x *(char *) $bp_address" " = 0x$test_value" $read_test
> +}
Patch is OK to me with these changes.
--
Yao (éå)