Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] Fix info spu mailbox command
@ 2008-03-14  6:27 Markus Deuling
  2008-03-17 13:23 ` Ulrich Weigand
  0 siblings, 1 reply; 10+ messages in thread
From: Markus Deuling @ 2008-03-14  6:27 UTC (permalink / raw)
  To: GDB Patches; +Cc: Ulrich Weigand

[-- Attachment #1: Type: text/plain, Size: 409 bytes --]

Hi,

gdb.arch/spu-info.exp FAILs when testing "info spu mailbox" command due to a fix

http://patchwork.ozlabs.org/cbe-oss-dev/patch?id=15729

in the linux kernel which initializes the mailbox values correct now.

Ok ?

ChangeLog:

        * gdb.arch/spu-info.exp (info spu mailbox): Use correct initialisation
        value.



-- 
  Markus Deuling
  GNU Toolchain for Linux on Cell BE
  deuling@de.ibm.com


[-- Attachment #2: fix-spu-mailbox --]
[-- Type: text/plain, Size: 634 bytes --]

diff -urpN src/gdb/testsuite/gdb.arch/spu-info.exp dev/gdb/testsuite/gdb.arch/spu-info.exp
--- src/gdb/testsuite/gdb.arch/spu-info.exp	2008-01-01 23:53:18.000000000 +0100
+++ dev/gdb/testsuite/gdb.arch/spu-info.exp	2008-03-14 07:23:06.000000000 +0100
@@ -201,7 +201,7 @@ gdb_test "finish" "" "finish"
 # 'info spu mailbox' should be empty.
 c_to "Marker Mbox"
 gdb_test "info spu mailbox" \
-	 "SPU Outbound Mailbox.*0xc0000000.*SPU Outbound Interrupt Mailbox.*0xc0000000.*" \
+	 "SPU Outbound Mailbox.*0x00000000.*SPU Outbound Interrupt Mailbox.*0x00000000.*" \
 	 "info spu mailbox"
 
 # 'info spu mailbox' should now contain data.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [rfc] Fix info spu mailbox command
  2008-03-14  6:27 [rfc] Fix info spu mailbox command Markus Deuling
@ 2008-03-17 13:23 ` Ulrich Weigand
  2008-03-18 19:53   ` Markus Deuling
  0 siblings, 1 reply; 10+ messages in thread
From: Ulrich Weigand @ 2008-03-17 13:23 UTC (permalink / raw)
  To: Markus Deuling; +Cc: GDB Patches

Markus Deuling:

>         * gdb.arch/spu-info.exp (info spu mailbox): Use correct initialisation
>         value.

This is OK.  Even better would be to XFAIL (instead of FAIL) the new test
on old kernels ...

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [rfc] Fix info spu mailbox command
  2008-03-17 13:23 ` Ulrich Weigand
@ 2008-03-18 19:53   ` Markus Deuling
  2008-03-18 21:25     ` Joel Brobecker
  0 siblings, 1 reply; 10+ messages in thread
From: Markus Deuling @ 2008-03-18 19:53 UTC (permalink / raw)
  To: GDB Patches; +Cc: Ulrich Weigand

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

Ulrich Weigand schrieb:
> Markus Deuling:
> 
>>         * gdb.arch/spu-info.exp (info spu mailbox): Use correct initialisation
>>         value.
> 
> This is OK.  Even better would be to XFAIL (instead of FAIL) the new test
> on old kernels ...
> 

Hi Uli,

now the test XFAILs on old kernels without Jeremy's patch.
Ok ?


-- 
  Markus Deuling
  GNU Toolchain for Linux on Cell BE
  deuling@de.ibm.com


[-- Attachment #2: fix-spu-mailbox --]
[-- Type: text/plain, Size: 960 bytes --]

diff -urpN src/gdb/testsuite/gdb.arch/spu-info.exp dev/gdb/testsuite/gdb.arch/spu-info.exp
--- src/gdb/testsuite/gdb.arch/spu-info.exp	2008-01-01 23:53:18.000000000 +0100
+++ dev/gdb/testsuite/gdb.arch/spu-info.exp	2008-03-17 15:56:55.000000000 +0100
@@ -200,9 +200,14 @@ gdb_test "finish" "" "finish"
 # Mailbox Test
 # 'info spu mailbox' should be empty.
 c_to "Marker Mbox"
-gdb_test "info spu mailbox" \
-	 "SPU Outbound Mailbox.*0xc0000000.*SPU Outbound Interrupt Mailbox.*0xc0000000.*" \
-	 "info spu mailbox"
+send_gdb "info spu mailbox\n"
+gdb_expect {
+  -re "SPU Outbound Mailbox.*0xc0000000.*SPU Outbound Interrupt Mailbox.*0xc0000000.*$gdb_prompt $"\
+      { xfail "info spu mailbox" }
+  -re "SPU Outbound Mailbox.*0x00000000.*SPU Outbound Interrupt Mailbox.*0x00000000.*$gdb_prompt $"\
+      { pass "info spu mailbox" }
+  timeout { fail "(timeout) info spu mailbox" }
+}
 
 # 'info spu mailbox' should now contain data.
 c_to "Marker MboxEnd"

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [rfc] Fix info spu mailbox command
  2008-03-18 19:53   ` Markus Deuling
@ 2008-03-18 21:25     ` Joel Brobecker
  2008-03-19 10:28       ` Markus Deuling
  0 siblings, 1 reply; 10+ messages in thread
From: Joel Brobecker @ 2008-03-18 21:25 UTC (permalink / raw)
  To: Markus Deuling; +Cc: GDB Patches, Ulrich Weigand

> +send_gdb "info spu mailbox\n"
> +gdb_expect {
> +  -re "SPU Outbound Mailbox.*0xc0000000.*SPU Outbound Interrupt Mailbox.*0xc0000000.*$gdb_prompt $"\
> +      { xfail "info spu mailbox" }
> +  -re "SPU Outbound Mailbox.*0x00000000.*SPU Outbound Interrupt Mailbox.*0x00000000.*$gdb_prompt $"\
> +      { pass "info spu mailbox" }
> +  timeout { fail "(timeout) info spu mailbox" }
> +}

Any reason for not using gdb_test_multiple in this case (instead of
send_gdb/gdb_expext)? gdb_test_multiple has been designed to handle
this type of test, and as a bonus, you won't have to handle the timeout
explicitly.


-- 
Joel


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [rfc] Fix info spu mailbox command
  2008-03-18 21:25     ` Joel Brobecker
@ 2008-03-19 10:28       ` Markus Deuling
  2008-03-19 11:54         ` Daniel Jacobowitz
  0 siblings, 1 reply; 10+ messages in thread
From: Markus Deuling @ 2008-03-19 10:28 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: GDB Patches, Ulrich Weigand

Hi Joel,

Joel Brobecker schrieb:
>> +send_gdb "info spu mailbox\n"
>> +gdb_expect {
>> +  -re "SPU Outbound Mailbox.*0xc0000000.*SPU Outbound Interrupt Mailbox.*0xc0000000.*$gdb_prompt $"\
>> +      { xfail "info spu mailbox" }
>> +  -re "SPU Outbound Mailbox.*0x00000000.*SPU Outbound Interrupt Mailbox.*0x00000000.*$gdb_prompt $"\
>> +      { pass "info spu mailbox" }
>> +  timeout { fail "(timeout) info spu mailbox" }
>> +}
> 
> Any reason for not using gdb_test_multiple in this case (instead of
> send_gdb/gdb_expext)? gdb_test_multiple has been designed to handle
> this type of test, and as a bonus, you won't have to handle the timeout
> explicitly.
> 

as far as I see gdb_expect is much more often used compared to gdb_test_multiple. What is the 
advantage of gdb_test_multiple compared to just send/expect? 


-- 
  Markus Deuling
  GNU Toolchain for Linux on Cell BE
  deuling@de.ibm.com


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [rfc] Fix info spu mailbox command
  2008-03-19 10:28       ` Markus Deuling
@ 2008-03-19 11:54         ` Daniel Jacobowitz
  2008-03-19 18:01           ` Markus Deuling
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2008-03-19 11:54 UTC (permalink / raw)
  To: Markus Deuling; +Cc: Joel Brobecker, GDB Patches, Ulrich Weigand

On Wed, Mar 19, 2008 at 11:28:03AM +0100, Markus Deuling wrote:
> Hi Joel,
>
> Joel Brobecker schrieb:
>> Any reason for not using gdb_test_multiple in this case (instead of
>> send_gdb/gdb_expext)? gdb_test_multiple has been designed to handle
>> this type of test, and as a bonus, you won't have to handle the timeout
>> explicitly.
>>
>
> as far as I see gdb_expect is much more often used compared to 
> gdb_test_multiple. What is the advantage of gdb_test_multiple compared to 
> just send/expect? 

gdb_test_multiple is newer and most of the testsuite is very old,
that's why gdb_expect is used.  gdb_test_multiple is much better
because it handles standard cases, like an unexpected prompt, without
having to wait for a timeout.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [rfc] Fix info spu mailbox command
  2008-03-19 11:54         ` Daniel Jacobowitz
@ 2008-03-19 18:01           ` Markus Deuling
  2008-03-19 18:33             ` Joel Brobecker
  0 siblings, 1 reply; 10+ messages in thread
From: Markus Deuling @ 2008-03-19 18:01 UTC (permalink / raw)
  To: GDB Patches; +Cc: Joel Brobecker, Ulrich Weigand, Daniel Jacobowitz

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

Daniel Jacobowitz schrieb:
> gdb_test_multiple is newer and most of the testsuite is very old,
> that's why gdb_expect is used.  gdb_test_multiple is much better
> because it handles standard cases, like an unexpected prompt, without
> having to wait for a timeout.
> 

Attached is a version using gdb_test_multiple. Ok ?

-- 
  Markus Deuling
  GNU Toolchain for Linux on Cell BE
  deuling@de.ibm.com


[-- Attachment #2: fix-spu-mailbox --]
[-- Type: text/plain, Size: 821 bytes --]

diff -urpN src/gdb/testsuite/gdb.arch/spu-info.exp dev/gdb/testsuite/gdb.arch/spu-info.exp
--- src/gdb/testsuite/gdb.arch/spu-info.exp	2008-01-01 23:53:18.000000000 +0100
+++ dev/gdb/testsuite/gdb.arch/spu-info.exp	2008-03-19 18:52:48.000000000 +0100
@@ -200,9 +200,14 @@ gdb_test "finish" "" "finish"
 # Mailbox Test
 # 'info spu mailbox' should be empty.
 c_to "Marker Mbox"
-gdb_test "info spu mailbox" \
-	 "SPU Outbound Mailbox.*0xc0000000.*SPU Outbound Interrupt Mailbox.*0xc0000000.*" \
-	 "info spu mailbox"
+set msg "info spu mailbox"
+gdb_test_multiple "info spu mailbox " $msg {
+  -re "SPU Outbound Mailbox.*0x00000000.*SPU Outbound Interrupt Mailbox.*0x00000000.*$gdb_prompt $" \
+    { pass $msg }
+  default {
+    xfail $msg
+  }
+}
 
 # 'info spu mailbox' should now contain data.
 c_to "Marker MboxEnd"

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [rfc] Fix info spu mailbox command
  2008-03-19 18:01           ` Markus Deuling
@ 2008-03-19 18:33             ` Joel Brobecker
  2008-03-19 18:50               ` Markus Deuling
  0 siblings, 1 reply; 10+ messages in thread
From: Joel Brobecker @ 2008-03-19 18:33 UTC (permalink / raw)
  To: Markus Deuling; +Cc: GDB Patches, Ulrich Weigand, Daniel Jacobowitz

Hi Markus,

> +set msg "info spu mailbox"
> +gdb_test_multiple "info spu mailbox " $msg {
> +  -re "SPU Outbound Mailbox.*0x00000000.*SPU Outbound Interrupt Mailbox.*0x00000000.*$gdb_prompt $" \
> +    { pass $msg }
> +  default {
> +    xfail $msg
> +  }
> +}

After having looked at your previous patch, it looks like you probably
wanted to only xfail the test when the 0x number (mailbox number?) is
0xc0000000, but anything else is an unexpected FAIL. Also, I don't think
you need the "default" block. So I think your test should look like this:

gdb_test_multiple "info spu mailbox" "$msg" {
    -re "SPU Outbound Mailbox.*0x00000000.*SPU Outbound Interrupt Mailbox.*0x00000000.*$gdb_prompt $" {
         pass "$msg"
    }
    -re "SPU Outbound Mailbox.*0xc0000000.*SPU Outbound Interrupt Mailbox.*0xc0000000.*$gdb_prompt $" {
         xfail "$msg"
    }
}

-- 
Joel


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [rfc] Fix info spu mailbox command
  2008-03-19 18:33             ` Joel Brobecker
@ 2008-03-19 18:50               ` Markus Deuling
  2008-03-19 21:12                 ` Ulrich Weigand
  0 siblings, 1 reply; 10+ messages in thread
From: Markus Deuling @ 2008-03-19 18:50 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: GDB Patches, Ulrich Weigand, Daniel Jacobowitz

Joel Brobecker schrieb:
> Hi Markus,
> 
>> +set msg "info spu mailbox"
>> +gdb_test_multiple "info spu mailbox " $msg {
>> +  -re "SPU Outbound Mailbox.*0x00000000.*SPU Outbound Interrupt Mailbox.*0x00000000.*$gdb_prompt $" \
>> +    { pass $msg }
>> +  default {
>> +    xfail $msg
>> +  }
>> +}
> 
> After having looked at your previous patch, it looks like you probably
> wanted to only xfail the test when the 0x number (mailbox number?) is
> 0xc0000000, but anything else is an unexpected FAIL. Also, I don't think
> you need the "default" block. So I think your test should look like this:
> 
> gdb_test_multiple "info spu mailbox" "$msg" {
>     -re "SPU Outbound Mailbox.*0x00000000.*SPU Outbound Interrupt Mailbox.*0x00000000.*$gdb_prompt $" {
>          pass "$msg"
>     }
>     -re "SPU Outbound Mailbox.*0xc0000000.*SPU Outbound Interrupt Mailbox.*0xc0000000.*$gdb_prompt $" {
>          xfail "$msg"
>     }
> }
> 

Hm, yes and no. Maybe it was not a good idea from me to check for 0xc.... Before that kernel patch
the data came from an uninitialised variable so it might have been 0xc... accidently.
I haven't seen cases != 0xc but this does not mean that this can't happen.

Only thing I can say for sure is that 0x00000000 should be the initial content. Everything else is
XFAIL because of old kernel version. 

-- 
  Markus Deuling
  GNU Toolchain for Linux on Cell BE
  deuling@de.ibm.com


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [rfc] Fix info spu mailbox command
  2008-03-19 18:50               ` Markus Deuling
@ 2008-03-19 21:12                 ` Ulrich Weigand
  0 siblings, 0 replies; 10+ messages in thread
From: Ulrich Weigand @ 2008-03-19 21:12 UTC (permalink / raw)
  To: Markus Deuling; +Cc: Joel Brobecker, GDB Patches, Daniel Jacobowitz

Markus Deuling wrote:
> Joel Brobecker schrieb:
> > After having looked at your previous patch, it looks like you probably
> > wanted to only xfail the test when the 0x number (mailbox number?) is
> > 0xc0000000, but anything else is an unexpected FAIL. Also, I don't think
> > you need the "default" block. So I think your test should look like this:
> > 
> > gdb_test_multiple "info spu mailbox" "$msg" {
> >     -re "SPU Outbound Mailbox.*0x00000000.*SPU Outbound Interrupt Mailbox.*0x00000000.*$gdb_prompt $" {
> >          pass "$msg"
> >     }
> >     -re "SPU Outbound Mailbox.*0xc0000000.*SPU Outbound Interrupt Mailbox.*0xc0000000.*$gdb_prompt $" {
> >          xfail "$msg"
> >     }
> > }
> > 
> 
> Hm, yes and no. Maybe it was not a good idea from me to check for 0xc.... Before that kernel patch
> the data came from an uninitialised variable so it might have been 0xc... accidently.
> I haven't seen cases != 0xc but this does not mean that this can't happen.
> 
> Only thing I can say for sure is that 0x00000000 should be the initial content. Everything else is
> XFAIL because of old kernel version. 

I guess the best would be something like:

gdb_test_multiple "info spu mailbox" "$msg" {
    -re "SPU Outbound Mailbox.*0x00000000.*SPU Outbound Interrupt Mailbox.*0x00000000.*$gdb_prompt $" {
         pass "$msg"
    }
    # Older kernels had a bug that caused them to return arbitrary values when
    # attempting to read from an empty mailbox via spufs.
    -re "SPU Outbound Mailbox.*0x.*SPU Outbound Interrupt Mailbox.*0x.*$gdb_prompt $" {
         xfail "$msg"
    }
}

This does verify that GDB works as expected and prints the
proper message, but at the same time does not verify the
actual mailbox contents -- acknowledging that buggy kernels
may in fact return arbitrary values here.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-03-19 21:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-14  6:27 [rfc] Fix info spu mailbox command Markus Deuling
2008-03-17 13:23 ` Ulrich Weigand
2008-03-18 19:53   ` Markus Deuling
2008-03-18 21:25     ` Joel Brobecker
2008-03-19 10:28       ` Markus Deuling
2008-03-19 11:54         ` Daniel Jacobowitz
2008-03-19 18:01           ` Markus Deuling
2008-03-19 18:33             ` Joel Brobecker
2008-03-19 18:50               ` Markus Deuling
2008-03-19 21:12                 ` Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox