* Re: [PATCH] Make tests more flexible
@ 2003-01-16 4:36 Michael Elizabeth Chastain
0 siblings, 0 replies; 14+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-16 4:36 UTC (permalink / raw)
To: ezannoni, gdb-patches; +Cc: carlton
Aiieee, that explains why my test bed blew up!
cvs checkout gdb HEAD:
date_start="2003-01-15T01:24:53Z"
date_finish="2003-01-15T01:27:55Z"
I'll re-checkout the gdb's, re-build, and re-test (the binutil's and
gcc's will still be from yesterday, it takes me 17 hours to build all
the CVS compilers+binutils that I test).
In about 13 hours I'll know if there are any residual problems in
my configurations, and I'll report them in my usual nit-picky way. :)
Michael C
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] Make tests more flexible
@ 2003-01-16 18:45 Michael Elizabeth Chastain
0 siblings, 0 replies; 14+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-16 18:45 UTC (permalink / raw)
To: ezannoni; +Cc: carlton, gdb-patches
Elena Z asks:
> So, recapping, which one is correct? the old compiler (and the test is
> right) or the new compiler (and the test is wrong)?
Argh, my previous answer was crap. But now I understand.
It will be easy to fix, too.
Here is the source code for advance.c:
int
main ()
{
int result;
int b, c;
c = 5;
b = 3; /* advance this location */
func (c); /* stop here after leaving current frame */
func3 (); /* break here */
result = bar (b + foo (c));
return 0; /* advance malformed */
}
Here is some generated assembly code with gcc 2.95.3:
0x8048462 <main+26>: push %eax
0x8048463 <main+27>: call 0x8048408 <func>
0x8048468 <main+32>: add $0x10,%esp
0x804846b <main+35>: call 0x8048434 <func3>
Here is some generated assembly code with gcc 3.2.1:
0x80483d3 <main+33>: mov %eax,(%esp,1)
0x80483d6 <main+36>: call 0x8048380 <func>
0x80483db <main+41>: call 0x80483a3 <func3>
After the call to 'func', gcc v2 emits an instruction to clean up
the arguments on the stack ('add $0x10,%esp'). gcc v3 does lazy
stack cleanup, it lets stuff stay on the stack for a while and
cleans it up later, saving some instructions.
Here is a log excerpt with gcc 2.95.3:
# target=native, host=i686-pc-linux-gnu, osversion=red-hat-8.0,
# gdb=HEAD%20030115, gcc=2.95.3, binutils=2.13.2.1, libc=vendor,
# gformat=dwarf-2
advance func3^M
0x08048468 in main () at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.base/advance.c:40^M
40 func (c); /* stop here after leaving current frame
*/^M
(gdb) PASS: gdb.base/advance.exp: advance function not called by current frame
gdb hits the return breakpoint, which is on the 'add $0x10,%esp'
instruction, still in the middle of line 40.
And here is a log excerpt from gcc 3.2.1:
# target=native, host=i686-pc-linux-gnu, osversion=red-hat-8.0,
# gdb=HEAD%20030115, gcc=3.2.1, binutils=2.13.2.1, libc=vendor,
# gformat=dwarf-2
advance func3^M
main () at /berman/fsf/_today_/source/gdb/HEAD/src/gdb/testsuite/gdb.base/advance.c:41^M
41 func3 (); /* break here */^M
(gdb) FAIL: gdb.base/advance.exp: advance function not called by current frame
gdb hits the return breakpoint, which is the first instruction of line 41.
So gdb is doing the right thing, but the test script is too strict.
gdb might stop on either line 40 or line 41, depending on how the
function call in line 40 gets compiled: whether the 'call' instruction
is the last machine instruction for line 40 or not.
In general we can't say anything about whether the 'call' instruction
will be the last machine instruction for a C function call, so we
can't predict whether the return breakpoint will be an instruction
in line 40 or the first instruction of line 41. The test script has
to acommodate both forms.
Michael C
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] Make tests more flexible
@ 2003-01-16 18:07 Michael Elizabeth Chastain
0 siblings, 0 replies; 14+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-16 18:07 UTC (permalink / raw)
To: ezannoni; +Cc: carlton, gdb-patches
I read the tests and I think that the tests are written correctly.
So I think that either gcc is wrong, or gdb is wrong.
Michael C
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Make tests more flexible
@ 2003-01-16 17:35 Michael Elizabeth Chastain
2003-01-16 17:53 ` Elena Zannoni
0 siblings, 1 reply; 14+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-16 17:35 UTC (permalink / raw)
To: carlton, ezannoni; +Cc: gdb-patches
Ah, okay, my head is spinning with all the mail flying around.
David C's log files are the same as my log files.
It looks like one bug in both advance.exp and until.exp.
For me:
It happened the same way for both dwarf-2 and stabs+.
It happened the same way with all binutils.
It happened with gcc => 3.2.1, gcc-3_2-branch, gcc-3_3-branch, HEAD.
It did NOT happen with gcc => 2.95.3, vendor.
So I think there is only one bug here I think Elena Z can reproduce it
by using a gcc v3 compiler with any debug format.
Michael C
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Make tests more flexible
2003-01-16 17:35 Michael Elizabeth Chastain
@ 2003-01-16 17:53 ` Elena Zannoni
0 siblings, 0 replies; 14+ messages in thread
From: Elena Zannoni @ 2003-01-16 17:53 UTC (permalink / raw)
To: Michael Elizabeth Chastain; +Cc: carlton, ezannoni, gdb-patches
Michael Elizabeth Chastain writes:
> Ah, okay, my head is spinning with all the mail flying around.
>
> David C's log files are the same as my log files.
> It looks like one bug in both advance.exp and until.exp.
> For me:
> It happened the same way for both dwarf-2 and stabs+.
> It happened the same way with all binutils.
> It happened with gcc => 3.2.1, gcc-3_2-branch, gcc-3_3-branch, HEAD.
> It did NOT happen with gcc => 2.95.3, vendor.
>
> So I think there is only one bug here I think Elena Z can reproduce it
> by using a gcc v3 compiler with any debug format.
>
> Michael C
Ah ok, I am using gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-108.7.2).
So, recapping, which one is correct? the old compiler (and the test is
right) or the new compiler (and the test is wrong)?
Elena
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Make tests more flexible
@ 2003-01-16 17:27 Michael Elizabeth Chastain
0 siblings, 0 replies; 14+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-16 17:27 UTC (permalink / raw)
To: ezannoni, gdb-patches, mec; +Cc: carlton
Hi Elena,
My testbed is happy now, there are no residual problems after your
fixes last night.
There is a new bug with 'advance/until', in the case where the user
'advances' or 'untils' to a function that is not called from the
current frame. With gcc 3.*, gdb runs all the way to the specified
function, and does not hit the breakpoint on the return location
in the caller. I'll file a bug report shortly with gory details.
David C can probably see it right now with gcc 3.1.
Michael C
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Make tests more flexible
@ 2003-01-16 17:24 Michael Elizabeth Chastain
0 siblings, 0 replies; 14+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-16 17:24 UTC (permalink / raw)
To: ezannoni, fnasser; +Cc: carlton, gdb-patches
For what it's worth, I think my testbed is agnostic about this issue.
So whatever works for David C is okay by me.
When I test, I do something like this (but in Perl not sh):
# make a new temporary directory
rm -rf test
mkdir test
cd test
# copy the pristine build directory
cp -a $dir_gdb_build/testsuite/* .
# run the tests
runtest --objdir ... --outdir ... --srcdir ...
Michael C
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH] Make tests more flexible
@ 2003-01-16 2:05 Elena Zannoni
2003-01-16 4:50 ` David Carlton
2003-01-16 14:40 ` Fernando Nasser
0 siblings, 2 replies; 14+ messages in thread
From: Elena Zannoni @ 2003-01-16 2:05 UTC (permalink / raw)
To: gdb-patches; +Cc: carlton
David, try this, if it works for you I'll check it in as obvious.
Elena
2003-01-15 Elena Zannoni <ezannoni@redhat.com>
* gdb.base/until.exp: Set variable 'srcfile' differently, to allow
for different test tree configurations.
Update some tescases accordingly.
* gdb.base/advance.exp: Ditto.
Index: advance.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/advance.exp,v
retrieving revision 1.1
diff -u -p -r1.1 advance.exp
--- advance.exp 15 Jan 2003 14:25:11 -0000 1.1
+++ advance.exp 16 Jan 2003 02:02:23 -0000
@@ -24,11 +24,11 @@ if $tracelevel then {
}
set testfile advance
-set srcfile ${srcdir}/${subdir}/${testfile}.c
+set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
remote_exec build "rm -f ${binfile}"
-if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
Index: until.exp
===================================================================
RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/until.exp,v
retrieving revision 1.1
diff -u -p -r1.1 until.exp
--- until.exp 15 Jan 2003 14:25:10 -0000 1.1
+++ until.exp 16 Jan 2003 02:04:54 -0000
@@ -24,11 +24,11 @@ if $tracelevel then {
}
set testfile break
-set srcfile ${srcdir}/${subdir}/${testfile}.c
+set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
remote_exec build "rm -f ${binfile}"
-if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
@@ -63,7 +63,7 @@ delete_breakpoints
# frame.
#
gdb_test "until 99" \
- "factorial.*value=720.*at ${srcfile}:99.*return \\(value\\)." \
+ "factorial.*value=720.*at.*${srcfile}:99.*return \\(value\\)." \
"until factorial, recursive function"
# Run to a function called by main
@@ -76,6 +76,6 @@ delete_breakpoints
# stop at main, the caller, where we put the 'guard' breakpoint.
#
gdb_test "until marker3" \
- "$hex in main.*argc.*argv.*envp.*at ${srcfile}:82.*marker2 \\(43\\)." \
+ "$hex in main.*argc.*argv.*envp.*at.*${srcfile}:82.*marker2 \\(43\\)." \
"until func, not called by current frame"
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] Make tests more flexible
2003-01-16 2:05 Elena Zannoni
@ 2003-01-16 4:50 ` David Carlton
2003-01-16 17:19 ` Elena Zannoni
2003-01-16 14:40 ` Fernando Nasser
1 sibling, 1 reply; 14+ messages in thread
From: David Carlton @ 2003-01-16 4:50 UTC (permalink / raw)
To: Elena Zannoni; +Cc: gdb-patches
On Wed, 15 Jan 2003 21:10:04 -0500, Elena Zannoni <ezannoni@redhat.com> said:
> David, try this, if it works for you I'll check it in as obvious.
It gets rid of some of them, but not all of them:
Running ./gdb.base/until.exp ...
FAIL: gdb.base/until.exp: until func, not called by current frame
Running ./gdb.base/advance.exp ...
FAIL: gdb.base/advance.exp: advance function not called by current frame
FAIL: gdb.base/advance.exp: continue to call to func3 in main
FAIL: gdb.base/advance.exp: advance function called as param
FAIL: gdb.base/advance.exp: advance with no argument
Log attached.
David Carlton
carlton@math.stanford.edu
Test Run By carlton on Wed Jan 15 20:46:59 2003
Native configuration is i686-pc-linux-gnu
=== gdb tests ===
Schedule of variations:
unix
Running target unix
Using /usr/local/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/local/share/dejagnu/config/unix.exp as generic interface file for target.
Using ./config/unix.exp as tool-and-target-specific interface file.
Running ./gdb.base/until.exp ...
Executing on build: rm -f /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break (timeout = 300)
spawn rm -f /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break
Executing on host: gcc ./gdb.base/break.c -g -lm -o /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break (timeout = 300)
spawn gcc ./gdb.base/break.c -g -lm -o /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break
spawn /extra/gdb/mirror/src/gdb/testsuite/../../gdb/gdb -nw -nx
GNU gdb 2003-01-15-cvs
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir ./gdb.base
Source directories searched: /extra/gdb/mirror/src/gdb/testsuite/./gdb.base:$cdir:$cwd
(gdb) file /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break
Reading symbols from /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break...done.
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x8048520: file gdb.base/break.c, line 75.
(gdb) run
Starting program: /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break
Breakpoint 1, main (argc=1, argv=0xbffff804, envp=0xbffff80c) at gdb.base/break.c:75
75 if (argc == 12345) { /* an unlikely value < 2^16, in case uninited */
(gdb) until 79
main (argc=1, argv=0xbffff804, envp=0xbffff80c) at gdb.base/break.c:79
79 printf ("%d\n", factorial (atoi ("6")));
(gdb) PASS: gdb.base/until.exp: until line number
until 80 then stop
Junk at end of arguments.
(gdb) PASS: gdb.base/until.exp: malformed until
delete breakpoints
Delete all breakpoints? (y or n) y
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break factorial
Breakpoint 2 at 0x80485be: file gdb.base/break.c, line 96.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break
Breakpoint 2, factorial (value=6) at gdb.base/break.c:96
96 if (value > 1) {
(gdb) delete breakpoints
Delete all breakpoints? (y or n) y
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) until 99
factorial (value=720) at gdb.base/break.c:99
99 return (value);
(gdb) PASS: gdb.base/until.exp: until factorial, recursive function
delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break marker2
Breakpoint 3 at 0x80484fd: file gdb.base/break.c, line 49.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break
720
Breakpoint 3, 0x080484fd in marker2 (a=43) at gdb.base/break.c:49
49 int marker2 (a) int a; { return (1); }
(gdb) delete breakpoints
Delete all breakpoints? (y or n) y
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) until marker3
main (argc=1, argv=0xbffff804, envp=0xbffff80c) at gdb.base/break.c:83
83 marker3 ("stack", "trace");
(gdb) FAIL: gdb.base/until.exp: until func, not called by current frame
testcase ./gdb.base/until.exp completed in 1 seconds
Running ./gdb.base/advance.exp ...
Executing on build: rm -f /extra/gdb/mirror/src/gdb/testsuite/gdb.base/advance (timeout = 300)
spawn rm -f /extra/gdb/mirror/src/gdb/testsuite/gdb.base/advance
Executing on host: gcc ./gdb.base/advance.c -g -lm -o /extra/gdb/mirror/src/gdb/testsuite/gdb.base/advance (timeout = 300)
spawn gcc ./gdb.base/advance.c -g -lm -o /extra/gdb/mirror/src/gdb/testsuite/gdb.base/advance
spawn /extra/gdb/mirror/src/gdb/testsuite/../../gdb/gdb -nw -nx
GNU gdb 2003-01-15-cvs
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir ./gdb.base
Source directories searched: /extra/gdb/mirror/src/gdb/testsuite/./gdb.base:$cdir:$cwd
(gdb) file /extra/gdb/mirror/src/gdb/testsuite/gdb.base/advance
Reading symbols from /extra/gdb/mirror/src/gdb/testsuite/gdb.base/advance...done.
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x804849c: file gdb.base/advance.c, line 37.
(gdb) run
Starting program: /extra/gdb/mirror/src/gdb/testsuite/gdb.base/advance
Breakpoint 1, main () at gdb.base/advance.c:37
37 c = 5;
(gdb) list advance.c:1,1
1
(gdb) search advance this location
38 b = 3; /* advance this location */
(gdb) advance 38
main () at gdb.base/advance.c:38
38 b = 3; /* advance this location */
(gdb) PASS: gdb.base/advance.exp: advance line number
list advance.c:1,1
1
(gdb) search advance malformed
43 return 0; /* advance malformed */
(gdb) advance 43 then stop
Junk at end of arguments.
(gdb) PASS: gdb.base/advance.exp: malformed advance
advance func
func () at gdb.base/advance.c:18
18 x = x + 5;
(gdb) PASS: gdb.base/advance.exp: advance func
advance func3
main () at gdb.base/advance.c:41
41 func3 (); /* break here */
(gdb) FAIL: gdb.base/advance.exp: advance function not called by current frame
list advance.c:1,1
1
(gdb) search break here
41 func3 (); /* break here */
(gdb) break 41
Breakpoint 2 at 0x80484b5: file gdb.base/advance.c, line 41.
(gdb) PASS: gdb.base/advance.exp: set breakpoint at call to func3
continue
Continuing.
Program exited normally.
(gdb) FAIL: gdb.base/advance.exp: continue to call to func3 in main
advance foo
The program is not running.
(gdb) FAIL: gdb.base/advance.exp: advance function called as param
advance
The program is not running.
(gdb) FAIL: gdb.base/advance.exp: advance with no argument
testcase ./gdb.base/advance.exp completed in 1 seconds
=== gdb Summary ===
# of expected passes 7
# of unexpected failures 5
Executing on host: /extra/gdb/mirror/src/gdb/testsuite/../../gdb/gdb -nw --command gdb_cmd (timeout = 300)
spawn /extra/gdb/mirror/src/gdb/testsuite/../../gdb/gdb -nw --command gdb_cmd
GNU gdb 2003-01-15-cvs
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
/extra/gdb/mirror/src/gdb/testsuite/../../gdb/gdb version 2003-01-15-cvs -nx
runtest completed at Wed Jan 15 20:47:02 2003
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] Make tests more flexible
2003-01-16 4:50 ` David Carlton
@ 2003-01-16 17:19 ` Elena Zannoni
0 siblings, 0 replies; 14+ messages in thread
From: Elena Zannoni @ 2003-01-16 17:19 UTC (permalink / raw)
To: David Carlton; +Cc: Elena Zannoni, gdb-patches
David Carlton writes:
> On Wed, 15 Jan 2003 21:10:04 -0500, Elena Zannoni <ezannoni@redhat.com> said:
>
> > David, try this, if it works for you I'll check it in as obvious.
>
> It gets rid of some of them, but not all of them:
Ok, I'll check that in. See below...
>
> Running ./gdb.base/until.exp ...
> FAIL: gdb.base/until.exp: until func, not called by current frame
> Running ./gdb.base/advance.exp ...
> FAIL: gdb.base/advance.exp: advance function not called by current frame
> FAIL: gdb.base/advance.exp: continue to call to func3 in main
> FAIL: gdb.base/advance.exp: advance function called as param
> FAIL: gdb.base/advance.exp: advance with no argument
>
> Log attached.
>
> David Carlton
> carlton@math.stanford.edu
>
>
> Test Run By carlton on Wed Jan 15 20:46:59 2003
> Native configuration is i686-pc-linux-gnu
>
> === gdb tests ===
>
> Schedule of variations:
> unix
>
> Running target unix
> Using /usr/local/share/dejagnu/baseboards/unix.exp as board description file for target.
> Using /usr/local/share/dejagnu/config/unix.exp as generic interface file for target.
> Using ./config/unix.exp as tool-and-target-specific interface file.
> Running ./gdb.base/until.exp ...
> Executing on build: rm -f /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break (timeout = 300)
> spawn rm -f /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break
> Executing on host: gcc ./gdb.base/break.c -g -lm -o /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break (timeout = 300)
> spawn gcc ./gdb.base/break.c -g -lm -o /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break
> spawn /extra/gdb/mirror/src/gdb/testsuite/../../gdb/gdb -nw -nx
> GNU gdb 2003-01-15-cvs
> Copyright 2003 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "i686-pc-linux-gnu".
> (gdb) set height 0
> (gdb) set width 0
> (gdb) dir
> Reinitialize source path to empty? (y or n) y
> Source directories searched: $cdir:$cwd
> (gdb) dir ./gdb.base
> Source directories searched: /extra/gdb/mirror/src/gdb/testsuite/./gdb.base:$cdir:$cwd
> (gdb) file /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break
> Reading symbols from /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break...done.
> (gdb) delete breakpoints
> (gdb) info breakpoints
> No breakpoints or watchpoints.
> (gdb) break main
> Breakpoint 1 at 0x8048520: file gdb.base/break.c, line 75.
> (gdb) run
> Starting program: /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break
>
> Breakpoint 1, main (argc=1, argv=0xbffff804, envp=0xbffff80c) at gdb.base/break.c:75
> 75 if (argc == 12345) { /* an unlikely value < 2^16, in case uninited */
> (gdb) until 79
> main (argc=1, argv=0xbffff804, envp=0xbffff80c) at gdb.base/break.c:79
> 79 printf ("%d\n", factorial (atoi ("6")));
> (gdb) PASS: gdb.base/until.exp: until line number
> until 80 then stop
> Junk at end of arguments.
> (gdb) PASS: gdb.base/until.exp: malformed until
> delete breakpoints
> Delete all breakpoints? (y or n) y
> (gdb) info breakpoints
> No breakpoints or watchpoints.
> (gdb) break factorial
> Breakpoint 2 at 0x80485be: file gdb.base/break.c, line 96.
> (gdb) run
> The program being debugged has been started already.
> Start it from the beginning? (y or n) y
> Starting program: /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break
>
> Breakpoint 2, factorial (value=6) at gdb.base/break.c:96
> 96 if (value > 1) {
> (gdb) delete breakpoints
> Delete all breakpoints? (y or n) y
> (gdb) info breakpoints
> No breakpoints or watchpoints.
> (gdb) until 99
> factorial (value=720) at gdb.base/break.c:99
> 99 return (value);
> (gdb) PASS: gdb.base/until.exp: until factorial, recursive function
> delete breakpoints
> (gdb) info breakpoints
> No breakpoints or watchpoints.
> (gdb) break marker2
> Breakpoint 3 at 0x80484fd: file gdb.base/break.c, line 49.
> (gdb) run
> The program being debugged has been started already.
> Start it from the beginning? (y or n) y
> Starting program: /extra/gdb/mirror/src/gdb/testsuite/gdb.base/break
> 720
>
> Breakpoint 3, 0x080484fd in marker2 (a=43) at gdb.base/break.c:49
> 49 int marker2 (a) int a; { return (1); }
> (gdb) delete breakpoints
> Delete all breakpoints? (y or n) y
> (gdb) info breakpoints
> No breakpoints or watchpoints.
> (gdb) until marker3
> main (argc=1, argv=0xbffff804, envp=0xbffff80c) at gdb.base/break.c:83
> 83 marker3 ("stack", "trace");
> (gdb) FAIL: gdb.base/until.exp: until func, not called by current frame
Ah, this one could be a legitimate failure. I get this:
(gdb) until marker3
0x08048593 in main (argc=1, argv=0xbfffedf4, envp=0xbfffedfc) at /home/ezannoni/sources/src/gdb/testsuite/gdb.base/break.c:82
82 marker2 (43);
> testcase ./gdb.base/until.exp completed in 1 seconds
> Running ./gdb.base/advance.exp ...
> Executing on build: rm -f /extra/gdb/mirror/src/gdb/testsuite/gdb.base/advance (timeout = 300)
> spawn rm -f /extra/gdb/mirror/src/gdb/testsuite/gdb.base/advance
> Executing on host: gcc ./gdb.base/advance.c -g -lm -o /extra/gdb/mirror/src/gdb/testsuite/gdb.base/advance (timeout = 300)
> spawn gcc ./gdb.base/advance.c -g -lm -o /extra/gdb/mirror/src/gdb/testsuite/gdb.base/advance
> spawn /extra/gdb/mirror/src/gdb/testsuite/../../gdb/gdb -nw -nx
> GNU gdb 2003-01-15-cvs
> Copyright 2003 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "i686-pc-linux-gnu".
> (gdb) set height 0
> (gdb) set width 0
> (gdb) dir
> Reinitialize source path to empty? (y or n) y
> Source directories searched: $cdir:$cwd
> (gdb) dir ./gdb.base
> Source directories searched: /extra/gdb/mirror/src/gdb/testsuite/./gdb.base:$cdir:$cwd
> (gdb) file /extra/gdb/mirror/src/gdb/testsuite/gdb.base/advance
> Reading symbols from /extra/gdb/mirror/src/gdb/testsuite/gdb.base/advance...done.
> (gdb) delete breakpoints
> (gdb) info breakpoints
> No breakpoints or watchpoints.
> (gdb) break main
> Breakpoint 1 at 0x804849c: file gdb.base/advance.c, line 37.
> (gdb) run
> Starting program: /extra/gdb/mirror/src/gdb/testsuite/gdb.base/advance
>
> Breakpoint 1, main () at gdb.base/advance.c:37
> 37 c = 5;
> (gdb) list advance.c:1,1
> 1
> (gdb) search advance this location
> 38 b = 3; /* advance this location */
> (gdb) advance 38
> main () at gdb.base/advance.c:38
> 38 b = 3; /* advance this location */
> (gdb) PASS: gdb.base/advance.exp: advance line number
> list advance.c:1,1
> 1
> (gdb) search advance malformed
> 43 return 0; /* advance malformed */
> (gdb) advance 43 then stop
> Junk at end of arguments.
> (gdb) PASS: gdb.base/advance.exp: malformed advance
> advance func
> func () at gdb.base/advance.c:18
> 18 x = x + 5;
> (gdb) PASS: gdb.base/advance.exp: advance func
> advance func3
> main () at gdb.base/advance.c:41
> 41 func3 (); /* break here */
> (gdb) FAIL: gdb.base/advance.exp: advance function not called by current frame
This one could be the same problem as above. Seems like the temporary
breakpoint to catch the exit from the frame is set in different
locations. Which could be a symbol table problem.
advance func3
0x080484b3 in main () at /home/ezannoni/sources/src/gdb/testsuite/gdb.base/advance.c:40
40 func (c); /* stop here after leaving current frame */
(gdb) PASS: gdb.base/advance.exp: advance function not called by current frame
> list advance.c:1,1
> 1
> (gdb) search break here
> 41 func3 (); /* break here */
> (gdb) break 41
> Breakpoint 2 at 0x80484b5: file gdb.base/advance.c, line 41.
> (gdb) PASS: gdb.base/advance.exp: set breakpoint at call to func3
> continue
> Continuing.
>
> Program exited normally.
This is not good. The program should stop at line 41.
I get this:
(gdb) break 41
Breakpoint 2 at 0x80484b6: file /home/ezannoni/sources/src/gdb/testsuite/gdb.base/advance.c, line 41.
(gdb) PASS: gdb.base/advance.exp: set breakpoint at call to func3
continue
Continuing.
Breakpoint 2, main () at /home/ezannoni/sources/src/gdb/testsuite/gdb.base/advance.c:41
41 func3 (); /* break here */
(gdb) PASS: gdb.base/advance.exp: continue to call to func3 in main
Note the odd/even address of the breakpoint.
> (gdb) FAIL: gdb.base/advance.exp: continue to call to func3 in main
> advance foo
> The program is not running.
> (gdb) FAIL: gdb.base/advance.exp: advance function called as param
> advance
> The program is not running.
> (gdb) FAIL: gdb.base/advance.exp: advance with no argument
> testcase ./gdb.base/advance.exp completed in 1 seconds
>
Cascade failures from the previous failure.
Hmmm, I am on an older system that uses stabs, I wonder if you are using
dwarf2.
Elena
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Make tests more flexible
2003-01-16 2:05 Elena Zannoni
2003-01-16 4:50 ` David Carlton
@ 2003-01-16 14:40 ` Fernando Nasser
2003-01-16 16:40 ` Elena Zannoni
2003-01-16 17:10 ` David Carlton
1 sibling, 2 replies; 14+ messages in thread
From: Fernando Nasser @ 2003-01-16 14:40 UTC (permalink / raw)
To: Elena Zannoni; +Cc: gdb-patches, carlton
Yes, this is the right way of doing it.
I missed it when reviewing the patch. I guess I just assumed that this section
is more or less cut-and-paste from the other files.
Which brings up the question: where did you copy it from? I see a few other
files with the
set srcfile ${srcdir}/${subdir}/${testfile}.c
line. They should be breaking runs with "different test tree configurations" as
well.
display.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
long_long.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
mips_pro.exp:set srcfile ${srcdir}/$subdir/${testfile}.c
overlays.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
relocate.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
setshow.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
step-line.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
step-test.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
Should we make the same change to those?
Regards,
Fernando
Elena Zannoni wrote:> David, try this, if it works for you I'll check it in as
obvious.
>
> Elena
>
>
> 2003-01-15 Elena Zannoni <ezannoni@redhat.com>
>
> * gdb.base/until.exp: Set variable 'srcfile' differently, to allow
> for different test tree configurations.
> Update some tescases accordingly.
> * gdb.base/advance.exp: Ditto.
>
> Index: advance.exp
> ===================================================================
> RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/advance.exp,v
> retrieving revision 1.1
> diff -u -p -r1.1 advance.exp
> --- advance.exp 15 Jan 2003 14:25:11 -0000 1.1
> +++ advance.exp 16 Jan 2003 02:02:23 -0000
> @@ -24,11 +24,11 @@ if $tracelevel then {
> }
>
> set testfile advance
> -set srcfile ${srcdir}/${subdir}/${testfile}.c
> +set srcfile ${testfile}.c
> set binfile ${objdir}/${subdir}/${testfile}
>
> remote_exec build "rm -f ${binfile}"
> -if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
> +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
> gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
> }
>
>
> Index: until.exp
> ===================================================================
> RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/until.exp,v
> retrieving revision 1.1
> diff -u -p -r1.1 until.exp
> --- until.exp 15 Jan 2003 14:25:10 -0000 1.1
> +++ until.exp 16 Jan 2003 02:04:54 -0000
> @@ -24,11 +24,11 @@ if $tracelevel then {
> }
>
> set testfile break
> -set srcfile ${srcdir}/${subdir}/${testfile}.c
> +set srcfile ${testfile}.c
> set binfile ${objdir}/${subdir}/${testfile}
>
> remote_exec build "rm -f ${binfile}"
> -if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
> +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
> gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
> }
>
> @@ -63,7 +63,7 @@ delete_breakpoints
> # frame.
> #
> gdb_test "until 99" \
> - "factorial.*value=720.*at ${srcfile}:99.*return \\(value\\)." \
> + "factorial.*value=720.*at.*${srcfile}:99.*return \\(value\\)." \
> "until factorial, recursive function"
>
> # Run to a function called by main
> @@ -76,6 +76,6 @@ delete_breakpoints
> # stop at main, the caller, where we put the 'guard' breakpoint.
> #
> gdb_test "until marker3" \
> - "$hex in main.*argc.*argv.*envp.*at ${srcfile}:82.*marker2 \\(43\\)." \
> + "$hex in main.*argc.*argv.*envp.*at.*${srcfile}:82.*marker2 \\(43\\)." \
> "until func, not called by current frame"
>
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] Make tests more flexible
2003-01-16 14:40 ` Fernando Nasser
@ 2003-01-16 16:40 ` Elena Zannoni
2003-01-16 17:10 ` David Carlton
1 sibling, 0 replies; 14+ messages in thread
From: Elena Zannoni @ 2003-01-16 16:40 UTC (permalink / raw)
To: Fernando Nasser; +Cc: Elena Zannoni, gdb-patches, carlton
Fernando Nasser writes:
> Yes, this is the right way of doing it.
>
> I missed it when reviewing the patch. I guess I just assumed that this section
> is more or less cut-and-paste from the other files.
Indeed, I did. But I picked the wrong file...
>
> Which brings up the question: where did you copy it from? I see a few other
Some of the below, now I don't remember.
> files with the
>
> set srcfile ${srcdir}/${subdir}/${testfile}.c
>
> line. They should be breaking runs with "different test tree configurations" as
> well.
>
Yeah, I noticed this last night. I don't know if these too create odd
results for David. I think David is configuring and building gdb in
the same tree. I am not sure that this is guaranteed to work,
testsuite-wise.
> display.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> long_long.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> mips_pro.exp:set srcfile ${srcdir}/$subdir/${testfile}.c
> overlays.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> relocate.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> setshow.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> step-line.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> step-test.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
>
>
> Should we make the same change to those?
I am tempted to say yes, but first I would like to understand David's
problems a bit better.
Elena
>
> Regards,
> Fernando
>
>
> Elena Zannoni wrote:> David, try this, if it works for you I'll check it in as
> obvious.
> >
> > Elena
> >
> >
> > 2003-01-15 Elena Zannoni <ezannoni@redhat.com>
> >
> > * gdb.base/until.exp: Set variable 'srcfile' differently, to allow
> > for different test tree configurations.
> > Update some tescases accordingly.
> > * gdb.base/advance.exp: Ditto.
> >
> > Index: advance.exp
> > ===================================================================
> > RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/advance.exp,v
> > retrieving revision 1.1
> > diff -u -p -r1.1 advance.exp
> > --- advance.exp 15 Jan 2003 14:25:11 -0000 1.1
> > +++ advance.exp 16 Jan 2003 02:02:23 -0000
> > @@ -24,11 +24,11 @@ if $tracelevel then {
> > }
> >
> > set testfile advance
> > -set srcfile ${srcdir}/${subdir}/${testfile}.c
> > +set srcfile ${testfile}.c
> > set binfile ${objdir}/${subdir}/${testfile}
> >
> > remote_exec build "rm -f ${binfile}"
> > -if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
> > +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
> > gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
> > }
> >
> >
> > Index: until.exp
> > ===================================================================
> > RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/until.exp,v
> > retrieving revision 1.1
> > diff -u -p -r1.1 until.exp
> > --- until.exp 15 Jan 2003 14:25:10 -0000 1.1
> > +++ until.exp 16 Jan 2003 02:04:54 -0000
> > @@ -24,11 +24,11 @@ if $tracelevel then {
> > }
> >
> > set testfile break
> > -set srcfile ${srcdir}/${subdir}/${testfile}.c
> > +set srcfile ${testfile}.c
> > set binfile ${objdir}/${subdir}/${testfile}
> >
> > remote_exec build "rm -f ${binfile}"
> > -if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
> > +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
> > gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
> > }
> >
> > @@ -63,7 +63,7 @@ delete_breakpoints
> > # frame.
> > #
> > gdb_test "until 99" \
> > - "factorial.*value=720.*at ${srcfile}:99.*return \\(value\\)." \
> > + "factorial.*value=720.*at.*${srcfile}:99.*return \\(value\\)." \
> > "until factorial, recursive function"
> >
> > # Run to a function called by main
> > @@ -76,6 +76,6 @@ delete_breakpoints
> > # stop at main, the caller, where we put the 'guard' breakpoint.
> > #
> > gdb_test "until marker3" \
> > - "$hex in main.*argc.*argv.*envp.*at ${srcfile}:82.*marker2 \\(43\\)." \
> > + "$hex in main.*argc.*argv.*envp.*at.*${srcfile}:82.*marker2 \\(43\\)." \
> > "until func, not called by current frame"
> >
>
>
>
> --
> Fernando Nasser
> Red Hat - Toronto E-Mail: fnasser@redhat.com
> 2323 Yonge Street, Suite #300
> Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] Make tests more flexible
2003-01-16 14:40 ` Fernando Nasser
2003-01-16 16:40 ` Elena Zannoni
@ 2003-01-16 17:10 ` David Carlton
2003-01-16 17:27 ` Elena Zannoni
1 sibling, 1 reply; 14+ messages in thread
From: David Carlton @ 2003-01-16 17:10 UTC (permalink / raw)
To: Fernando Nasser; +Cc: Elena Zannoni, gdb-patches
On Thu, 16 Jan 2003 09:40:14 -0500, Fernando Nasser <fnasser@redhat.com> said:
> I see a few other files with the
> set srcfile ${srcdir}/${subdir}/${testfile}.c
> line. They should be breaking runs with "different test tree
> configurations" as well.
> display.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> long_long.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> mips_pro.exp:set srcfile ${srcdir}/$subdir/${testfile}.c
> overlays.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> relocate.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> setshow.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> step-line.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> step-test.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
For what it's worth, all those files pass for me. But that doesn't
mean much; they might not use srcfile in ways that trigger this
particular bug, and one of them (overlays.exp) doesn't actually do
anything on my platform. So we might as well convert them all to use
the proper definition of srcfile, it seems to me.
David Carlton
carlton@math.stanford.edu
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH] Make tests more flexible
2003-01-16 17:10 ` David Carlton
@ 2003-01-16 17:27 ` Elena Zannoni
0 siblings, 0 replies; 14+ messages in thread
From: Elena Zannoni @ 2003-01-16 17:27 UTC (permalink / raw)
To: David Carlton; +Cc: Fernando Nasser, Elena Zannoni, gdb-patches
David Carlton writes:
> On Thu, 16 Jan 2003 09:40:14 -0500, Fernando Nasser <fnasser@redhat.com> said:
>
> > I see a few other files with the
>
> > set srcfile ${srcdir}/${subdir}/${testfile}.c
>
> > line. They should be breaking runs with "different test tree
> > configurations" as well.
>
> > display.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> > long_long.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> > mips_pro.exp:set srcfile ${srcdir}/$subdir/${testfile}.c
> > overlays.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> > relocate.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> > setshow.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> > step-line.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
> > step-test.exp:set srcfile ${srcdir}/${subdir}/${testfile}.c
>
> For what it's worth, all those files pass for me. But that doesn't
> mean much; they might not use srcfile in ways that trigger this
> particular bug, and one of them (overlays.exp) doesn't actually do
> anything on my platform. So we might as well convert them all to use
> the proper definition of srcfile, it seems to me.
>
I just checked this, and all those files don't use the variable
srcfile except for the compilation line,
if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" }
the problem that David uncovered was with the matching of ${srcfile}
in the output of a command, like for a breakpoint hit. By defining
srcfile to be the long path name, instead of just the source fle name,
it was trying to match the wrong string when src==build tree.
Ok, so I am OK with changing all the above to be just
set srcfile ${testfile}.c
and
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" }
I'll send a patch in a bit.
Elena
> David Carlton
> carlton@math.stanford.edu
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2003-01-16 18:45 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-16 4:36 [PATCH] Make tests more flexible Michael Elizabeth Chastain
-- strict thread matches above, loose matches on Subject: below --
2003-01-16 18:45 Michael Elizabeth Chastain
2003-01-16 18:07 Michael Elizabeth Chastain
2003-01-16 17:35 Michael Elizabeth Chastain
2003-01-16 17:53 ` Elena Zannoni
2003-01-16 17:27 Michael Elizabeth Chastain
2003-01-16 17:24 Michael Elizabeth Chastain
2003-01-16 2:05 Elena Zannoni
2003-01-16 4:50 ` David Carlton
2003-01-16 17:19 ` Elena Zannoni
2003-01-16 14:40 ` Fernando Nasser
2003-01-16 16:40 ` Elena Zannoni
2003-01-16 17:10 ` David Carlton
2003-01-16 17:27 ` Elena Zannoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox