This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH RFA] gdb.base/signals.exp: explicitly set count = 0
- To: gdb-patches at sources dot redhat dot com
- Subject: [PATCH RFA] gdb.base/signals.exp: explicitly set count = 0
- From: Orjan Friberg <orjan dot friberg at axis dot com>
- Date: Thu, 15 Mar 2001 14:53:58 +0100
- Organization: Axis Communications AB
gdb.base/signals.exp runs the main function in signals.c twice.
signal.c contains a static variable count which is initialized to 0.
The second time the main function is run, the test case relies on count
being 0, which depends on how runto_main is implemented for the target.
My target does a simple "jump *main", which obviously doesn't
re-initialize count to 0. This patch sets count to 0 explicitly.
Ok to commit?
2001-03-15 Orjan Friberg <orjanf@axis.com>
* gdb.base/signals.exp: Set count to 0 explicitly.
Index: signals.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/signals.exp,v
retrieving revision 1.2
diff -c -3 -p -r1.2 signals.exp
*** signals.exp 2001/03/06 08:21:51 1.2
--- signals.exp 2001/03/15 13:35:40
*************** gdb_expect {
*** 370,375 ****
--- 370,378 ----
}
if [runto_main] then {
+ # Since count is a static variable outside main, runto_main
+ # is no guarantee that count will be 0 at this point.
+ gdb_test "set variable count = 0" ""
gdb_test "break handler if 0" "Breakpoint \[0-9\]+ .*"
gdb_test "set \$handler_breakpoint_number = \$bpnum" ""
--
Orjan Friberg E-mail: orjan.friberg@axis.com
Axis Communications AB Phone: +46 46 272 17 68