Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] gdb.base/float.exp and gdb.base/commands.exp patch
@ 2005-03-02 23:55 Manoj Iyer
  2005-03-03  0:27 ` Daniel Jacobowitz
  0 siblings, 1 reply; 9+ messages in thread
From: Manoj Iyer @ 2005-03-02 23:55 UTC (permalink / raw)
  To: gdb-patches


Two testcases float.exp and commands.exp were failing on PowerPC for
simple reasons, command.exp had a hard coded line number and float.exp did
not have PowerPC as a known target. Please approve patch so that I can
commit. Here is the patch.



2005-03-02  Manoj Iyer  <manjo@austin.ibm.com>

	* commands.exp: Change hardcoded value to regular expression.
	* float.exp: Add powerpc to the list of targets checked.

------------------------------------------------------------------------------
diff -Naurp old/src/gdb/testsuite/gdb.base/commands.exp
new/src/gdb/testsuite/gdb.base/commands.exp
--- old/src/gdb/testsuite/gdb.base/commands.exp 2003-09-29
10:08:52.000000000 -0500
+++ new/src/gdb/testsuite/gdb.base/commands.exp 2005-03-23
08:18:41.000000000 -0600
@@ -331,7 +331,7 @@ proc watchpoint_command_test {} {
     }
     send_gdb "continue\n"
     gdb_expect {
-       -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the
program has left the block in.*which its expression is
valid.*run.c:57.*$gdb_prompt $" {
+       -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the
program has left the block in.*which its expression is
valid.*run.c:\[0-9\]+.*$gdb_prompt $" {
            pass "continue with watch"
        }
        -re "$gdb_prompt $"   {fail "continue with watch"}
diff -Naurp old/src/gdb/testsuite/gdb.base/float.exp
new/src/gdb/testsuite/gdb.base/float.exp
--- old/src/gdb/testsuite/gdb.base/float.exp    2004-06-08
10:50:59.000000000 -0500
+++ new/src/gdb/testsuite/gdb.base/float.exp    2005-03-23
08:19:38.000000000 -0600
@@ -65,6 +65,8 @@ if { [istarget "alpha*-*-*"] } then {
     gdb_test "info float" "fp0.*fp1.*fp7.*" "info float"
 } elseif [istarget "mips*-*-*"] then {
     gdb_test "info float" "f0:.*flt:.*dbl:.*" "info float"
+} elseif [istarget "powerpc*-*-*"] then {
+    gdb_test "info float" "f0.*f1.*f31.*fpscr.*" "info float"
 } elseif [istarget "s390*-*-*"] then {
     gdb_test "info float" "fpc.*f0.*f1.*f15.*" "info float"
 } elseif [istarget "sh*-*"] then {

----------------------------------------------------------------------------


Ok to commit??

-----
manjo
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Cogito ergo sum                                                          +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


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

* Re: [RFC] gdb.base/float.exp and gdb.base/commands.exp patch
  2005-03-02 23:55 [RFC] gdb.base/float.exp and gdb.base/commands.exp patch Manoj Iyer
@ 2005-03-03  0:27 ` Daniel Jacobowitz
  2005-03-03  5:32   ` Manoj Iyer
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2005-03-03  0:27 UTC (permalink / raw)
  To: Manoj Iyer; +Cc: gdb-patches

On Wed, Mar 02, 2005 at 05:40:18PM -0600, Manoj Iyer wrote:
> 
> Two testcases float.exp and commands.exp were failing on PowerPC for
> simple reasons, command.exp had a hard coded line number and float.exp did
> not have PowerPC as a known target. Please approve patch so that I can
> commit. Here is the patch.
> 
> 
> 
> 2005-03-02  Manoj Iyer  <manjo@austin.ibm.com>
> 
> 	* commands.exp: Change hardcoded value to regular expression.
> 	* float.exp: Add powerpc to the list of targets checked.
> 
> ------------------------------------------------------------------------------
> diff -Naurp old/src/gdb/testsuite/gdb.base/commands.exp
> new/src/gdb/testsuite/gdb.base/commands.exp
> --- old/src/gdb/testsuite/gdb.base/commands.exp 2003-09-29
> 10:08:52.000000000 -0500
> +++ new/src/gdb/testsuite/gdb.base/commands.exp 2005-03-23
> 08:18:41.000000000 -0600
> @@ -331,7 +331,7 @@ proc watchpoint_command_test {} {
>      }
>      send_gdb "continue\n"
>      gdb_expect {
> -       -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the
> program has left the block in.*which its expression is
> valid.*run.c:57.*$gdb_prompt $" {
> +       -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the
> program has left the block in.*which its expression is
> valid.*run.c:\[0-9\]+.*$gdb_prompt $" {
>             pass "continue with watch"
>         }
>         -re "$gdb_prompt $"   {fail "continue with watch"}

What compiler are you testing with?  On what line is it reporting that
it has left the block?  I'd like to understand the difference before we
change this.

> diff -Naurp old/src/gdb/testsuite/gdb.base/float.exp
> new/src/gdb/testsuite/gdb.base/float.exp
> --- old/src/gdb/testsuite/gdb.base/float.exp    2004-06-08
> 10:50:59.000000000 -0500
> +++ new/src/gdb/testsuite/gdb.base/float.exp    2005-03-23
> 08:19:38.000000000 -0600
> @@ -65,6 +65,8 @@ if { [istarget "alpha*-*-*"] } then {
>      gdb_test "info float" "fp0.*fp1.*fp7.*" "info float"
>  } elseif [istarget "mips*-*-*"] then {
>      gdb_test "info float" "f0:.*flt:.*dbl:.*" "info float"
> +} elseif [istarget "powerpc*-*-*"] then {
> +    gdb_test "info float" "f0.*f1.*f31.*fpscr.*" "info float"
>  } elseif [istarget "s390*-*-*"] then {
>      gdb_test "info float" "fpc.*f0.*f1.*f15.*" "info float"
>  } elseif [istarget "sh*-*"] then {

What about PowerPC targets which don't have an FPU?  Hmm, it looks like
GDB more or less assumes the FP is present.  Not sure about SPE though.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

* Re: [RFC] gdb.base/float.exp and gdb.base/commands.exp patch
  2005-03-03  0:27 ` Daniel Jacobowitz
