This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] Fix for PR gdb/17017
- From: Pedro Alves <palves at redhat dot com>
- To: Siva Chandra <sivachandra at google dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Fri, 06 Jun 2014 10:18:13 +0100
- Subject: Re: [PATCH v2] Fix for PR gdb/17017
- Authentication-results: sourceware.org; auth=none
- References: <CAGyQ6gzjKs9AzVaA6cAkV9JOGR4FDtRaR5zrNJfj7A8N-MijAw at mail dot gmail dot com>
On 06/05/2014 11:55 PM, Siva Chandra wrote:
> The attached patch fixes PR 17017 along the lines suggested by Pedro
> here: https://sourceware.org/ml/gdb-patches/2014-06/msg00212.html
Thanks!
> diff --git a/gdb/testsuite/gdb.python/py-xmethods.exp b/gdb/testsuite/gdb.python/py-xmethods.exp
> index 97b6ffa..28786ed 100644
> --- a/gdb/testsuite/gdb.python/py-xmethods.exp
> +++ b/gdb/testsuite/gdb.python/py-xmethods.exp
> @@ -40,25 +40,51 @@ gdb_breakpoint [gdb_get_line_number "Break here."]
> gdb_continue_to_breakpoint "Break here" ".*Break here.*"
>
> # Tests before loading the debug methods.
> -gdb_test "p a1 + a2" "From CC <A_plus_A>.*15" "Before: a1 + a2"
> -gdb_test "p a2 - a1" "From CC <A_minus_A>.*5" "Before: a1 - a2"
> -gdb_test "p b1 - a1" "From CC <A_minus_A>.*25" "Before: b1 - a1"
> -gdb_test "p a1.geta()" "From CC A::geta.*5" "Before: a1.geta()"
> +if {[get_integer_valueof "a1 + a2" 0] != 15
> + || [get_integer_valueof "a_plus_a" 0] != 1} {
> + fail "Before: a1 + a2"
Shouldn't we have corresponding PASSes ?
> +}
> +if {[get_integer_valueof "a2 - a1" 0] != 5
> + || [get_integer_valueof "a_minus_a" 0] != 1} {
> + fail "Before: a2 - a1"
> +}
> +if {[get_integer_valueof "b1 - a1" 0] != 25
> + || [get_integer_valueof "a_minus_a" 0] != 2} {
Hmm, looks like these reads of "a_minus_a" etc. will cause
several duplicated gdb.sum lines. You can wrap tests with
with_test_prefix to address that:
with_test_prefix "Before: b1 - a1" {
...
}
See:
https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Make_sure_test_messages_are_unique
Thanks,
--
Pedro Alves