This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] testsuite/gdb.base/break.exp
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [RFA] testsuite/gdb.base/break.exp
- From: Michael Elizabeth Chastain <chastain at cygnus dot com>
- Date: Thu, 7 Dec 2000 16:13:01 -0800
Here is version #4 of my break.exp patch. This is a resubmittal.
It is identical to version #3 (2000-Nov-28).
This patch fixes these test failures on i686-pc-linux-gnu (native):
FAIL: gdb.base/break.exp: break main #1
FAIL: gdb.base/break.exp: break main #2
FAIL: gdb.base/break.exp: clear main
The problem is that 'main' is the name of parameter at the point where
the program-under-test is executing (in __libc_start_main, right after
a 'finish' command).
My solution is:
(1) Use "marker3" rather than "main" for a function name to test
(2) Move the test to a scope that we control, where "marker3" is used
as a function name in in the program-under-test.
OK to apply?
Michael Elizabeth Chastain
<mailto:chastain@redhat.com>
"love without fear"
===
2000-11-28 Michael Chastain <chastain@redhat.com>
* break.exp (test_clear_command): use a marker function
rather than 'main' for the test function. Also move this
test to an execution point where the marker function names are
guaranteed to be bound to functions. (Executing tests after a
'finish' from main runs into name conflicts with local names
in __libc_start_main).
Index: gdb/testsuite/gdb.base/break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.exp,v
retrieving revision 1.6
diff -c -3 -p -r1.6 break.exp
*** gdb/testsuite/gdb.base/break.exp 2000/11/17 16:24:48 1.6
--- gdb/testsuite/gdb.base/break.exp 2000/11/28 18:26:45
*************** gdb_expect {
*** 520,525 ****
--- 520,534 ----
timeout {fail "(timeout) clear current line has no breakpoint disallowed"}
}
+ # Verify that we can set and clear multiple breakpoints.
+ #
+ # We don't test that it deletes the correct breakpoints. We do at
+ # least test that it deletes more than one breakpoint.
+ #
+ gdb_test "break marker3" "Breakpoint.*at.*" "break marker3 #1"
+ gdb_test "break marker3" "Breakpoint.*at.*" "break marker3 #2"
+ gdb_test "clear marker3" {Deleted breakpoints [0-9]+ [0-9]+.*}
+
# Verify that a breakpoint can be set via a convenience variable.
#
send_gdb "set \$foo=81\n"
*************** if [istarget "hppa*-*-hpux*"] then {
*** 706,720 ****
#********
- proc test_clear_command {} {
- gdb_test "break main" "Breakpoint.*at.*" "break main #1"
- gdb_test "break main" "Breakpoint.*at.*" "break main #2"
-
- # We don't test that it deletes the correct breakpoints. We do at
- # least test that it deletes more than one breakpoint.
- gdb_test "clear main" {Deleted breakpoints [0-9]+ [0-9]+.*}
- }
-
#
# Test "next" over recursive function call.
#
--- 715,720 ----
*************** proc test_next_with_recursion {} {
*** 802,808 ****
gdb_stop_suppressing_tests;
}
- test_clear_command
test_next_with_recursion
--- 802,807 ----