public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* testsuite question.
@ 2005-06-22 16:53 Manoj Iyer
  0 siblings, 0 replies; 4+ messages in thread
From: Manoj Iyer @ 2005-06-22 16:53 UTC (permalink / raw)
  To: gdb


I am looking at filling the TODO's in the testsuite, for example,

./gdb.base/code-expr.exp:# Arrays TODO
./gdb.base/code-expr.exp:# Pointers to arrays, arrays of pointers TODO
./gdb.base/code-expr.exp:# Function pointers TODO
./gdb.base/cvexpr.exp:# Arrays TODO
./gdb.base/cvexpr.exp:# Pointers to arrays, arrays of pointers TODO
./gdb.base/cvexpr.exp:# Function pointers TODO
./gdb.arch/i386-prologue.exp:# TODO: detect this automatically
./gdb.arch/i386-unwind.exp:# TODO: detect this automatically


My question is what is the reason why this test is a TODO, is this because
gdb reports differently on different operating systems? or it was simply
not done due to lack of time?

Thanks for your input in advance
-----
manjo
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Cogito ergo sum                                                          +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

* Re: Testsuite question...
  2007-12-05 16:07 ` Daniel Jacobowitz
@ 2007-12-05 16:54   ` Robin Getz
  0 siblings, 0 replies; 4+ messages in thread
From: Robin Getz @ 2007-12-05 16:54 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

On Wed 5 Dec 2007 11:07, Daniel Jacobowitz pondered:
> On Wed, Dec 05, 2007 at 10:59:37AM -0500, Robin Getz wrote:
> > proc test_breakpoints { } {
> >     gdb_test "stop in main" "Breakpoint.*at.*: file.*average\.c, line 38\."
> >     gdb_test "status" "Num.*Type.*Disp.*Enb.*Address.*What\r\n1\[\r\]+breakpoint\[ \r\]+keep y.*in main at.*average\.c:38.*"
> >     gdb_test "stop at 43" "Breakpoint.*at.*: file.*average\.c, line 43.*"
> 
> > When you do a "stop symbol", where the symbol is in the application,
> > it  works fine,
> > 
> > (gdb) stop in main
> > Breakpoint 1 at 0x4401b2: file
> /home/rgetz/blackfin/toolchain/binutils-2.17/gdb/testsuite/gdb.base/average.c, line 38.
> 
> So - should this change the notion of the current source file or not?

I would not think so.

> Break does not, so stop in shouldn't either.  Therefore the behaviour
> you're seeing seems reasonable.  I recommend fixing the test,
> something like stop at average.c:43.

OK - will do - Something like:

Index: gdb.base/dbx.exp
===================================================================
--- gdb.base/dbx.exp    (revision 2024)
+++ gdb.base/dbx.exp    (working copy)
@@ -266,8 +266,8 @@
 proc test_breakpoints { } {
     gdb_test "stop in main" "Breakpoint.*at.*: file.*average\.c, line 38\."
     gdb_test "status" "Num.*Type.*Disp.*Enb.*Address.*What\r\n1\[ \r\]+breakpoint\[ \r\]+keep y.*in main at.*average\.c:38.*"
-    gdb_test "stop at 43" "Breakpoint.*at.*: file.*average\.c, line 43.*"
-    gdb_test "stop in 43" "Usage: stop in <function . address>"
+    gdb_test "stop at average.c:43" "Breakpoint.*at.*: file.*average\.c, line 43.*"
+    gdb_test "stop in average.c:43" "Usage: stop in <function . address>"
     gdb_test "stop at main" "Usage: stop at <line>"
 }

Thanks
-Robin

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

* Re: Testsuite question...
  2007-12-05 15:59 Testsuite question Robin Getz
@ 2007-12-05 16:07 ` Daniel Jacobowitz
  2007-12-05 16:54   ` Robin Getz
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-12-05 16:07 UTC (permalink / raw)
  To: Robin Getz; +Cc: gdb

On Wed, Dec 05, 2007 at 10:59:37AM -0500, Robin Getz wrote:
> proc test_breakpoints { } {
>     gdb_test "stop in main" "Breakpoint.*at.*: file.*average\.c, line 38\."
>     gdb_test "status" "Num.*Type.*Disp.*Enb.*Address.*What\r\n1\[ \r\]+breakpoint\[ \r\]+keep y.*in main at.*average\.c:38.*"
>     gdb_test "stop at 43" "Breakpoint.*at.*: file.*average\.c, line 43.*"

> When you do a "stop symbol", where the symbol is in the application, it 
> works fine,
> 
> (gdb) stop in main
> Breakpoint 1 at 0x4401b2: file /home/rgetz/blackfin/toolchain/binutils-2.17/gdb/testsuite/gdb.base/average.c, line 38.

So - should this change the notion of the current source file or not?
Break does not, so stop in shouldn't either.  Therefore the behaviour
you're seeing seems reasonable.  I recommend fixing the test,
something like stop at average.c:43.

-- 
Daniel Jacobowitz
CodeSourcery

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

* Testsuite question...
@ 2007-12-05 15:59 Robin Getz
  2007-12-05 16:07 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Robin Getz @ 2007-12-05 15:59 UTC (permalink / raw)
  To: gdb

In gdb/testsuite/gdb.base/dbx-test.exp there are some simple breakpoint tests:

#
#test_breakpoints
#
proc test_breakpoints { } {
    gdb_test "stop in main" "Breakpoint.*at.*: file.*average\.c, line 38\."
    gdb_test "status" "Num.*Type.*Disp.*Enb.*Address.*What\r\n1\[ \r\]+breakpoint\[ \r\]+keep y.*in main at.*average\.c:38.*"
    gdb_test "stop at 43" "Breakpoint.*at.*: file.*average\.c, line 43.*"
    gdb_test "stop in 43" "Usage: stop in <function . address>"
    gdb_test "stop at main" "Usage: stop at <line>"
}

I have run into a little problem with this, and am not sure if this is my
problem, or if it is a general testsuite issue.

Since we compile all the c libraries with -g, I get a break in the crt1.S file.
(This is pretty helpful when debugging libs and startup issues).

(gdb) exec-file /home/rgetz/blackfin/gcc-build/binutils_build/gdb/testsuite/gdb.base/dbx-test. ^Mgdb
(gdb) target remote 192.168.0.32:2427
Remote debugging using 192.168.0.32:2427
Remote debugging from host 192.168.0.22
_stext () at libc/sysdeps/linux/bfin/crt1.S:84
84              FP = 0;
 Current language:  auto; currently asm

When you do a "stop symbol", where the symbol is in the application, it 
works fine,

(gdb) stop in main
Breakpoint 1 at 0x4401b2: file /home/rgetz/blackfin/toolchain/binutils-2.17/gdb/testsuite/gdb.base/average.c, line 38.
(gdb) PASS: gdb.base/dbx.exp: stop in main
status
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x004401b2 in main at /home/rgetz/blackfin/toolchain/binutils-2.17/gdb/testsuite/gdb.base/average.c:38
(gdb) PASS: gdb.base/dbx.exp: status

When you do a "stop 43", since the current context is not the application
source file (it is line number after all), it puts a breakpoint in the 
current open file - crt1.S, and this fails the pattern match.

stop at 43
Breakpoint 2 at 0x440044: file libc/sysdeps/linux/bfin/crt1.S, line 43.
(gdb) FAIL: gdb.base/dbx.exp: stop at 43

This doesn't sound like an architecture specific issue?

Thanks for any/all pointers.
-Robin

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

end of thread, other threads:[~2007-12-05 16:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-22 16:53 testsuite question Manoj Iyer
2007-12-05 15:59 Testsuite question Robin Getz
2007-12-05 16:07 ` Daniel Jacobowitz
2007-12-05 16:54   ` Robin Getz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).