This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch/testsuite/cp] ctti.exp: use gdb_get_line_number
- From: mec dot gnu at mindspring dot com (Michael Elizabeth Chastain)
- To: carlton at kealia dot com, gdb-patches at sources dot redhat dot com
- Date: Thu, 8 Jan 2004 01:34:09 -0500 (EST)
- Subject: [patch/testsuite/cp] ctti.exp: use gdb_get_line_number
This patch tweaks ctti.exp so that it uses gdb_get_line_number
with a comment marker instead of just calling "next" six times.
It also runs the test a bit further with gcc before bailing out.
It still doesn't do any of the good bits with gcc yet.
(I couldn't do this with the first cleanup because I had to touch
cttiadd.cc, and I had to put a copyright notice into cttiadd.c
before I could touch it, and that deserved a separate patch).
Tested on native i686-pc-linux-gnu.
I am committing this now.
Michael C
2004-01-07 Michael Chastain <mec.gnu@mindspring.com>
* gdb.cp/cttiadd.c: Add a marker for gdb_get_line_number.
* gdb.cp/ctti.exp: Use the marker instead of "next".
With gcc, run further before bailing.
Index: ctti.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/ctti.exp,v
retrieving revision 1.3
diff -c -3 -p -r1.3 ctti.exp
*** ctti.exp 8 Jan 2004 02:13:57 -0000 1.3
--- ctti.exp 8 Jan 2004 06:26:03 -0000
*************** if ![runto_main] then {
*** 76,96 ****
continue
}
! # TODO: this needs more work before actually deploying it.
! # So bail out here.
!
! if { [ test_compiler_info gcc-*] } then { continue }
!
! gdb_test "next" "$decimal.*i = 2;" "next 1"
! gdb_test "next" "$decimal.*f = 4.5;" "next 2"
! gdb_test "next" "$decimal.*c = add\\(c, c\\);" "next 3"
! gdb_test "next" "$decimal.*i = add\\(i, i\\);" "next 4"
! gdb_test "next" "$decimal.*f = add\\(f, f\\);" "next 5"
! gdb_test "next" "$decimal.*add1\\(\\);" "next 6"
gdb_test "print c" "\\$\[0-9\]+ = -62 .*"
gdb_test "print f" "\\$\[0-9\]+ = 9"
gdb_test "print i" "\\$\[0-9\]+ = 4"
gdb_test_multiple "print add<int>(2,2)" "print add<int>(2,2)" {
-re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
--- 76,92 ----
continue
}
! gdb_breakpoint [gdb_get_line_number "marker add1"]
! gdb_continue_to_breakpoint "marker add1"
gdb_test "print c" "\\$\[0-9\]+ = -62 .*"
gdb_test "print f" "\\$\[0-9\]+ = 9"
gdb_test "print i" "\\$\[0-9\]+ = 4"
+
+ # TODO: this needs more work before actually deploying it.
+ # So bail out here.
+
+ if { [ test_compiler_info gcc-*] } then { continue }
gdb_test_multiple "print add<int>(2,2)" "print add<int>(2,2)" {
-re "\\$\[0-9\]+ = 4\r\n$gdb_prompt $" {
Index: cttiadd.cc
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/cttiadd.cc,v
retrieving revision 1.2
diff -c -3 -p -r1.2 cttiadd.cc
*** cttiadd.cc 8 Jan 2004 06:19:15 -0000 1.2
--- cttiadd.cc 8 Jan 2004 06:26:03 -0000
***************
*** 1,6 ****
/* This testcase is part of GDB, the GNU debugger.
! Copyright 1998, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
--- 1,6 ----
/* This testcase is part of GDB, the GNU debugger.
! Copyright 1998, 1999, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*************** int main()
*** 44,49 ****
--- 44,50 ----
i = add(i, i);
f = add(f, f);
+ // marker add1
add1();
subr2();
subr3();