@ 2005-03-03  5:32   ` Manoj Iyer
  2005-03-04 16:20     ` Manoj Iyer
  2005-03-04 16:27     ` Daniel Jacobowitz
  0 siblings, 2 replies; 9+ messages in thread
From: Manoj Iyer @ 2005-03-03  5:32 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> What compiler are you testing with?

I am using GCC (gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4))


> On what line is it reporting that
> it has left the block?  I'd like to understand the difference before we
> change this.

I believe the line number is 82 in my case, and the testcase had 57.

Ok here is the piece of output...

--------------- paste -------------
Continuing.^M
Watchpoint 11: local_var^M
^M
Old value = 0^M
New value = 1^M
factorial (value=1) at ./gdb.base/run.c:81^M
81          return (value);^M
$38 = 1^M
^M
Watchpoint 11 deleted because the program has left the block in^M
which its expression is valid.^M
0x0000000010000604 in factorial (value=511) at ./gdb.base/run.c:82^M
82      }^M
$39 = 511^M
1^M
^M
Program exited normally.^M
(gdb) FAIL: gdb.base/commands.exp: continue with watch
------------- end paste -------------------------

> What about PowerPC targets which don't have an FPU?  Hmm, it looks like
> GDB more or less assumes the FP is present.  Not sure about SPE though.
>

Yes I did think about ppc nofpu system, I believe they are mostly used in
embedded devices, but I could be wrong. So what is the probability of
coming accross one that someone will run this test on? But there should be
a check in the testcase to invalidate the testcase if floating point is
not present.(skip the test for no-fpu)

Also, fileio.exp does some permission checks, ie read/write to a file
which has no read/write permissions, but if you run as root the test will
fail. There should be some mechanism by which the testcases should check
if user id is root, if it is temporarily become another user like "nobody"
or something like that. Couple of tests failed because of this, but I dont
know how to handle this.

--
Manjo


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

* Re: [RFC] gdb.base/float.exp and gdb.base/commands.exp patch
  2005-03-03  5:32   ` Manoj Iyer
@ 2005-03-04 16:20     ` Manoj Iyer
  2005-03-04 16:27     ` Daniel Jacobowitz
  1 sibling, 0 replies; 9+ messages in thread
From: Manoj Iyer @ 2005-03-04 16:20 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches


Daniel,

did u get a chance to reivew this patch?

Thanks
-----
manjo
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Cogito ergo sum                                                          +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

On Wed, 2 Mar 2005, Manoj Iyer wrote:

> > What compiler are you testing with?
>
> I am using GCC (gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4))
>
>
> > On what line is it reporting that
> > it has left the block?  I'd like to understand the difference before we
> > change this.
>
> I believe the line number is 82 in my case, and the testcase had 57.
>
> Ok here is the piece of output...
>
> --------------- paste -------------
> Continuing.^M
> Watchpoint 11: local_var^M
> ^M
> Old value = 0^M
> New value = 1^M
> factorial (value=1) at ./gdb.base/run.c:81^M
> 81          return (value);^M
> $38 = 1^M
> ^M
> Watchpoint 11 deleted because the program has left the block in^M
> which its expression is valid.^M
> 0x0000000010000604 in factorial (value=511) at ./gdb.base/run.c:82^M
> 82      }^M
> $39 = 511^M
> 1^M
> ^M
> Program exited normally.^M
> (gdb) FAIL: gdb.base/commands.exp: continue with watch
> ------------- end paste -------------------------
>
> > What about PowerPC targets which don't have an FPU?  Hmm, it looks like
> > GDB more or less assumes the FP is present.  Not sure about SPE though.
> >
>
> Yes I did think about ppc nofpu system, I believe they are mostly used in
> embedded devices, but I could be wrong. So what is the probability of
> coming accross one that someone will run this test on? But there should be
> a check in the testcase to invalidate the testcase if floating point is
> not present.(skip the test for no-fpu)
>
> Also, fileio.exp does some permission checks, ie read/write to a file
> which has no read/write permissions, but if you run as root the test will
> fail. There should be some mechanism by which the testcases should check
> if user id is root, if it is temporarily become another user like "nobody"
> or something like that. Couple of tests failed because of this, but I dont
> know how to handle this.
>
> --
> Manjo
>


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

* Re: [RFC] gdb.base/float.exp and gdb.base/commands.exp patch
  2005-03-03  5:32   ` Manoj Iyer
  2005-03-04 16:20     ` Manoj Iyer
@ 2005-03-04 16:27     ` Daniel Jacobowitz
  2005-03-07 16:55       ` Manoj Iyer
  1 sibling, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2005-03-04 16:27 UTC (permalink / raw)
  To: Manoj Iyer; +Cc: gdb-patches

On Wed, Mar 02, 2005 at 11:17:15PM -0600, Manoj Iyer wrote:
> > What compiler are you testing with?
> 
> I am using GCC (gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4))
> 
> 
> > On what line is it reporting that
> > it has left the block?  I'd like to understand the difference before we
> > change this.
> 
> I believe the line number is 82 in my case, and the testcase had 57.
> 
> Ok here is the piece of output...
> 
> --------------- paste -------------
> Continuing.^M
> Watchpoint 11: local_var^M
> ^M
> Old value = 0^M
> New value = 1^M
> factorial (value=1) at ./gdb.base/run.c:81^M
> 81          return (value);^M
> $38 = 1^M
> ^M
> Watchpoint 11 deleted because the program has left the block in^M
> which its expression is valid.^M
> 0x0000000010000604 in factorial (value=511) at ./gdb.base/run.c:82^M
> 82      }^M
> $39 = 511^M
> 1^M
> ^M
> Program exited normally.^M
> (gdb) FAIL: gdb.base/commands.exp: continue with watch
> ------------- end paste -------------------------

Accepting any line number is not OK.  Accepting this particular line
number does seem plausible.  Can you do that instead?

> > What about PowerPC targets which don't have an FPU?  Hmm, it looks like
> > GDB more or less assumes the FP is present.  Not sure about SPE though.
> >
> 
> Yes I did think about ppc nofpu system, I believe they are mostly used in
> embedded devices, but I could be wrong. So what is the probability of
> coming accross one that someone will run this test on? But there should be

I've done it in the past.  It's not that hard to get ahold of one. 
But, as I said, I do not know what will be output.

Might as well do this for now and fix it up later.

> Also, fileio.exp does some permission checks, ie read/write to a file
> which has no read/write permissions, but if you run as root the test will
> fail. There should be some mechanism by which the testcases should check
> if user id is root, if it is temporarily become another user like "nobody"
> or something like that. Couple of tests failed because of this, but I dont
> know how to handle this.

Or just don't run the tests as root.  Seems like a good policy anyway.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

* Re: [RFC] gdb.base/float.exp and gdb.base/commands.exp patch
  2005-03-04 16:27     ` Daniel Jacobowitz
@ 2005-03-07 16:55       ` Manoj Iyer
  2005-03-07 16:58         ` Daniel Jacobowitz
  0 siblings, 1 reply; 9+ messages in thread
From: Manoj Iyer @ 2005-03-07 16:55 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

>
> Accepting any line number is not OK.  Accepting this particular line
> number does seem plausible.  Can you do that instead?
>

If I change the current value of 57 to 82, the test will pass in powerpc
but fail on intel. Coz the generated line numbers on intel(57) and
PowerPC(82) are different.

> I've done it in the past.  It's not that hard to get ahold of one.
> But, as I said, I do not know what will be output.
> Might as well do this for now and fix it up later.
>

So, does that mean you accept the patch to float.exp? Or are we still
worried about ppc32 nofpu?


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

* Re: [RFC] gdb.base/float.exp and gdb.base/commands.exp patch
  2005-03-07 16:55       ` Manoj Iyer
@ 2005-03-07 16:58         ` Daniel Jacobowitz
  2005-03-07 19:42           ` Manoj Iyer
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2005-03-07 16:58 UTC (permalink / raw)
  To: Manoj Iyer; +Cc: gdb-patches

On Mon, Mar 07, 2005 at 10:39:32AM -0600, Manoj Iyer wrote:
> >
> > Accepting any line number is not OK.  Accepting this particular line
> > number does seem plausible.  Can you do that instead?
> >
> 
> If I change the current value of 57 to 82, the test will pass in powerpc
> but fail on intel. Coz the generated line numbers on intel(57) and
> PowerPC(82) are different.

That's why you should accept both of them.

> > I've done it in the past.  It's not that hard to get ahold of one.
> > But, as I said, I do not know what will be output.
> > Might as well do this for now and fix it up later.
> >
> 
> So, does that mean you accept the patch to float.exp? Or are we still
> worried about ppc32 nofpu?

I think it's OK.  Please post the patch + changelog for just float.exp,
and check that in.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

* Re: [RFC] gdb.base/float.exp and gdb.base/commands.exp patch
  2005-03-07 16:58         ` Daniel Jacobowitz
@ 2005-03-07 19:42           ` Manoj Iyer
  2005-03-07 19:44             ` Daniel Jacobowitz
  0 siblings, 1 reply; 9+ messages in thread
From: Manoj Iyer @ 2005-03-07 19:42 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> > If I change the current value of 57 to 82, the test will pass in powerpc
> > but fail on intel. Coz the generated line numbers on intel(57) and
> > PowerPC(82) are different.
>
> That's why you should accept both of them.
>


Here is the patch accepting both values.

------------------ patch -----------------------
diff -Naurp ./old/src/gdb/testsuite/gdb.base/commands.exp
./new/src/gdb/testsuite/gdb.base/commands.exp
--- ./old/src/gdb/testsuite/gdb.base/commands.exp       2005-03-07
13:19:16.000000000 -0600
+++ ./new/src/gdb/testsuite/gdb.base/commands.exp       2005-03-07
13:21:49.000000000 -0600
@@ -331,7 +331,7 @@ proc watchpoint_command_test {} {
     }
     send_gdb "continue\n"
     gdb_expect {
-       -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the
program has left the block in.*which its expression is
valid.*run.c:57.*$gdb_prompt $" {
+       -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the
program has left the block in.*which its expression is
valid.*run.c:(57|82).*$gdb_prompt $" {
            pass "continue with watch"
        }
        -re "$gdb_prompt $"   {fail "continue with watch"}
------------------- end patch ----------------------


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

* Re: [RFC] gdb.base/float.exp and gdb.base/commands.exp patch
  2005-03-07 19:42           ` Manoj Iyer
@ 2005-03-07 19:44             ` Daniel Jacobowitz
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Jacobowitz @ 2005-03-07 19:44 UTC (permalink / raw)
  To: Manoj Iyer; +Cc: gdb-patches

On Mon, Mar 07, 2005 at 01:26:29PM -0600, Manoj Iyer wrote:
> > > If I change the current value of 57 to 82, the test will pass in powerpc
> > > but fail on intel. Coz the generated line numbers on intel(57) and
> > > PowerPC(82) are different.
> >
> > That's why you should accept both of them.
> >
> 
> 
> Here is the patch accepting both values.

Yes, that's what I meant.  If you post a full patch including
ChangeLog, I'll approve it.

However, please find a way to include the patch that does not wrap lnes
and mangle whitespace, first.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

end of thread, other threads:[~2005-03-07 19:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-02 23:55 [RFC] gdb.base/float.exp and gdb.base/commands.exp patch Manoj Iyer
2005-03-03  0:27 ` Daniel Jacobowitz
2005-03-03  5:32   ` Manoj Iyer
2005-03-04 16:20     ` Manoj Iyer
2005-03-04 16:27     ` Daniel Jacobowitz
2005-03-07 16:55       ` Manoj Iyer
2005-03-07 16:58         ` Daniel Jacobowitz
2005-03-07 19:42           ` Manoj Iyer
2005-03-07 19:44             ` Daniel Jacobowitz

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