* [PATCH] Outwit compiler dead code elimination in break.exp test
@ 2003-11-29 23:05 Fred Fish
2003-11-30 1:04 ` Fred Fish
2003-12-01 17:52 ` Andrew Cagney
0 siblings, 2 replies; 20+ messages in thread
From: Fred Fish @ 2003-11-29 23:05 UTC (permalink / raw)
To: gdb-patches; +Cc: fnf
2003-11-29 Fred Fish <fnf@redhat.com>
* gdb.base/break.c (globalvar): Add.
(marker1, marker2, marker3, marker4): Set globalvar.
Index: gdb.base/break.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.c,v
retrieving revision 1.3
diff -c -p -r1.3 break.c
*** gdb.base/break.c 13 Nov 2003 15:34:39 -0000 1.3
--- gdb.base/break.c 29 Nov 2003 22:57:41 -0000
*************** char *arg;
*** 37,54 ****
* as places to try setting breakpoints at. They are explicitly
* "one-line functions" to verify that this case works (some versions
* of gcc have or have had problems with this).
*/
#ifdef PROTOTYPES
! int marker1 (void) { return (0); }
! int marker2 (int a) { return (1); } /* set breakpoint 8 here */
! void marker3 (char *a, char *b) {}
! void marker4 (long d) {} /* set breakpoint 14 here */
#else
! int marker1 () { return (0); }
! int marker2 (a) int a; { return (1); } /* set breakpoint 9 here */
! void marker3 (a, b) char *a, *b; {}
! void marker4 (d) long d; {} /* set breakpoint 13 here */
#endif
/*
--- 37,58 ----
* as places to try setting breakpoints at. They are explicitly
* "one-line functions" to verify that this case works (some versions
* of gcc have or have had problems with this).
+ * Recent versions of gcc have gotten smart enough that they will not
+ * call functions that have no use or visible side effect, so use
+ * globalvar to outwit the compiler for a while longer.
*/
+ int globalvar;
#ifdef PROTOTYPES
! int marker1 (void) { globalvar = 1; return (0); }
! int marker2 (int a) { globalvar = 2; return (1); } /* set breakpoint 8 here */
! void marker3 (char *a, char *b) {globalvar = 3;}
! void marker4 (long d) {globalvar = 4;} /* set breakpoint 14 here */
#else
! int marker1 () { globalvar = 1; return (0); }
! int marker2 (a) int a; { globalvar = 2; return (1); } /* set breakpoint 9 here */
! void marker3 (a, b) char *a, *b; {globalvar = 3;}
! void marker4 (d) long d; {globalvar = 4;} /* set breakpoint 13 here */
#endif
/*
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-11-29 23:05 [PATCH] Outwit compiler dead code elimination in break.exp test Fred Fish
@ 2003-11-30 1:04 ` Fred Fish
2003-11-30 1:07 ` Daniel Jacobowitz
2003-12-01 17:52 ` Andrew Cagney
1 sibling, 1 reply; 20+ messages in thread
From: Fred Fish @ 2003-11-30 1:04 UTC (permalink / raw)
To: fnf; +Cc: gdb-patches
> * gdb.base/break.c (globalvar): Add.
> (marker1, marker2, marker3, marker4): Set globalvar.
BTW, as it turns out this breaks some other tests that depend upon
hardwired line numbers into break.c, so I'm updating those. If
nothing else, it might be a good idea to mark those lines that do have
hardwired line numbers to make them easier to find again in the
future.
-Fred
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-11-30 1:04 ` Fred Fish
@ 2003-11-30 1:07 ` Daniel Jacobowitz
2003-11-30 1:26 ` Fred Fish
` (2 more replies)
0 siblings, 3 replies; 20+ messages in thread
From: Daniel Jacobowitz @ 2003-11-30 1:07 UTC (permalink / raw)
To: Fred Fish; +Cc: fnf, gdb-patches
On Sat, Nov 29, 2003 at 06:03:57PM -0700, Fred Fish wrote:
> > * gdb.base/break.c (globalvar): Add.
> > (marker1, marker2, marker3, marker4): Set globalvar.
>
> BTW, as it turns out this breaks some other tests that depend upon
> hardwired line numbers into break.c, so I'm updating those. If
> nothing else, it might be a good idea to mark those lines that do have
> hardwired line numbers to make them easier to find again in the
> future.
If you're there, rather than being the second person this month to
update the line numbers, could you convert it to gdb_get_line_number?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-11-30 1:07 ` Daniel Jacobowitz
@ 2003-11-30 1:26 ` Fred Fish
2003-12-01 0:46 ` Fred Fish
2003-12-01 14:23 ` Elena Zannoni
2 siblings, 0 replies; 20+ messages in thread
From: Fred Fish @ 2003-11-30 1:26 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Fred Fish, fnf, gdb-patches
> If you're there, rather than being the second person this month to
> update the line numbers, could you convert it to gdb_get_line_number?
OK, I'll take a look at that.
There may also be places where the line numbers are irrelevant for the
feature being tested ("maint info breakpoints" for example?) and could
just be replaced with patterns to check for any line number.
-Fred
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-11-30 1:07 ` Daniel Jacobowitz
2003-11-30 1:26 ` Fred Fish
@ 2003-12-01 0:46 ` Fred Fish
2003-12-01 14:58 ` Elena Zannoni
2003-12-01 14:23 ` Elena Zannoni
2 siblings, 1 reply; 20+ messages in thread
From: Fred Fish @ 2003-12-01 0:46 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Fred Fish, fnf, gdb-patches
> If you're there, rather than being the second person this month to
> update the line numbers, could you convert it to gdb_get_line_number?
OK, here is an updated patch.
-Fred
2003-11-29 Fred Fish <fnf@redhat.com>
* gdb.base/break.c (globalvar): Add.
(marker1, marker2, marker3, marker4): Set globalvar.
Add additional "set breakpoint NN here" comments.
* gdb.base/condbreak.exp: Use $bp_locationNN variables instead
of hardcoded line numbers. Emit bp_locationNN markers in pass
and fail messages instead of line numbers.
* gdb.base/break.exp: Ditto.
* gdb.base/define.exp: Ditto.
* gdb.base/ena-dis-br.exp: Ditto.
* gdb.base/maint.exp: Ditto.
* gdb.base/until.exp: Ditto.
Index: gdb.base/break.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.c,v
retrieving revision 1.3
diff -c -p -r1.3 break.c
*** gdb.base/break.c 13 Nov 2003 15:34:39 -0000 1.3
--- gdb.base/break.c 1 Dec 2003 00:37:15 -0000
*************** char *arg;
*** 37,54 ****
* as places to try setting breakpoints at. They are explicitly
* "one-line functions" to verify that this case works (some versions
* of gcc have or have had problems with this).
*/
#ifdef PROTOTYPES
! int marker1 (void) { return (0); }
! int marker2 (int a) { return (1); } /* set breakpoint 8 here */
! void marker3 (char *a, char *b) {}
! void marker4 (long d) {} /* set breakpoint 14 here */
#else
! int marker1 () { return (0); }
! int marker2 (a) int a; { return (1); } /* set breakpoint 9 here */
! void marker3 (a, b) char *a, *b; {}
! void marker4 (d) long d; {} /* set breakpoint 13 here */
#endif
/*
--- 37,58 ----
* as places to try setting breakpoints at. They are explicitly
* "one-line functions" to verify that this case works (some versions
* of gcc have or have had problems with this).
+ * Recent versions of gcc have gotten smart enough that they will not
+ * call functions that have no use or visible side effect, so use
+ * globalvar to outwit the compiler for a while longer.
*/
+ int globalvar;
#ifdef PROTOTYPES
! gint marker1 (void) { globalvar = 1; return (0); } /* set breakpoint 15 here */
! int marker2 (int a) { globalvar = 2; return (1); } /* set breakpoint 8 here */
! void marker3 (char *a, char *b) {globalvar = 3;} /* set breakpoint 17 here */
! void marker4 (long d) {globalvar = 4;} /* set breakpoint 14 here */
#else
! int marker1 () { globalvar = 1; return (0); } /* set breakpoint 16 here */
! int marker2 (a) int a; { globalvar = 2; return (1); } /* set breakpoint 9 here */
! void marker3 (a, b) char *a, *b; {globalvar = 3;} /* set breakpoint 18 here */
! void marker4 (d) long d; {globalvar = 4;} /* set breakpoint 13 here */
#endif
/*
*************** char *argv[], **envp;
*** 79,86 ****
printf ("%d\n", factorial (atoi ("6"))); /* set breakpoint 1 here */
/* set breakpoint 12 here */
marker1 (); /* set breakpoint 11 here */
! marker2 (43);
! marker3 ("stack", "trace");
marker4 (177601976L);
argc = (argc == 12345); /* This is silly, but we can step off of it */ /* set breakpoint 2 here */
return argc; /* set breakpoint 10 here */
--- 83,90 ----
printf ("%d\n", factorial (atoi ("6"))); /* set breakpoint 1 here */
/* set breakpoint 12 here */
marker1 (); /* set breakpoint 11 here */
! marker2 (43); /* set breakpoint 20 here */
! marker3 ("stack", "trace"); /* set breakpoint 21 here */
marker4 (177601976L);
argc = (argc == 12345); /* This is silly, but we can step off of it */ /* set breakpoint 2 here */
return argc; /* set breakpoint 10 here */
*************** int value;
*** 96,102 ****
if (value > 1) { /* set breakpoint 7 here */
value *= factorial (value - 1);
}
! return (value);
}
#ifdef PROTOTYPES
--- 100,106 ----
if (value > 1) { /* set breakpoint 7 here */
value *= factorial (value - 1);
}
! return (value); /* set breakpoint 19 here */
}
#ifdef PROTOTYPES
Index: gdb.base/break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.exp,v
retrieving revision 1.18
diff -c -p -r1.18 break.exp
*** gdb.base/break.exp 13 Nov 2003 15:34:39 -0000 1.18
--- gdb.base/break.exp 1 Dec 2003 00:37:16 -0000
*************** gdb_expect {
*** 393,399 ****
# Run to the desired default location. If not positioned here, the
# tests below don't work.
#
! gdb_test "until $bp_location1" "main .* at .*:$bp_location1.*" "until $bp_location1"
# Verify that GDB allows one to just say "break", which is treated
--- 393,399 ----
# Run to the desired default location. If not positioned here, the
# tests below don't work.
#
! gdb_test "until $bp_location1" "main .* at .*:$bp_location1.*" "until bp_location1"
# Verify that GDB allows one to just say "break", which is treated
*************** if ![runto_main] then { fail "break test
*** 445,454 ****
send_gdb "break $bp_location1\n"
gdb_expect {
-re "Breakpoint (\[0-9\]*) at .*, line $bp_location1.*$gdb_prompt $"\
! {pass "set to-be-silent break $bp_location1"}
-re "$gdb_prompt $"\
! {fail "set to-be-silent break $bp_location1"}
! timeout {fail "(timeout) set to-be-silent break $bp_location1"}
}
send_gdb "commands $expect_out(1,string)\n"
--- 445,454 ----
send_gdb "break $bp_location1\n"
gdb_expect {
-re "Breakpoint (\[0-9\]*) at .*, line $bp_location1.*$gdb_prompt $"\
! {pass "set to-be-silent break bp_location1"}
-re "$gdb_prompt $"\
! {fail "set to-be-silent break bp_location1"}
! timeout {fail "(timeout) set to-be-silent break bp_location1"}
}
send_gdb "commands $expect_out(1,string)\n"
*************** send_gdb "silent\n"
*** 456,488 ****
send_gdb "end\n"
gdb_expect {
-re ".*$gdb_prompt $"\
! {pass "set silent break $bp_location1"}
! timeout {fail "(timeout) set silent break $bp_location1"}
}
send_gdb "info break $expect_out(1,string)\n"
gdb_expect {
-re "\[0-9\]*\[ \t\]*breakpoint.*:$bp_location1\r\n\[ \t\]*silent.*$gdb_prompt $"\
! {pass "info silent break $bp_location1"}
-re "$gdb_prompt $"\
! {fail "info silent break $bp_location1"}
! timeout {fail "(timeout) info silent break $bp_location1"}
}
send_gdb "continue\n"
gdb_expect {
-re "Continuing.\r\n$gdb_prompt $"\
! {pass "hit silent break $bp_location1"}
-re "$gdb_prompt $"\
! {fail "hit silent break $bp_location1"}
! timeout {fail "(timeout) hit silent break $bp_location1"}
}
send_gdb "bt\n"
gdb_expect {
-re "#0 main .* at .*:$bp_location1.*$gdb_prompt $"\
! {pass "stopped for silent break $bp_location1"}
-re "$gdb_prompt $"\
! {fail "stopped for silent break $bp_location1"}
! timeout {fail "(timeout) stopped for silent break $bp_location1"}
}
# Verify that GDB can at least parse a breakpoint with the
--- 456,488 ----
send_gdb "end\n"
gdb_expect {
-re ".*$gdb_prompt $"\
! {pass "set silent break bp_location1"}
! timeout {fail "(timeout) set silent break bp_location1"}
}
send_gdb "info break $expect_out(1,string)\n"
gdb_expect {
-re "\[0-9\]*\[ \t\]*breakpoint.*:$bp_location1\r\n\[ \t\]*silent.*$gdb_prompt $"\
! {pass "info silent break bp_location1"}
-re "$gdb_prompt $"\
! {fail "info silent break bp_location1"}
! timeout {fail "(timeout) info silent break bp_location1"}
}
send_gdb "continue\n"
gdb_expect {
-re "Continuing.\r\n$gdb_prompt $"\
! {pass "hit silent break bp_location1"}
-re "$gdb_prompt $"\
! {fail "hit silent break bp_location1"}
! timeout {fail "(timeout) hit silent break bp_location1"}
}
send_gdb "bt\n"
gdb_expect {
-re "#0 main .* at .*:$bp_location1.*$gdb_prompt $"\
! {pass "stopped for silent break bp_location1"}
-re "$gdb_prompt $"\
! {fail "stopped for silent break bp_location1"}
! timeout {fail "(timeout) stopped for silent break bp_location1"}
}
# Verify that GDB can at least parse a breakpoint with the
*************** gdb_test "clear marker3" {Deleted breakp
*** 561,568 ****
send_gdb "set \$foo=$bp_location11\n"
gdb_expect {
-re "$gdb_prompt $"\
! {pass "set convenience variable \$foo to $bp_location11"}
! timeout {fail "(timeout) set convenience variable \$foo to $bp_location11"}
}
send_gdb "break \$foo\n"
gdb_expect {
--- 561,568 ----
send_gdb "set \$foo=$bp_location11\n"
gdb_expect {
-re "$gdb_prompt $"\
! {pass "set convenience variable \$foo to bp_location11"}
! timeout {fail "(timeout) set convenience variable \$foo to bp_location11"}
}
send_gdb "break \$foo\n"
gdb_expect {
*************** gdb_expect {
*** 934,940 ****
}
-re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:$bp_location14\[\r\n\]+$bp_location14\[\t \]+void marker4.*" {
# marker4() is defined at line 46 when compiled with -DPROTOTYPES
! pass "run until breakpoint set at small function, optimized file (line $bp_location14)"
}
-re ".*$gdb_prompt " {
fail "run until breakpoint set at small function, optimized file"
--- 934,940 ----
}
-re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:$bp_location14\[\r\n\]+$bp_location14\[\t \]+void marker4.*" {
# marker4() is defined at line 46 when compiled with -DPROTOTYPES
! pass "run until breakpoint set at small function, optimized file (line bp_location14)"
}
-re ".*$gdb_prompt " {
fail "run until breakpoint set at small function, optimized file"
Index: gdb.base/condbreak.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/condbreak.exp,v
retrieving revision 1.3
diff -c -p -r1.3 condbreak.exp
*** gdb.base/condbreak.exp 23 May 2001 19:04:13 -0000 1.3
--- gdb.base/condbreak.exp 1 Dec 2003 00:37:16 -0000
*************** if [target_info exists gdb_stub] {
*** 55,60 ****
--- 55,67 ----
gdb_step_for_stub;
}
+ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
+ set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
+ set bp_location8 [gdb_get_line_number "set breakpoint 8 here"]
+ set bp_location9 [gdb_get_line_number "set breakpoint 9 here"]
+ set bp_location15 [gdb_get_line_number "set breakpoint 15 here"]
+ set bp_location16 [gdb_get_line_number "set breakpoint 16 here"]
+
#
# test break at function
#
*************** gdb_test "delete 2" ""
*** 73,80 ****
#
# test conditional break at line number
#
! gdb_test "break 79 if 1==1" \
! "Breakpoint.*at.* file .*$srcfile, line 79\\."
gdb_test "delete 3" ""
--- 80,87 ----
#
# test conditional break at line number
#
! gdb_test "break $bp_location1 if 1==1" \
! "Breakpoint.*at.* file .*$srcfile, line $bp_location1\\."
gdb_test "delete 3" ""
*************** gdb_test "break marker1 if (1==1)" \
*** 87,94 ****
#
# test conditional break at line number
#
! gdb_test "break 79 if (1==1)" \
! "Breakpoint.*at.* file .*$srcfile, line 79\\."
gdb_test "break marker2 if (a==43)" \
"Breakpoint.*at.* file .*$srcfile, line.*"
--- 94,101 ----
#
# test conditional break at line number
#
! gdb_test "break $bp_location1 if (1==1)" \
! "Breakpoint.*at.* file .*$srcfile, line $bp_location1\\."
gdb_test "break marker2 if (a==43)" \
"Breakpoint.*at.* file .*$srcfile, line.*"
*************** if {$hp_aCC_compiler} {
*** 105,119 ****
set marker2_proto ""
}
- set main_line 75
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker1$marker1_proto at .*$srcfile:4\[38\].*
\[\t \]+stop only if 1 == 1.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:79.*
\[\t \]+stop only if 1 == 1.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker2$marker2_proto at .*$srcfile:4\[49\].*
\[\t \]+stop only if a == 43.*" \
"breakpoint info"
--- 112,125 ----
set marker2_proto ""
}
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location6.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker1$marker1_proto at .*$srcfile:($bp_location15|$bp_location16).*
\[\t \]+stop only if 1 == 1.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.*
\[\t \]+stop only if 1 == 1.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker2$marker2_proto at .*$srcfile:($bp_location8|$bp_location9).*
\[\t \]+stop only if a == 43.*" \
"breakpoint info"
*************** rerun_to_main
*** 128,134 ****
#
# run until the breakpoint at a line number
#
! gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:79.*79\[\t \]+printf.*factorial.*" \
"run until breakpoint set at a line number"
#
--- 134,140 ----
#
# run until the breakpoint at a line number
#
! gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location1.*$bp_location1\[\t \]+printf.*factorial.*" \
"run until breakpoint set at a line number"
#
*************** gdb_test "continue" "Continuing\\..*Brea
*** 173,182 ****
# Until the Dwarf2 writer gets fixed, I'm going to XFAIL its behavior.
send_gdb "continue\n"
gdb_expect {
! -re "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile:4\[38\].*4\[38\]\[\t \]+.*$gdb_prompt $" {
pass "run until breakpoint at marker1"
}
! -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker1 \\(\\) at .*$srcfile:4\[38\].*4\[38\]\[\t \]+.*$gdb_prompt $" {
xfail "run until breakpoint at marker1"
}
-re "$gdb_prompt $" {
--- 179,188 ----
# Until the Dwarf2 writer gets fixed, I'm going to XFAIL its behavior.
send_gdb "continue\n"
gdb_expect {
! -re "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.*$gdb_prompt $" {
pass "run until breakpoint at marker1"
}
! -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker1 \\(\\) at .*$srcfile:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.*$gdb_prompt $" {
xfail "run until breakpoint at marker1"
}
-re "$gdb_prompt $" {
*************** gdb_expect {
*** 192,201 ****
setup_xfail hppa2.0w-*-* 11512CLLbs
send_gdb "continue\n"
gdb_expect {
! -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile:4\[49\].*4\[49\]\[\t \]+.*" {
pass "run until breakpoint at marker2"
}
! -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=43\\) at .*$srcfile:4\[49\].*4\[49\]\[\t \]+.*" {
xfail "run until breakpoint at marker2"
}
-re "$gdb_prompt $" {
--- 198,207 ----
setup_xfail hppa2.0w-*-* 11512CLLbs
send_gdb "continue\n"
gdb_expect {
! -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+.*" {
pass "run until breakpoint at marker2"
}
! -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=43\\) at .*$srcfile:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+.*" {
xfail "run until breakpoint at marker2"
}
-re "$gdb_prompt $" {
Index: gdb.base/define.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/define.exp,v
retrieving revision 1.3
diff -c -p -r1.3 define.exp
*** gdb.base/define.exp 23 May 2001 19:04:13 -0000 1.3
--- gdb.base/define.exp 1 Dec 2003 00:37:16 -0000
*************** gdb_start
*** 45,50 ****
--- 45,53 ----
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
+ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
+ set bp_location11 [gdb_get_line_number "set breakpoint 11 here"]
+
if ![runto_main] then { fail "define tests suppressed" }
# Verify that GDB allows a user to define their very own commands.
*************** gdb_expect {
*** 68,74 ****
#
send_gdb "nextwhere\n"
gdb_expect {
! -re ".*79\[ \t\]*printf.*#0\[ \t\]*main.*:79.*$gdb_prompt $"\
{pass "use user command: nextwhere"}
-re "$gdb_prompt $"\
{fail "use user command: nextwhere"}
--- 71,77 ----
#
send_gdb "nextwhere\n"
gdb_expect {
! -re ".*$bp_location1\[ \t\]*printf.*#0\[ \t\]*main.*:$bp_location1.*$gdb_prompt $"\
{pass "use user command: nextwhere"}
-re "$gdb_prompt $"\
{fail "use user command: nextwhere"}
*************** gdb_expect {
*** 224,230 ****
send_gdb "next\n"
gdb_expect {
! -re "#0\[ \t\]*main.*:81.*$gdb_prompt $"\
{pass "use hook-stop command"}
-re "$gdb_prompt $"\
{fail "use hook-stop command"}
--- 227,233 ----
send_gdb "next\n"
gdb_expect {
! -re "#0\[ \t\]*main.*:$bp_location11.*$gdb_prompt $"\
{pass "use hook-stop command"}
-re "$gdb_prompt $"\
{fail "use hook-stop command"}
Index: gdb.base/ena-dis-br.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ena-dis-br.exp,v
retrieving revision 1.3
diff -c -p -r1.3 ena-dis-br.exp
*** gdb.base/ena-dis-br.exp 18 Sep 2002 15:34:10 -0000 1.3
--- gdb.base/ena-dis-br.exp 1 Dec 2003 00:37:17 -0000
*************** gdb_start
*** 43,48 ****
--- 43,59 ----
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
+ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
+ set bp_location8 [gdb_get_line_number "set breakpoint 8 here"]
+ set bp_location9 [gdb_get_line_number "set breakpoint 9 here"]
+ set bp_location11 [gdb_get_line_number "set breakpoint 11 here"]
+ set bp_location13 [gdb_get_line_number "set breakpoint 13 here"]
+ set bp_location14 [gdb_get_line_number "set breakpoint 14 here"]
+ set bp_location15 [gdb_get_line_number "set breakpoint 15 here"]
+ set bp_location16 [gdb_get_line_number "set breakpoint 16 here"]
+ set bp_location17 [gdb_get_line_number "set breakpoint 17 here"]
+ set bp_location18 [gdb_get_line_number "set breakpoint 18 here"]
+
if ![runto_main] then { fail "enable/disable break tests suppressed" }
# Verify that we can set a breakpoint (the location is irrelevant),
*************** if ![runto_main] then { fail "enable/dis
*** 50,56 ****
#
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
--- 61,67 ----
#
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
*************** gdb_expect {
*** 98,104 ****
#
send_gdb "break marker2\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[49\].*$gdb_prompt $"\
{pass "break marker2"}
-re "$gdb_prompt $"\
{fail "break marker2"}
--- 109,115 ----
#
send_gdb "break marker2\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location8|$bp_location9).*$gdb_prompt $"\
{pass "break marker2"}
-re "$gdb_prompt $"\
{fail "break marker2"}
*************** if ![runto_main] then { fail "enable/dis
*** 156,162 ****
send_gdb "break marker3\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line (45|50).*$gdb_prompt $"\
{pass "break marker3"}
-re "$gdb_prompt $"\
{fail "break marker3"}
--- 167,173 ----
send_gdb "break marker3\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location17|$bp_location18).*$gdb_prompt $"\
{pass "break marker3"}
-re "$gdb_prompt $"\
{fail "break marker3"}
*************** gdb_expect {
*** 181,187 ****
send_gdb "continue\n"
gdb_expect {
! -re ".*marker3 .*:(45|50).*$gdb_prompt $"\
{pass "continue to auto-deleted break marker3"}
-re "Breakpoint \[0-9\]*, marker3.*$gdb_prompt $"\
{fail "continue to auto-deleted break marker3"}
--- 192,198 ----
send_gdb "continue\n"
gdb_expect {
! -re ".*marker3 .*:($bp_location17|$bp_location18).*$gdb_prompt $"\
{pass "continue to auto-deleted break marker3"}
-re "Breakpoint \[0-9\]*, marker3.*$gdb_prompt $"\
{fail "continue to auto-deleted break marker3"}
*************** gdb_expect {
*** 206,212 ****
#
send_gdb "break marker4\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line (46|51).*$gdb_prompt $"\
{pass "break marker4"}
-re "$gdb_prompt $"\
{fail "break marker4"}
--- 217,223 ----
#
send_gdb "break marker4\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location14|$bp_location13).*$gdb_prompt $"\
{pass "break marker4"}
-re "$gdb_prompt $"\
{fail "break marker4"}
*************** if ![runto_main] then { fail "enable/dis
*** 237,243 ****
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
--- 248,254 ----
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
*************** if ![runto_main] then { fail "enable/dis
*** 328,334 ****
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
--- 339,345 ----
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
*************** rerun_to_main
*** 365,371 ****
send_gdb "continue\n"
gdb_expect {
! -re ".*marker1 .*:4\[38\].*$gdb_prompt $"\
{pass "continue to ignored & auto-deleted break marker1"}
-re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
{fail "continue to ignored & auto-deleted break marker1"}
--- 376,382 ----
send_gdb "continue\n"
gdb_expect {
! -re ".*marker1 .*:($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "continue to ignored & auto-deleted break marker1"}
-re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
{fail "continue to ignored & auto-deleted break marker1"}
*************** if ![runto_main] then { fail "enable/dis
*** 381,387 ****
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
--- 392,398 ----
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
*************** gdb_expect {
*** 423,431 ****
#
if ![runto_main] then { fail "enable/disable break tests suppressed" }
! send_gdb "break 79\n"
gdb_expect {
! -re "Breakpoint \[0-9\]*.*, line 79.*$gdb_prompt $"\
{pass "prepare to continue with ignore count"}
-re "$gdb_prompt $"\
{fail "prepare to continue with ignore count"}
--- 434,442 ----
#
if ![runto_main] then { fail "enable/disable break tests suppressed" }
! send_gdb "break $bp_location1\n"
gdb_expect {
! -re "Breakpoint \[0-9\]*.*, line $bp_location1.*$gdb_prompt $"\
{pass "prepare to continue with ignore count"}
-re "$gdb_prompt $"\
{fail "prepare to continue with ignore count"}
*************** gdb_expect {
*** 442,448 ****
send_gdb "next\n"
gdb_expect {
! -re ".*81\[ \t\]*marker1.*$gdb_prompt $"\
{pass "step after continue with ignore count"}
-re "$gdb_prompt $"\
{fail "step after continue with ignore count"}
--- 453,459 ----
send_gdb "next\n"
gdb_expect {
! -re ".*$bp_location11\[ \t\]*marker1.*$gdb_prompt $"\
{pass "step after continue with ignore count"}
-re "$gdb_prompt $"\
{fail "step after continue with ignore count"}
Index: gdb.base/maint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/maint.exp,v
retrieving revision 1.20
diff -c -p -r1.20 maint.exp
*** gdb.base/maint.exp 20 Nov 2003 15:36:34 -0000 1.20
--- gdb.base/maint.exp 1 Dec 2003 00:37:19 -0000
*************** gdb_expect {
*** 412,422 ****
timeout { fail "(timeout) maint info sections DATA" }
}
send_gdb "maint info breakpoints\n"
gdb_expect {
! -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex\[ \t\]+in main at.*break.c:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\
{ pass "maint info breakpoints" }
! -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n-1\[ \t\]+shlib events\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex.*breakpoint already hit.*$gdb_prompt $"\
{ pass "maint info breakpoints (with shlib events)" }
-re ".*$gdb_prompt $" { fail "maint info breakpoints" }
timeout { fail "(timeout) maint info breakpoints" }
--- 412,424 ----
timeout { fail "(timeout) maint info sections DATA" }
}
+ set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
+
send_gdb "maint info breakpoints\n"
gdb_expect {
! -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex\[ \t\]+in main at.*break.c:$bp_location6\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\
{ pass "maint info breakpoints" }
! -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:$bp_location6\r\n\[ \t\]+breakpoint already hit 1 time\r\n-1\[ \t\]+shlib events\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex.*breakpoint already hit.*$gdb_prompt $"\
{ pass "maint info breakpoints (with shlib events)" }
-re ".*$gdb_prompt $" { fail "maint info breakpoints" }
timeout { fail "(timeout) maint info breakpoints" }
Index: gdb.base/until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/until.exp,v
retrieving revision 1.3
diff -c -p -r1.3 until.exp
*** gdb.base/until.exp 3 Feb 2003 16:04:18 -0000 1.3
--- gdb.base/until.exp 1 Dec 2003 00:37:19 -0000
*************** gdb_start
*** 37,42 ****
--- 37,47 ----
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
+ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
+ set bp_location19 [gdb_get_line_number "set breakpoint 19 here"]
+ set bp_location20 [gdb_get_line_number "set breakpoint 20 here"]
+ set bp_location21 [gdb_get_line_number "set breakpoint 21 here"]
+
if ![runto_main] then {
fail "Can't run to main"
return 0
*************** if ![runto_main] then {
*** 45,52 ****
# Verify that "until <location>" works. (This is really just syntactic
# sugar for "tbreak <location>; continue".)
#
! gdb_test "until 79" \
! "main .* at .*:79.*" \
"until line number"
# Verify that a malformed "advance" is gracefully caught.
--- 50,57 ----
# Verify that "until <location>" works. (This is really just syntactic
# sugar for "tbreak <location>; continue".)
#
! gdb_test "until $bp_location1" \
! "main .* at .*:$bp_location1.*" \
"until line number"
# Verify that a malformed "advance" is gracefully caught.
*************** delete_breakpoints
*** 62,69 ****
# inner invocations of factorial() are completed and we are back at this
# frame.
#
! gdb_test "until 99" \
! "factorial.*value=720.*at.*${srcfile}:99.*return \\(value\\)." \
"until factorial, recursive function"
# Run to a function called by main
--- 67,74 ----
# inner invocations of factorial() are completed and we are back at this
# frame.
#
! gdb_test "until $bp_location19" \
! "factorial.*value=720.*at.*${srcfile}:$bp_location19.*return \\(value\\).*" \
"until factorial, recursive function"
# Run to a function called by main
*************** delete_breakpoints
*** 76,81 ****
# 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\\)|83.*marker3 \\(.stack., .trace.\\))." \
"until func, not called by current frame"
--- 81,86 ----
# stop at main, the caller, where we put the 'guard' breakpoint.
#
gdb_test "until marker3" \
! "($hex in |)main.*argc.*argv.*envp.*at.*${srcfile}:($bp_location20.*marker2 \\(43\\)|$bp_location21.*marker3 \\(.stack., .trace.\\)).*" \
"until func, not called by current frame"
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-11-30 1:07 ` Daniel Jacobowitz
2003-11-30 1:26 ` Fred Fish
2003-12-01 0:46 ` Fred Fish
@ 2003-12-01 14:23 ` Elena Zannoni
2003-12-01 14:44 ` Daniel Jacobowitz
2 siblings, 1 reply; 20+ messages in thread
From: Elena Zannoni @ 2003-12-01 14:23 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Fred Fish, fnf, gdb-patches
Daniel Jacobowitz writes:
> On Sat, Nov 29, 2003 at 06:03:57PM -0700, Fred Fish wrote:
> > > * gdb.base/break.c (globalvar): Add.
> > > (marker1, marker2, marker3, marker4): Set globalvar.
> >
> > BTW, as it turns out this breaks some other tests that depend upon
> > hardwired line numbers into break.c, so I'm updating those. If
> > nothing else, it might be a good idea to mark those lines that do have
> > hardwired line numbers to make them easier to find again in the
> > future.
>
> If you're there, rather than being the second person this month to
> update the line numbers, could you convert it to gdb_get_line_number?
>
> --
> Daniel Jacobowitz
> MontaVista Software Debian GNU/Linux Developer
What are you guys looking at? An alternate universe?
2003-11-13 Elena Zannoni <ezannoni@redhat.com>
* gdb.base/break.c: Add comments to aid finding line numbers for
breakpoints.
* gdb.base/break.exp: Remove all references to explicit line
numbers.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-12-01 14:23 ` Elena Zannoni
@ 2003-12-01 14:44 ` Daniel Jacobowitz
0 siblings, 0 replies; 20+ messages in thread
From: Daniel Jacobowitz @ 2003-12-01 14:44 UTC (permalink / raw)
To: Elena Zannoni; +Cc: Fred Fish, fnf, gdb-patches
On Mon, Dec 01, 2003 at 09:23:22AM -0500, Elena Zannoni wrote:
> Daniel Jacobowitz writes:
> > On Sat, Nov 29, 2003 at 06:03:57PM -0700, Fred Fish wrote:
> > > > * gdb.base/break.c (globalvar): Add.
> > > > (marker1, marker2, marker3, marker4): Set globalvar.
> > >
> > > BTW, as it turns out this breaks some other tests that depend upon
> > > hardwired line numbers into break.c, so I'm updating those. If
> > > nothing else, it might be a good idea to mark those lines that do have
> > > hardwired line numbers to make them easier to find again in the
> > > future.
> >
> > If you're there, rather than being the second person this month to
> > update the line numbers, could you convert it to gdb_get_line_number?
> >
> > --
> > Daniel Jacobowitz
> > MontaVista Software Debian GNU/Linux Developer
>
>
> What are you guys looking at? An alternate universe?
>
> 2003-11-13 Elena Zannoni <ezannoni@redhat.com>
>
> * gdb.base/break.c: Add comments to aid finding line numbers for
> breakpoints.
> * gdb.base/break.exp: Remove all references to explicit line
> numbers.
It looks like Fred is talking about other test files which reference
break.exp. Like condbreak.exp...
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-12-01 0:46 ` Fred Fish
@ 2003-12-01 14:58 ` Elena Zannoni
2003-12-01 15:30 ` Fred Fish
0 siblings, 1 reply; 20+ messages in thread
From: Elena Zannoni @ 2003-12-01 14:58 UTC (permalink / raw)
To: fnf; +Cc: Daniel Jacobowitz, Fred Fish, gdb-patches
Fred Fish writes:
> > If you're there, rather than being the second person this month to
> > update the line numbers, could you convert it to gdb_get_line_number?
>
> OK, here is an updated patch.
>
> -Fred
>
> 2003-11-29 Fred Fish <fnf@redhat.com>
>
> * gdb.base/break.c (globalvar): Add.
> (marker1, marker2, marker3, marker4): Set globalvar.
> Add additional "set breakpoint NN here" comments.
> * gdb.base/condbreak.exp: Use $bp_locationNN variables instead
> of hardcoded line numbers. Emit bp_locationNN markers in pass
> and fail messages instead of line numbers.
Why this? The line numbers were not really hardcoded.
> * gdb.base/break.exp: Ditto.
> * gdb.base/define.exp: Ditto.
> * gdb.base/ena-dis-br.exp: Ditto.
> * gdb.base/maint.exp: Ditto.
> * gdb.base/until.exp: Ditto.
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-12-01 14:58 ` Elena Zannoni
@ 2003-12-01 15:30 ` Fred Fish
2003-12-01 15:46 ` Elena Zannoni
0 siblings, 1 reply; 20+ messages in thread
From: Fred Fish @ 2003-12-01 15:30 UTC (permalink / raw)
To: Elena Zannoni; +Cc: Daniel Jacobowitz, Fred Fish, gdb-patches
> > Emit bp_locationNN markers in pass
> > and fail messages instead of line numbers.
>
> Why this? The line numbers were not really hardcoded.
Generally I believe you should not emit values in the pass/fail
messages that are subject to change, such as addresses, line numbers,
etc. This way you can diff successive summary files without seeing
spurious differences.
However I can revert that part of the patch if that is an issue.
-Fred
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-12-01 15:30 ` Fred Fish
@ 2003-12-01 15:46 ` Elena Zannoni
2003-12-01 16:39 ` Fred Fish
0 siblings, 1 reply; 20+ messages in thread
From: Elena Zannoni @ 2003-12-01 15:46 UTC (permalink / raw)
To: fnf; +Cc: gdb-patches
Fred Fish writes:
> > > Emit bp_locationNN markers in pass
> > > and fail messages instead of line numbers.
> >
> > Why this? The line numbers were not really hardcoded.
>
> Generally I believe you should not emit values in the pass/fail
> messages that are subject to change, such as addresses, line numbers,
> etc. This way you can diff successive summary files without seeing
> spurious differences.
>
> However I can revert that part of the patch if that is an issue.
If the pass/fil messages are unique within the .exp files, then ok.
>
> -Fred
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-12-01 15:46 ` Elena Zannoni
@ 2003-12-01 16:39 ` Fred Fish
0 siblings, 0 replies; 20+ messages in thread
From: Fred Fish @ 2003-12-01 16:39 UTC (permalink / raw)
To: Elena Zannoni; +Cc: fnf, gdb-patches
> > > Why this? The line numbers were not really hardcoded.
> > However I can revert that part of the patch if that is an issue.
> If the pass/fil messages are unique within the .exp files, then ok.
The messages will now be something like:
PASS: gdb.base/break.exp: set to-be-silent break bp_location1
instead of:
PASS: gdb.base/break.exp: set to-be-silent break 83
and of course bp_location1 can always be matched back up with the
actual line number and specific test that failed.
-Fred
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-11-29 23:05 [PATCH] Outwit compiler dead code elimination in break.exp test Fred Fish
2003-11-30 1:04 ` Fred Fish
@ 2003-12-01 17:52 ` Andrew Cagney
2003-12-01 18:10 ` Fred Fish
2003-12-07 21:21 ` [PATCH] Outwit compiler dead code elimination in break.exp test (revised patch) Fred Fish
1 sibling, 2 replies; 20+ messages in thread
From: Andrew Cagney @ 2003-12-01 17:52 UTC (permalink / raw)
To: fnf; +Cc: gdb-patches
> * as places to try setting breakpoints at. They are explicitly
> * "one-line functions" to verify that this case works (some versions
> * of gcc have or have had problems with this).
> + * Recent versions of gcc have gotten smart enough that they will not
> + * call functions that have no use or visible side effect, so use
> + * globalvar to outwit the compiler for a while longer.
Fred, can you clarify exactly under what circumstances this occures?
I know that GCC will now, when -O is specified, inline (and thence
eliminate) pure functions. However, I don't think that should occure
when -O isn't specified.
As for stopping GCC from eliminating code - last time this came up (ref
store.exp) it was recommended that the .c files be split so that GCC
couldn't see the potential optimization.
Andrew
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-12-01 17:52 ` Andrew Cagney
@ 2003-12-01 18:10 ` Fred Fish
2003-12-09 1:02 ` Michael Snyder
2003-12-07 21:21 ` [PATCH] Outwit compiler dead code elimination in break.exp test (revised patch) Fred Fish
1 sibling, 1 reply; 20+ messages in thread
From: Fred Fish @ 2003-12-01 18:10 UTC (permalink / raw)
To: Andrew Cagney; +Cc: fnf, gdb-patches
> I know that GCC will now, when -O is specified, inline (and thence
> eliminate) pure functions. However, I don't think that should occure
> when -O isn't specified.
It doesn't. The gdb specifically uses optimization for the test that
is currently failing:
FAIL: gdb.base/break.exp: run until breakpoint set at small function, optimized file
> As for stopping GCC from eliminating code - last time this came up (ref
> store.exp) it was recommended that the .c files be split so that GCC
> couldn't see the potential optimization.
If that is the prefered solution, I can rework the patch.
-Fred
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test (revised patch)
2003-12-01 17:52 ` Andrew Cagney
2003-12-01 18:10 ` Fred Fish
@ 2003-12-07 21:21 ` Fred Fish
2003-12-08 0:31 ` Andrew Cagney
1 sibling, 1 reply; 20+ messages in thread
From: Fred Fish @ 2003-12-07 21:21 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 469 bytes --]
On Monday 01 December 2003 10:52, Andrew Cagney wrote:
> As for stopping GCC from eliminating code - last time this came up (ref
> store.exp) it was recommended that the .c files be split so that GCC
> couldn't see the potential optimization.
OK. I've revised the patch to split the source file. This is
pretty ugly though as there are a half dozen tests that have
to be modified to accomodate two source files.
I've attached the patch for review/approval.
-Fred
[-- Attachment #2: d --]
[-- Type: text/x-diff, Size: 54758 bytes --]
? diff1
? diff2
? diff3
? diff4
? diff5
? gdb.base/break1.c
? gdb.base/d
? gdb.base/d2
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v
retrieving revision 1.684
diff -c -p -r1.684 ChangeLog
*** ChangeLog 6 Dec 2003 22:49:01 -0000 1.684
--- ChangeLog 7 Dec 2003 21:14:45 -0000
***************
*** 1,3 ****
--- 1,30 ----
+ 2003-12-07 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/break.c (marker1, marker2, marker3, marker4): Move
+ functions to break1.c and leave prototypes behind. Add more
+ "set breakpoint NN here" comments.
+ * gdb.base/break1.c: New file.
+
+ * gdb.base/break.exp: Handle compiling test case from multiple
+ source files and change source file references as needed.
+ * gdb.base/completion.exp: Ditto.
+ * gdb.base/condbreak.exp: Ditto.
+ * gdb.base/define.exp: Ditto.
+ * gdb.base/ena-dis-br.exp: Ditto.
+ * gdb.base/info-proc.exp: Ditto.
+ * gdb.base/maint.exp: Ditto.
+ * gdb.base/until.exp: Ditto.
+
+ * gdb.base/condbreak.exp: Use bp_locationNN variables instead of
+ hardcoded line numbers.
+ * gdb.base/define.exp: Ditto.
+ * gdb.base/ena-dis-br.exp: Ditto.
+ * gdb.base/maint.exp: Ditto.
+ * gdb.base/until.exp: Ditto.
+
+ * gdb.base/completion.exp: Use "break1" for completion tests since
+ "break" is no longer a unique prefix.
+
2003-12-06 Andrew Cagney <cagney@redhat.com>
* gdb.base/structs.exp (test_struct_returns): When applicable, set
Index: gdb.base/break.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.c,v
retrieving revision 1.3
diff -c -p -r1.3 break.c
*** gdb.base/break.c 13 Nov 2003 15:34:39 -0000 1.3
--- gdb.base/break.c 7 Dec 2003 21:14:45 -0000
*************** char *arg;
*** 32,54 ****
# include <stdlib.h>
#endif /* ! vxworks */
- /*
- * The following functions do nothing useful. They are included simply
- * as places to try setting breakpoints at. They are explicitly
- * "one-line functions" to verify that this case works (some versions
- * of gcc have or have had problems with this).
- */
-
#ifdef PROTOTYPES
! int marker1 (void) { return (0); }
! int marker2 (int a) { return (1); } /* set breakpoint 8 here */
! void marker3 (char *a, char *b) {}
! void marker4 (long d) {} /* set breakpoint 14 here */
#else
! int marker1 () { return (0); }
! int marker2 (a) int a; { return (1); } /* set breakpoint 9 here */
! void marker3 (a, b) char *a, *b; {}
! void marker4 (d) long d; {} /* set breakpoint 13 here */
#endif
/*
--- 32,47 ----
# include <stdlib.h>
#endif /* ! vxworks */
#ifdef PROTOTYPES
! extern int marker1 (void);
! extern int marker2 (int a);
! extern void marker3 (char *a, char *b);
! extern void marker4 (long d);
#else
! extern int marker1 ();
! extern int marker2 ();
! extern void marker3 ();
! extern void marker4 ();
#endif
/*
*************** char *argv[], **envp;
*** 79,86 ****
printf ("%d\n", factorial (atoi ("6"))); /* set breakpoint 1 here */
/* set breakpoint 12 here */
marker1 (); /* set breakpoint 11 here */
! marker2 (43);
! marker3 ("stack", "trace");
marker4 (177601976L);
argc = (argc == 12345); /* This is silly, but we can step off of it */ /* set breakpoint 2 here */
return argc; /* set breakpoint 10 here */
--- 72,79 ----
printf ("%d\n", factorial (atoi ("6"))); /* set breakpoint 1 here */
/* set breakpoint 12 here */
marker1 (); /* set breakpoint 11 here */
! marker2 (43); /* set breakpoint 20 here */
! marker3 ("stack", "trace"); /* set breakpoint 21 here */
marker4 (177601976L);
argc = (argc == 12345); /* This is silly, but we can step off of it */ /* set breakpoint 2 here */
return argc; /* set breakpoint 10 here */
*************** int value;
*** 96,102 ****
if (value > 1) { /* set breakpoint 7 here */
value *= factorial (value - 1);
}
! return (value);
}
#ifdef PROTOTYPES
--- 89,95 ----
if (value > 1) { /* set breakpoint 7 here */
value *= factorial (value - 1);
}
! return (value); /* set breakpoint 19 here */
}
#ifdef PROTOTYPES
Index: gdb.base/break1.c
===================================================================
*** /dev/null 2003-01-30 03:24:37.000000000 -0700
--- gdb.base/break1.c 2003-12-07 13:19:17.000000000 -0700
***************
*** 0 ****
--- 1,23 ----
+ /*
+ * The following functions do nothing useful. They are included simply
+ * as places to try setting breakpoints at. They are explicitly
+ * "one-line functions" to verify that this case works (some versions
+ * of gcc have or have had problems with this).
+ *
+ * Some of the tests that use this file compile it with optimization on,
+ * which can result in these functions being optimized away. So it is
+ * compiled into a a separate object file.
+ */
+
+ #ifdef PROTOTYPES
+ int marker1 (void) { return (0); } /* set breakpoint 15 here */
+ int marker2 (int a) { return (1); } /* set breakpoint 8 here */
+ void marker3 (char *a, char *b) {} /* set breakpoint 17 here */
+ void marker4 (long d) {} /* set breakpoint 14 here */
+ #else
+ int marker1 () { return (0); } /* set breakpoint 16 here */
+ int marker2 (a) int a; { return (1); } /* set breakpoint 9 here */
+ void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */
+ void marker4 (d) long d; {} /* set breakpoint 13 here */
+ #endif
+
Index: gdb.base/break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.exp,v
retrieving revision 1.18
diff -c -p -r1.18 break.exp
*** gdb.base/break.exp 13 Nov 2003 15:34:39 -0000 1.18
--- gdb.base/break.exp 7 Dec 2003 21:14:46 -0000
*************** set bug_id 0
*** 34,43 ****
set testfile "break"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfile}] {
--- 34,52 ----
set testfile "break"
set srcfile ${testfile}.c
+ set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfile}] {
*************** gdb_test "break main" \
*** 87,93 ****
# test break at quoted function
#
gdb_test "break \"marker2\"" \
! "Breakpoint.*at.* file .*$srcfile, line.*" \
"breakpoint quoted function"
#
--- 96,102 ----
# test break at quoted function
#
gdb_test "break \"marker2\"" \
! "Breakpoint.*at.* file .*$srcfile1, line.*" \
"breakpoint quoted function"
#
*************** if {$hp_aCC_compiler} {
*** 165,177 ****
}
set bp_location7 [gdb_get_line_number "set breakpoint 7 here"]
! set bp_location8 [gdb_get_line_number "set breakpoint 8 here"]
! set bp_location9 [gdb_get_line_number "set breakpoint 9 here"]
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker2 at .*$srcfile:($bp_location8|$bp_location9).*
\[0-9\]+\[\t \]+breakpoint keep y.* in factorial$proto at .*$srcfile:$bp_location7.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.*
--- 174,186 ----
}
set bp_location7 [gdb_get_line_number "set breakpoint 7 here"]
! set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
! set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1]
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker2 at .*$srcfile1:($bp_location8|$bp_location9).*
\[0-9\]+\[\t \]+breakpoint keep y.* in factorial$proto at .*$srcfile:$bp_location7.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.*
*************** for {set i 6} {$i >= 1} {incr i -1} {
*** 232,238 ****
#
# Run until the breakpoint set at a quoted function
#
! gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, (0x\[0-9a-f\]+ in )?marker2 \\(a=43\\) at .*$srcfile:($bp_location8|$bp_location9).*" \
"run until quoted breakpoint"
#
# run until the file:function breakpoint at a line number in a file
--- 241,247 ----
#
# Run until the breakpoint set at a quoted function
#
! gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, (0x\[0-9a-f\]+ in )?marker2 \\(a=43\\) at .*$srcfile1:($bp_location8|$bp_location9).*" \
"run until quoted breakpoint"
#
# run until the file:function breakpoint at a line number in a file
*************** gdb_expect {
*** 393,399 ****
# Run to the desired default location. If not positioned here, the
# tests below don't work.
#
! gdb_test "until $bp_location1" "main .* at .*:$bp_location1.*" "until $bp_location1"
# Verify that GDB allows one to just say "break", which is treated
--- 402,408 ----
# Run to the desired default location. If not positioned here, the
# tests below don't work.
#
! gdb_test "until $bp_location1" "main .* at .*:$bp_location1.*" "until bp_location1"
# Verify that GDB allows one to just say "break", which is treated
*************** if ![runto_main] then { fail "break test
*** 445,454 ****
send_gdb "break $bp_location1\n"
gdb_expect {
-re "Breakpoint (\[0-9\]*) at .*, line $bp_location1.*$gdb_prompt $"\
! {pass "set to-be-silent break $bp_location1"}
-re "$gdb_prompt $"\
! {fail "set to-be-silent break $bp_location1"}
! timeout {fail "(timeout) set to-be-silent break $bp_location1"}
}
send_gdb "commands $expect_out(1,string)\n"
--- 454,463 ----
send_gdb "break $bp_location1\n"
gdb_expect {
-re "Breakpoint (\[0-9\]*) at .*, line $bp_location1.*$gdb_prompt $"\
! {pass "set to-be-silent break bp_location1"}
-re "$gdb_prompt $"\
! {fail "set to-be-silent break bp_location1"}
! timeout {fail "(timeout) set to-be-silent break bp_location1"}
}
send_gdb "commands $expect_out(1,string)\n"
*************** send_gdb "silent\n"
*** 456,488 ****
send_gdb "end\n"
gdb_expect {
-re ".*$gdb_prompt $"\
! {pass "set silent break $bp_location1"}
! timeout {fail "(timeout) set silent break $bp_location1"}
}
send_gdb "info break $expect_out(1,string)\n"
gdb_expect {
-re "\[0-9\]*\[ \t\]*breakpoint.*:$bp_location1\r\n\[ \t\]*silent.*$gdb_prompt $"\
! {pass "info silent break $bp_location1"}
-re "$gdb_prompt $"\
! {fail "info silent break $bp_location1"}
! timeout {fail "(timeout) info silent break $bp_location1"}
}
send_gdb "continue\n"
gdb_expect {
-re "Continuing.\r\n$gdb_prompt $"\
! {pass "hit silent break $bp_location1"}
-re "$gdb_prompt $"\
! {fail "hit silent break $bp_location1"}
! timeout {fail "(timeout) hit silent break $bp_location1"}
}
send_gdb "bt\n"
gdb_expect {
-re "#0 main .* at .*:$bp_location1.*$gdb_prompt $"\
! {pass "stopped for silent break $bp_location1"}
-re "$gdb_prompt $"\
! {fail "stopped for silent break $bp_location1"}
! timeout {fail "(timeout) stopped for silent break $bp_location1"}
}
# Verify that GDB can at least parse a breakpoint with the
--- 465,497 ----
send_gdb "end\n"
gdb_expect {
-re ".*$gdb_prompt $"\
! {pass "set silent break bp_location1"}
! timeout {fail "(timeout) set silent break bp_location1"}
}
send_gdb "info break $expect_out(1,string)\n"
gdb_expect {
-re "\[0-9\]*\[ \t\]*breakpoint.*:$bp_location1\r\n\[ \t\]*silent.*$gdb_prompt $"\
! {pass "info silent break bp_location1"}
-re "$gdb_prompt $"\
! {fail "info silent break bp_location1"}
! timeout {fail "(timeout) info silent break bp_location1"}
}
send_gdb "continue\n"
gdb_expect {
-re "Continuing.\r\n$gdb_prompt $"\
! {pass "hit silent break bp_location1"}
-re "$gdb_prompt $"\
! {fail "hit silent break bp_location1"}
! timeout {fail "(timeout) hit silent break bp_location1"}
}
send_gdb "bt\n"
gdb_expect {
-re "#0 main .* at .*:$bp_location1.*$gdb_prompt $"\
! {pass "stopped for silent break bp_location1"}
-re "$gdb_prompt $"\
! {fail "stopped for silent break bp_location1"}
! timeout {fail "(timeout) stopped for silent break bp_location1"}
}
# Verify that GDB can at least parse a breakpoint with the
*************** gdb_test "clear marker3" {Deleted breakp
*** 561,568 ****
send_gdb "set \$foo=$bp_location11\n"
gdb_expect {
-re "$gdb_prompt $"\
! {pass "set convenience variable \$foo to $bp_location11"}
! timeout {fail "(timeout) set convenience variable \$foo to $bp_location11"}
}
send_gdb "break \$foo\n"
gdb_expect {
--- 570,577 ----
send_gdb "set \$foo=$bp_location11\n"
gdb_expect {
-re "$gdb_prompt $"\
! {pass "set convenience variable \$foo to bp_location11"}
! timeout {fail "(timeout) set convenience variable \$foo to bp_location11"}
}
send_gdb "break \$foo\n"
gdb_expect {
*************** test_next_with_recursion
*** 849,856 ****
set binfileo2 ${objdir}/${subdir}/${testfile}o2
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfileo2}" executable {debug additional_flags="-O2" }] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfileo2}] {
--- 858,873 ----
set binfileo2 ${objdir}/${subdir}/${testfile}o2
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}O0.o" object {debug "additional_flags=-w -O2"}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}O1.o" object {debug "additional_flags=-w -O2"}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}O0.o ${binfile}O1.o" "${binfileo2}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfileo2}] {
*************** gdb_test "break main" \
*** 877,883 ****
# test break at function
#
gdb_test "break marker4" \
! "Breakpoint.*at.* file .*$srcfile, line.*" \
"breakpoint small function, optimized file"
#
--- 894,900 ----
# test break at function
#
gdb_test "break marker4" \
! "Breakpoint.*at.* file .*$srcfile1, line.*" \
"breakpoint small function, optimized file"
#
*************** if ![target_info exists use_gdb_stub] {
*** 922,940 ****
# has no exactly matching line symbol, and GDB reports the breakpoint
# as if it were in the middle of a line rather than at the beginning.
! set bp_location13 [gdb_get_line_number "set breakpoint 13 here"]
! set bp_location14 [gdb_get_line_number "set breakpoint 14 here"]
send_gdb "continue\n"
gdb_expect {
! -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
pass "run until breakpoint set at small function, optimized file"
}
! -re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
pass "run until breakpoint set at small function, optimized file"
}
! -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:$bp_location14\[\r\n\]+$bp_location14\[\t \]+void marker4.*" {
# marker4() is defined at line 46 when compiled with -DPROTOTYPES
! pass "run until breakpoint set at small function, optimized file (line $bp_location14)"
}
-re ".*$gdb_prompt " {
fail "run until breakpoint set at small function, optimized file"
--- 939,957 ----
# has no exactly matching line symbol, and GDB reports the breakpoint
# as if it were in the middle of a line rather than at the beginning.
! set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile1]
! set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile1]
send_gdb "continue\n"
gdb_expect {
! -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile1:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
pass "run until breakpoint set at small function, optimized file"
}
! -re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile1:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
pass "run until breakpoint set at small function, optimized file"
}
! -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile1:$bp_location14\[\r\n\]+$bp_location14\[\t \]+void marker4.*" {
# marker4() is defined at line 46 when compiled with -DPROTOTYPES
! pass "run until breakpoint set at small function, optimized file (line bp_location14)"
}
-re ".*$gdb_prompt " {
fail "run until breakpoint set at small function, optimized file"
Index: gdb.base/completion.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/completion.exp,v
retrieving revision 1.18
diff -c -p -r1.18 completion.exp
*** gdb.base/completion.exp 7 Aug 2003 17:58:44 -0000 1.18
--- gdb.base/completion.exp 7 Dec 2003 21:14:47 -0000
***************
*** 38,45 ****
# "info ajksdlfk " no completions
# "info" " "
# "info " ambiguous (all info commands)
! # "p \"break" unambiguous (completes to filename "break.c")
! # "p \"break." unambiguous (should complete to "break.c" but does not,
# due to readline limitations)
# "p 'a" ambiguous (all symbols starting with a)
# "p b-a" ambiguous (all symbols starting with a)
--- 38,45 ----
# "info ajksdlfk " no completions
# "info" " "
# "info " ambiguous (all info commands)
! # "p \"break1" unambiguous (completes to filename "break1.c")
! # "p \"break1." unambiguous (should complete to "break1.c" but does not,
# due to readline limitations)
# "p 'a" ambiguous (all symbols starting with a)
# "p b-a" ambiguous (all symbols starting with a)
*************** set bug_id 0
*** 64,72 ****
set testfile "break"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfile}] {
--- 64,82 ----
set testfile "break"
set srcfile ${testfile}.c
+ set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfile}] {
*************** gdb_expect {
*** 351,411 ****
}
! send_gdb "p \"break\t"
sleep 1
gdb_expect {
! -re "^p \"break\\\x07$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break'"}
! timeout {fail "(timeout) complete 'p \"break'"}
}
}
! -re "^p \"break\\.c\"$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { pass "complete 'p \"break'"}
! timeout {fail "(timeout) complete 'p \"break'"}
}
}
! -re "^p \"break.*$"
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break'"}
! timeout {fail "(timeout) complete 'p \"break'"}
}
}
! -re ".*$gdb_prompt $" { fail "complete 'p \"break'" }
! timeout { fail "(timeout) complete 'p \"break'" }
}
setup_xfail "*-*-*"
! send_gdb "p \"break.\t"
sleep 1
gdb_expect {
! -re "^p \"break\\.\\\x07$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break.'"}
! timeout {fail "(timeout) complete 'p \"break.'"}
}
}
! -re "^p \"break\\.c\"$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { pass "complete 'p \"break.'"}
! timeout {fail "(timeout) complete 'p \"break.'"}
}
}
! -re "^p \"break\\..*$"
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break.'"}
! timeout {fail "(timeout) complete 'p \"break.'"}
}
}
! -re ".*$gdb_prompt $" { fail "complete 'p \"break.'" }
! timeout { fail "(timeout) complete 'p \"break.'" }
}
send_gdb "p 'a\t"
--- 361,421 ----
}
! send_gdb "p \"break1\t"
sleep 1
gdb_expect {
! -re "^p \"break1\\\x07$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break1'"}
! timeout {fail "(timeout) complete 'p \"break1'"}
}
}
! -re "^p \"break1\\.c\"$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { pass "complete 'p \"break1'"}
! timeout {fail "(timeout) complete 'p \"break1'"}
}
}
! -re "^p \"break1.*$"
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break1'"}
! timeout {fail "(timeout) complete 'p \"break1'"}
}
}
! -re ".*$gdb_prompt $" { fail "complete 'p \"break1'" }
! timeout { fail "(timeout) complete 'p \"break1'" }
}
setup_xfail "*-*-*"
! send_gdb "p \"break1.\t"
sleep 1
gdb_expect {
! -re "^p \"break1\\.\\\x07$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'"}
! timeout {fail "(timeout) complete 'p \"break1.'"}
}
}
! -re "^p \"break1\\.c\"$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { pass "complete 'p \"break1.'"}
! timeout {fail "(timeout) complete 'p \"break1.'"}
}
}
! -re "^p \"break1\\..*$"
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'"}
! timeout {fail "(timeout) complete 'p \"break1.'"}
}
}
! -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'" }
! timeout { fail "(timeout) complete 'p \"break1.'" }
}
send_gdb "p 'a\t"
*************** gdb_expect {
*** 682,688 ****
-re "marker1.*$gdb_prompt info func marker$"\
{ send_gdb "\n"
gdb_expect {
! -re "All functions matching regular expression \"marker\":.*File.*break.c:\r\nint marker1\\((void|)\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long int\\);.*$gdb_prompt $"\
{ pass "complete 'info func marke'"}
-re ".*$gdb_prompt $" { fail "complete 'info func marke'"}
timeout {fail "(timeout) complete 'info func marke'"}
--- 692,698 ----
-re "marker1.*$gdb_prompt info func marker$"\
{ send_gdb "\n"
gdb_expect {
! -re "All functions matching regular expression \"marker\":.*File.*break1.c:\r\nint marker1\\((void|)\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long int\\);.*$gdb_prompt $"\
{ pass "complete 'info func marke'"}
-re ".*$gdb_prompt $" { fail "complete 'info func marke'"}
timeout {fail "(timeout) complete 'info func marke'"}
Index: gdb.base/condbreak.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/condbreak.exp,v
retrieving revision 1.3
diff -c -p -r1.3 condbreak.exp
*** gdb.base/condbreak.exp 23 May 2001 19:04:13 -0000 1.3
--- gdb.base/condbreak.exp 7 Dec 2003 21:14:47 -0000
*************** set bug_id 0
*** 35,44 ****
set testfile "break"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfile}] {
--- 35,53 ----
set testfile "break"
set srcfile ${testfile}.c
+ set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfile}] {
*************** if [target_info exists gdb_stub] {
*** 55,60 ****
--- 64,76 ----
gdb_step_for_stub;
}
+ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
+ set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
+ set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
+ set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1]
+ set bp_location15 [gdb_get_line_number "set breakpoint 15 here" $srcfile1]
+ set bp_location16 [gdb_get_line_number "set breakpoint 16 here" $srcfile1]
+
#
# test break at function
#
*************** gdb_test "break main" \
*** 66,80 ****
# test conditional break at function
#
gdb_test "break marker1 if 1==1" \
! "Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "delete 2" ""
#
# test conditional break at line number
#
! gdb_test "break 79 if 1==1" \
! "Breakpoint.*at.* file .*$srcfile, line 79\\."
gdb_test "delete 3" ""
--- 82,96 ----
# test conditional break at function
#
gdb_test "break marker1 if 1==1" \
! "Breakpoint.*at.* file .*$srcfile1, line.*"
gdb_test "delete 2" ""
#
# test conditional break at line number
#
! gdb_test "break $srcfile:$bp_location1 if 1==1" \
! "Breakpoint.*at.* file .*$srcfile, line $bp_location1\\."
gdb_test "delete 3" ""
*************** gdb_test "delete 3" ""
*** 82,97 ****
# test conditional break at function
#
gdb_test "break marker1 if (1==1)" \
! "Breakpoint.*at.* file .*$srcfile, line.*"
#
# test conditional break at line number
#
! gdb_test "break 79 if (1==1)" \
! "Breakpoint.*at.* file .*$srcfile, line 79\\."
gdb_test "break marker2 if (a==43)" \
! "Breakpoint.*at.* file .*$srcfile, line.*"
#
# check to see what breakpoints are set
--- 98,113 ----
# test conditional break at function
#
gdb_test "break marker1 if (1==1)" \
! "Breakpoint.*at.* file .*$srcfile1, line.*"
#
# test conditional break at line number
#
! gdb_test "break $srcfile:$bp_location1 if (1==1)" \
! "Breakpoint.*at.* file .*$srcfile, line $bp_location1\\."
gdb_test "break marker2 if (a==43)" \
! "Breakpoint.*at.* file .*$srcfile1, line.*"
#
# check to see what breakpoints are set
*************** if {$hp_aCC_compiler} {
*** 105,119 ****
set marker2_proto ""
}
- set main_line 75
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker1$marker1_proto at .*$srcfile:4\[38\].*
\[\t \]+stop only if 1 == 1.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:79.*
\[\t \]+stop only if 1 == 1.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker2$marker2_proto at .*$srcfile:4\[49\].*
\[\t \]+stop only if a == 43.*" \
"breakpoint info"
--- 121,134 ----
set marker2_proto ""
}
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location6.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker1$marker1_proto at .*$srcfile1:($bp_location15|$bp_location16).*
\[\t \]+stop only if 1 == 1.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.*
\[\t \]+stop only if 1 == 1.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker2$marker2_proto at .*$srcfile1:($bp_location8|$bp_location9).*
\[\t \]+stop only if a == 43.*" \
"breakpoint info"
*************** rerun_to_main
*** 128,134 ****
#
# run until the breakpoint at a line number
#
! gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:79.*79\[\t \]+printf.*factorial.*" \
"run until breakpoint set at a line number"
#
--- 143,149 ----
#
# run until the breakpoint at a line number
#
! gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location1.*$bp_location1\[\t \]+printf.*factorial.*" \
"run until breakpoint set at a line number"
#
*************** gdb_test "continue" "Continuing\\..*Brea
*** 173,182 ****
# Until the Dwarf2 writer gets fixed, I'm going to XFAIL its behavior.
send_gdb "continue\n"
gdb_expect {
! -re "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile:4\[38\].*4\[38\]\[\t \]+.*$gdb_prompt $" {
pass "run until breakpoint at marker1"
}
! -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker1 \\(\\) at .*$srcfile:4\[38\].*4\[38\]\[\t \]+.*$gdb_prompt $" {
xfail "run until breakpoint at marker1"
}
-re "$gdb_prompt $" {
--- 188,197 ----
# Until the Dwarf2 writer gets fixed, I'm going to XFAIL its behavior.
send_gdb "continue\n"
gdb_expect {
! -re "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile1:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.*$gdb_prompt $" {
pass "run until breakpoint at marker1"
}
! -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker1 \\(\\) at .*$srcfile1:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.*$gdb_prompt $" {
xfail "run until breakpoint at marker1"
}
-re "$gdb_prompt $" {
*************** gdb_expect {
*** 192,201 ****
setup_xfail hppa2.0w-*-* 11512CLLbs
send_gdb "continue\n"
gdb_expect {
! -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile:4\[49\].*4\[49\]\[\t \]+.*" {
pass "run until breakpoint at marker2"
}
! -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=43\\) at .*$srcfile:4\[49\].*4\[49\]\[\t \]+.*" {
xfail "run until breakpoint at marker2"
}
-re "$gdb_prompt $" {
--- 207,216 ----
setup_xfail hppa2.0w-*-* 11512CLLbs
send_gdb "continue\n"
gdb_expect {
! -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile1:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+.*" {
pass "run until breakpoint at marker2"
}
! -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=43\\) at .*$srcfile1:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+.*" {
xfail "run until breakpoint at marker2"
}
-re "$gdb_prompt $" {
Index: gdb.base/define.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/define.exp,v
retrieving revision 1.3
diff -c -p -r1.3 define.exp
*** gdb.base/define.exp 23 May 2001 19:04:13 -0000 1.3
--- gdb.base/define.exp 7 Dec 2003 21:14:48 -0000
*************** set bug_id 0
*** 34,43 ****
set testfile "break"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
gdb_exit
--- 34,52 ----
set testfile "break"
set srcfile ${testfile}.c
+ set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
gdb_exit
*************** gdb_start
*** 45,50 ****
--- 54,62 ----
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
+ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
+ set bp_location11 [gdb_get_line_number "set breakpoint 11 here"]
+
if ![runto_main] then { fail "define tests suppressed" }
# Verify that GDB allows a user to define their very own commands.
*************** gdb_expect {
*** 68,74 ****
#
send_gdb "nextwhere\n"
gdb_expect {
! -re ".*79\[ \t\]*printf.*#0\[ \t\]*main.*:79.*$gdb_prompt $"\
{pass "use user command: nextwhere"}
-re "$gdb_prompt $"\
{fail "use user command: nextwhere"}
--- 80,86 ----
#
send_gdb "nextwhere\n"
gdb_expect {
! -re ".*$bp_location1\[ \t\]*printf.*#0\[ \t\]*main.*:$bp_location1.*$gdb_prompt $"\
{pass "use user command: nextwhere"}
-re "$gdb_prompt $"\
{fail "use user command: nextwhere"}
*************** gdb_expect {
*** 224,230 ****
send_gdb "next\n"
gdb_expect {
! -re "#0\[ \t\]*main.*:81.*$gdb_prompt $"\
{pass "use hook-stop command"}
-re "$gdb_prompt $"\
{fail "use hook-stop command"}
--- 236,242 ----
send_gdb "next\n"
gdb_expect {
! -re "#0\[ \t\]*main.*:$bp_location11.*$gdb_prompt $"\
{pass "use hook-stop command"}
-re "$gdb_prompt $"\
{fail "use hook-stop command"}
Index: gdb.base/ena-dis-br.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ena-dis-br.exp,v
retrieving revision 1.3
diff -c -p -r1.3 ena-dis-br.exp
*** gdb.base/ena-dis-br.exp 18 Sep 2002 15:34:10 -0000 1.3
--- gdb.base/ena-dis-br.exp 7 Dec 2003 21:14:48 -0000
*************** set bug_id 0
*** 32,40 ****
set testfile "break"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! 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."
}
--- 32,49 ----
set testfile "break"
set srcfile ${testfile}.c
+ set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
*************** gdb_start
*** 43,48 ****
--- 52,68 ----
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
+ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
+ set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
+ set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1]
+ set bp_location11 [gdb_get_line_number "set breakpoint 11 here"]
+ set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile1]
+ set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile1]
+ set bp_location15 [gdb_get_line_number "set breakpoint 15 here" $srcfile1]
+ set bp_location16 [gdb_get_line_number "set breakpoint 16 here" $srcfile1]
+ set bp_location17 [gdb_get_line_number "set breakpoint 17 here" $srcfile1]
+ set bp_location18 [gdb_get_line_number "set breakpoint 18 here" $srcfile1]
+
if ![runto_main] then { fail "enable/disable break tests suppressed" }
# Verify that we can set a breakpoint (the location is irrelevant),
*************** if ![runto_main] then { fail "enable/dis
*** 50,56 ****
#
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
--- 70,76 ----
#
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
*************** gdb_expect {
*** 98,104 ****
#
send_gdb "break marker2\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[49\].*$gdb_prompt $"\
{pass "break marker2"}
-re "$gdb_prompt $"\
{fail "break marker2"}
--- 118,124 ----
#
send_gdb "break marker2\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location8|$bp_location9).*$gdb_prompt $"\
{pass "break marker2"}
-re "$gdb_prompt $"\
{fail "break marker2"}
*************** if ![runto_main] then { fail "enable/dis
*** 156,162 ****
send_gdb "break marker3\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line (45|50).*$gdb_prompt $"\
{pass "break marker3"}
-re "$gdb_prompt $"\
{fail "break marker3"}
--- 176,182 ----
send_gdb "break marker3\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location17|$bp_location18).*$gdb_prompt $"\
{pass "break marker3"}
-re "$gdb_prompt $"\
{fail "break marker3"}
*************** gdb_expect {
*** 181,187 ****
send_gdb "continue\n"
gdb_expect {
! -re ".*marker3 .*:(45|50).*$gdb_prompt $"\
{pass "continue to auto-deleted break marker3"}
-re "Breakpoint \[0-9\]*, marker3.*$gdb_prompt $"\
{fail "continue to auto-deleted break marker3"}
--- 201,207 ----
send_gdb "continue\n"
gdb_expect {
! -re ".*marker3 .*:($bp_location17|$bp_location18).*$gdb_prompt $"\
{pass "continue to auto-deleted break marker3"}
-re "Breakpoint \[0-9\]*, marker3.*$gdb_prompt $"\
{fail "continue to auto-deleted break marker3"}
*************** gdb_expect {
*** 206,212 ****
#
send_gdb "break marker4\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line (46|51).*$gdb_prompt $"\
{pass "break marker4"}
-re "$gdb_prompt $"\
{fail "break marker4"}
--- 226,232 ----
#
send_gdb "break marker4\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location14|$bp_location13).*$gdb_prompt $"\
{pass "break marker4"}
-re "$gdb_prompt $"\
{fail "break marker4"}
*************** if ![runto_main] then { fail "enable/dis
*** 237,243 ****
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
--- 257,263 ----
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
*************** if ![runto_main] then { fail "enable/dis
*** 328,334 ****
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
--- 348,354 ----
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
*************** rerun_to_main
*** 365,371 ****
send_gdb "continue\n"
gdb_expect {
! -re ".*marker1 .*:4\[38\].*$gdb_prompt $"\
{pass "continue to ignored & auto-deleted break marker1"}
-re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
{fail "continue to ignored & auto-deleted break marker1"}
--- 385,391 ----
send_gdb "continue\n"
gdb_expect {
! -re ".*marker1 .*:($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "continue to ignored & auto-deleted break marker1"}
-re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
{fail "continue to ignored & auto-deleted break marker1"}
*************** if ![runto_main] then { fail "enable/dis
*** 381,387 ****
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
--- 401,407 ----
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
*************** gdb_expect {
*** 423,431 ****
#
if ![runto_main] then { fail "enable/disable break tests suppressed" }
! send_gdb "break 79\n"
gdb_expect {
! -re "Breakpoint \[0-9\]*.*, line 79.*$gdb_prompt $"\
{pass "prepare to continue with ignore count"}
-re "$gdb_prompt $"\
{fail "prepare to continue with ignore count"}
--- 443,451 ----
#
if ![runto_main] then { fail "enable/disable break tests suppressed" }
! send_gdb "break $bp_location1\n"
gdb_expect {
! -re "Breakpoint \[0-9\]*.*, line $bp_location1.*$gdb_prompt $"\
{pass "prepare to continue with ignore count"}
-re "$gdb_prompt $"\
{fail "prepare to continue with ignore count"}
*************** gdb_expect {
*** 442,448 ****
send_gdb "next\n"
gdb_expect {
! -re ".*81\[ \t\]*marker1.*$gdb_prompt $"\
{pass "step after continue with ignore count"}
-re "$gdb_prompt $"\
{fail "step after continue with ignore count"}
--- 462,468 ----
send_gdb "next\n"
gdb_expect {
! -re ".*$bp_location11\[ \t\]*marker1.*$gdb_prompt $"\
{pass "step after continue with ignore count"}
-re "$gdb_prompt $"\
{fail "step after continue with ignore count"}
Index: gdb.base/info-proc.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/info-proc.exp,v
retrieving revision 1.1
diff -c -p -r1.1 info-proc.exp
*** gdb.base/info-proc.exp 5 Jan 2002 02:44:07 -0000 1.1
--- gdb.base/info-proc.exp 7 Dec 2003 21:14:48 -0000
*************** if $tracelevel then {
*** 27,38 ****
set prms_id 0
set bug_id 0
- set testfile "break"
- set srcfile ${testfile}.c
- set binfile ${objdir}/${subdir}/${testfile}
set ws "\[ \t\]+"
! 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."
}
--- 27,48 ----
set prms_id 0
set bug_id 0
set ws "\[ \t\]+"
! set testfile "break"
! set srcfile ${testfile}.c
! set srcfile1 ${testfile}1.c
! set binfile ${objdir}/${subdir}/${testfile}
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
Index: gdb.base/maint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/maint.exp,v
retrieving revision 1.20
diff -c -p -r1.20 maint.exp
*** gdb.base/maint.exp 20 Nov 2003 15:36:34 -0000 1.20
--- gdb.base/maint.exp 7 Dec 2003 21:14:49 -0000
*************** set bug_id 0
*** 65,74 ****
set testfile "break"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != ""
! } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
--- 65,83 ----
set testfile "break"
set srcfile ${testfile}.c
+ set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
*************** gdb_expect {
*** 412,422 ****
timeout { fail "(timeout) maint info sections DATA" }
}
send_gdb "maint info breakpoints\n"
gdb_expect {
! -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex\[ \t\]+in main at.*break.c:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\
{ pass "maint info breakpoints" }
! -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n-1\[ \t\]+shlib events\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex.*breakpoint already hit.*$gdb_prompt $"\
{ pass "maint info breakpoints (with shlib events)" }
-re ".*$gdb_prompt $" { fail "maint info breakpoints" }
timeout { fail "(timeout) maint info breakpoints" }
--- 421,433 ----
timeout { fail "(timeout) maint info sections DATA" }
}
+ set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
+
send_gdb "maint info breakpoints\n"
gdb_expect {
! -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex\[ \t\]+in main at.*break.c:$bp_location6\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\
{ pass "maint info breakpoints" }
! -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:$bp_location6\r\n\[ \t\]+breakpoint already hit 1 time\r\n-1\[ \t\]+shlib events\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex.*breakpoint already hit.*$gdb_prompt $"\
{ pass "maint info breakpoints (with shlib events)" }
-re ".*$gdb_prompt $" { fail "maint info breakpoints" }
timeout { fail "(timeout) maint info breakpoints" }
Index: gdb.base/until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/until.exp,v
retrieving revision 1.3
diff -c -p -r1.3 until.exp
*** gdb.base/until.exp 3 Feb 2003 16:04:18 -0000 1.3
--- gdb.base/until.exp 7 Dec 2003 21:14:49 -0000
*************** if $tracelevel then {
*** 23,35 ****
strace $tracelevel
}
! set testfile break
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! remote_exec build "rm -f ${binfile}"
! 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."
}
gdb_exit
--- 23,43 ----
strace $tracelevel
}
! set testfile "break"
set srcfile ${testfile}.c
+ set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
gdb_exit
*************** gdb_start
*** 37,42 ****
--- 45,55 ----
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
+ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
+ set bp_location19 [gdb_get_line_number "set breakpoint 19 here"]
+ set bp_location20 [gdb_get_line_number "set breakpoint 20 here"]
+ set bp_location21 [gdb_get_line_number "set breakpoint 21 here"]
+
if ![runto_main] then {
fail "Can't run to main"
return 0
*************** if ![runto_main] then {
*** 45,52 ****
# Verify that "until <location>" works. (This is really just syntactic
# sugar for "tbreak <location>; continue".)
#
! gdb_test "until 79" \
! "main .* at .*:79.*" \
"until line number"
# Verify that a malformed "advance" is gracefully caught.
--- 58,65 ----
# Verify that "until <location>" works. (This is really just syntactic
# sugar for "tbreak <location>; continue".)
#
! gdb_test "until $bp_location1" \
! "main .* at .*:$bp_location1.*" \
"until line number"
# Verify that a malformed "advance" is gracefully caught.
*************** delete_breakpoints
*** 62,69 ****
# inner invocations of factorial() are completed and we are back at this
# frame.
#
! gdb_test "until 99" \
! "factorial.*value=720.*at.*${srcfile}:99.*return \\(value\\)." \
"until factorial, recursive function"
# Run to a function called by main
--- 75,82 ----
# inner invocations of factorial() are completed and we are back at this
# frame.
#
! gdb_test "until $bp_location19" \
! "factorial.*value=720.*at.*${srcfile}:$bp_location19.*return \\(value\\).*" \
"until factorial, recursive function"
# Run to a function called by main
*************** delete_breakpoints
*** 76,81 ****
# 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\\)|83.*marker3 \\(.stack., .trace.\\))." \
"until func, not called by current frame"
--- 89,94 ----
# stop at main, the caller, where we put the 'guard' breakpoint.
#
gdb_test "until marker3" \
! "($hex in |)main.*argc.*argv.*envp.*at.*${srcfile}:($bp_location20.*marker2 \\(43\\)|$bp_location21.*marker3 \\(.stack., .trace.\\)).*" \
"until func, not called by current frame"
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test (revised patch)
2003-12-07 21:21 ` [PATCH] Outwit compiler dead code elimination in break.exp test (revised patch) Fred Fish
@ 2003-12-08 0:31 ` Andrew Cagney
0 siblings, 0 replies; 20+ messages in thread
From: Andrew Cagney @ 2003-12-08 0:31 UTC (permalink / raw)
To: fnf; +Cc: gdb-patches
> On Monday 01 December 2003 10:52, Andrew Cagney wrote:
>
>> As for stopping GCC from eliminating code - last time this came up (ref
>> store.exp) it was recommended that the .c files be split so that GCC
>> couldn't see the potential optimization.
>
>
> OK. I've revised the patch to split the source file. This is
> pretty ugly though as there are a half dozen tests that have
> to be modified to accomodate two source files.
>
> I've attached the patch for review/approval.
Wow, thanks for doing this! I was thinking that just one test needed
changes. Anyway, perhaphs wait for michaelc to put it through his test
harness before committing.
Andrew
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-12-01 18:10 ` Fred Fish
@ 2003-12-09 1:02 ` Michael Snyder
0 siblings, 0 replies; 20+ messages in thread
From: Michael Snyder @ 2003-12-09 1:02 UTC (permalink / raw)
To: Fred Fish; +Cc: Andrew Cagney, fnf, gdb-patches
Fred Fish wrote:
>>I know that GCC will now, when -O is specified, inline (and thence
>>eliminate) pure functions. However, I don't think that should occure
>>when -O isn't specified.
>
>
> It doesn't. The gdb specifically uses optimization for the test that
> is currently failing:
>
> FAIL: gdb.base/break.exp: run until breakpoint set at small function, optimized file
Ah. And I was gonna say "GCC shouldn't do that without optimization
turned on". Never mind, I guess...
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-12-09 6:52 Michael Elizabeth Chastain
@ 2003-12-29 20:20 ` Elena Zannoni
0 siblings, 0 replies; 20+ messages in thread
From: Elena Zannoni @ 2003-12-29 20:20 UTC (permalink / raw)
To: Michael Elizabeth Chastain; +Cc: fnf, ac131313, gdb-patches
Michael Elizabeth Chastain writes:
> It works for me. My before-and-after tests came out clean again; all
> the copyright dates look good; and the comment about the separate file
> is exactly what I wanted.
>
> Endorsed for approval.
>
> (I'm trying to come up with some word that means "I don't have approval
> authority but I'll vouch for this patch" ... "endorsed"? "recommended"?)
>
I can rubberstamp it. However Fred could self approve it too.
elena
> Michael C
>
> ===
>
> 2003-12-07 Fred Fish <fnf@redhat.com>
>
> * gdb.base/break.c (marker1, marker2, marker3, marker4): Move
> functions to break1.c and leave prototypes behind. Add more
> "set breakpoint NN here" comments.
> * gdb.base/break1.c: New file.
>
> * gdb.base/break.exp: Handle compiling test case from multiple
> source files and change source file references as needed.
> * gdb.base/completion.exp: Ditto.
> * gdb.base/condbreak.exp: Ditto.
> * gdb.base/define.exp: Ditto.
> * gdb.base/ena-dis-br.exp: Ditto.
> * gdb.base/info-proc.exp: Ditto.
> * gdb.base/maint.exp: Ditto.
> * gdb.base/until.exp: Ditto.
>
> * gdb.base/condbreak.exp: Use bp_locationNN variables instead of
> hardcoded line numbers.
> * gdb.base/define.exp: Ditto.
> * gdb.base/ena-dis-br.exp: Ditto.
> * gdb.base/maint.exp: Ditto.
> * gdb.base/until.exp: Ditto.
>
> * gdb.base/completion.exp: Use "break1" for completion tests since
> "break" is no longer a unique prefix.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
@ 2003-12-09 6:52 Michael Elizabeth Chastain
2003-12-29 20:20 ` Elena Zannoni
0 siblings, 1 reply; 20+ messages in thread
From: Michael Elizabeth Chastain @ 2003-12-09 6:52 UTC (permalink / raw)
To: fnf; +Cc: ac131313, gdb-patches
It works for me. My before-and-after tests came out clean again; all
the copyright dates look good; and the comment about the separate file
is exactly what I wanted.
Endorsed for approval.
(I'm trying to come up with some word that means "I don't have approval
authority but I'll vouch for this patch" ... "endorsed"? "recommended"?)
Michael C
===
2003-12-07 Fred Fish <fnf@redhat.com>
* gdb.base/break.c (marker1, marker2, marker3, marker4): Move
functions to break1.c and leave prototypes behind. Add more
"set breakpoint NN here" comments.
* gdb.base/break1.c: New file.
* gdb.base/break.exp: Handle compiling test case from multiple
source files and change source file references as needed.
* gdb.base/completion.exp: Ditto.
* gdb.base/condbreak.exp: Ditto.
* gdb.base/define.exp: Ditto.
* gdb.base/ena-dis-br.exp: Ditto.
* gdb.base/info-proc.exp: Ditto.
* gdb.base/maint.exp: Ditto.
* gdb.base/until.exp: Ditto.
* gdb.base/condbreak.exp: Use bp_locationNN variables instead of
hardcoded line numbers.
* gdb.base/define.exp: Ditto.
* gdb.base/ena-dis-br.exp: Ditto.
* gdb.base/maint.exp: Ditto.
* gdb.base/until.exp: Ditto.
* gdb.base/completion.exp: Use "break1" for completion tests since
"break" is no longer a unique prefix.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
2003-12-08 23:49 [PATCH] Outwit compiler dead code elimination in break.exp test (revised patch) Andrew Cagney
@ 2003-12-09 5:06 ` Fred Fish
0 siblings, 0 replies; 20+ messages in thread
From: Fred Fish @ 2003-12-09 5:06 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Michael Elizabeth Chastain, fnf, gdb-patches
> Fred, in case you're wondering, one of the Red Hat chores is to, on
> demand, track down the pre-history of files with no copyright
> status.
Got it. Here is a revised patch which I believe addresses the
previously posted issues. OK to commit?
-Fred
===================================================================
2003-12-07 Fred Fish <fnf@redhat.com>
* gdb.base/break.c (marker1, marker2, marker3, marker4): Move
functions to break1.c and leave prototypes behind. Add more
"set breakpoint NN here" comments.
* gdb.base/break1.c: New file.
* gdb.base/break.exp: Handle compiling test case from multiple
source files and change source file references as needed.
* gdb.base/completion.exp: Ditto.
* gdb.base/condbreak.exp: Ditto.
* gdb.base/define.exp: Ditto.
* gdb.base/ena-dis-br.exp: Ditto.
* gdb.base/info-proc.exp: Ditto.
* gdb.base/maint.exp: Ditto.
* gdb.base/until.exp: Ditto.
* gdb.base/condbreak.exp: Use bp_locationNN variables instead of
hardcoded line numbers.
* gdb.base/define.exp: Ditto.
* gdb.base/ena-dis-br.exp: Ditto.
* gdb.base/maint.exp: Ditto.
* gdb.base/until.exp: Ditto.
* gdb.base/completion.exp: Use "break1" for completion tests since
"break" is no longer a unique prefix.
Index: gdb.base/break.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.c,v
retrieving revision 1.3
diff -c -p -r1.3 break.c
*** gdb.base/break.c 13 Nov 2003 15:34:39 -0000 1.3
--- gdb.base/break.c 9 Dec 2003 04:52:43 -0000
***************
*** 1,3 ****
--- 1,25 ----
+ /* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 1992, 1993, 1994, 1995, 1999, 2002, 2003 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
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
#ifdef vxworks
# include <stdio.h>
*************** char *arg;
*** 32,54 ****
# include <stdlib.h>
#endif /* ! vxworks */
- /*
- * The following functions do nothing useful. They are included simply
- * as places to try setting breakpoints at. They are explicitly
- * "one-line functions" to verify that this case works (some versions
- * of gcc have or have had problems with this).
- */
-
#ifdef PROTOTYPES
! int marker1 (void) { return (0); }
! int marker2 (int a) { return (1); } /* set breakpoint 8 here */
! void marker3 (char *a, char *b) {}
! void marker4 (long d) {} /* set breakpoint 14 here */
#else
! int marker1 () { return (0); }
! int marker2 (a) int a; { return (1); } /* set breakpoint 9 here */
! void marker3 (a, b) char *a, *b; {}
! void marker4 (d) long d; {} /* set breakpoint 13 here */
#endif
/*
--- 54,69 ----
# include <stdlib.h>
#endif /* ! vxworks */
#ifdef PROTOTYPES
! extern int marker1 (void);
! extern int marker2 (int a);
! extern void marker3 (char *a, char *b);
! extern void marker4 (long d);
#else
! extern int marker1 ();
! extern int marker2 ();
! extern void marker3 ();
! extern void marker4 ();
#endif
/*
*************** char *argv[], **envp;
*** 79,86 ****
printf ("%d\n", factorial (atoi ("6"))); /* set breakpoint 1 here */
/* set breakpoint 12 here */
marker1 (); /* set breakpoint 11 here */
! marker2 (43);
! marker3 ("stack", "trace");
marker4 (177601976L);
argc = (argc == 12345); /* This is silly, but we can step off of it */ /* set breakpoint 2 here */
return argc; /* set breakpoint 10 here */
--- 94,101 ----
printf ("%d\n", factorial (atoi ("6"))); /* set breakpoint 1 here */
/* set breakpoint 12 here */
marker1 (); /* set breakpoint 11 here */
! marker2 (43); /* set breakpoint 20 here */
! marker3 ("stack", "trace"); /* set breakpoint 21 here */
marker4 (177601976L);
argc = (argc == 12345); /* This is silly, but we can step off of it */ /* set breakpoint 2 here */
return argc; /* set breakpoint 10 here */
*************** int value;
*** 96,102 ****
if (value > 1) { /* set breakpoint 7 here */
value *= factorial (value - 1);
}
! return (value);
}
#ifdef PROTOTYPES
--- 111,117 ----
if (value > 1) { /* set breakpoint 7 here */
value *= factorial (value - 1);
}
! return (value); /* set breakpoint 19 here */
}
#ifdef PROTOTYPES
Index: gdb.base/break1.c
===================================================================
*** /dev/null 2003-01-30 03:24:37.000000000 -0700
--- gdb.base/break1.c 2003-12-08 21:48:38.000000000 -0700
***************
*** 0 ****
--- 1,44 ----
+ /* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 1992, 1993, 1994, 1995, 1999, 2002, 2003 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
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+ /* The code for this file was extracted from the gdb testsuite
+ testcase "break.c". */
+
+ /* The following functions do nothing useful. They are included
+ simply as places to try setting breakpoints at. They are
+ explicitly "one-line functions" to verify that this case works
+ (some versions of gcc have or have had problems with this).
+
+ These functions are in a separate source file to prevent an
+ optimizing compiler from inlining them and optimizing them away. */
+
+ #ifdef PROTOTYPES
+ int marker1 (void) { return (0); } /* set breakpoint 15 here */
+ int marker2 (int a) { return (1); } /* set breakpoint 8 here */
+ void marker3 (char *a, char *b) {} /* set breakpoint 17 here */
+ void marker4 (long d) {} /* set breakpoint 14 here */
+ #else
+ int marker1 () { return (0); } /* set breakpoint 16 here */
+ int marker2 (a) int a; { return (1); } /* set breakpoint 9 here */
+ void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */
+ void marker4 (d) long d; {} /* set breakpoint 13 here */
+ #endif
Index: gdb.base/break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.exp,v
retrieving revision 1.18
diff -c -p -r1.18 break.exp
*** gdb.base/break.exp 13 Nov 2003 15:34:39 -0000 1.18
--- gdb.base/break.exp 9 Dec 2003 04:52:44 -0000
*************** set bug_id 0
*** 34,43 ****
set testfile "break"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfile}] {
--- 34,52 ----
set testfile "break"
set srcfile ${testfile}.c
+ set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfile}] {
*************** gdb_test "break main" \
*** 87,93 ****
# test break at quoted function
#
gdb_test "break \"marker2\"" \
! "Breakpoint.*at.* file .*$srcfile, line.*" \
"breakpoint quoted function"
#
--- 96,102 ----
# test break at quoted function
#
gdb_test "break \"marker2\"" \
! "Breakpoint.*at.* file .*$srcfile1, line.*" \
"breakpoint quoted function"
#
*************** if {$hp_aCC_compiler} {
*** 165,177 ****
}
set bp_location7 [gdb_get_line_number "set breakpoint 7 here"]
! set bp_location8 [gdb_get_line_number "set breakpoint 8 here"]
! set bp_location9 [gdb_get_line_number "set breakpoint 9 here"]
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker2 at .*$srcfile:($bp_location8|$bp_location9).*
\[0-9\]+\[\t \]+breakpoint keep y.* in factorial$proto at .*$srcfile:$bp_location7.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.*
--- 174,186 ----
}
set bp_location7 [gdb_get_line_number "set breakpoint 7 here"]
! set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
! set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1]
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker2 at .*$srcfile1:($bp_location8|$bp_location9).*
\[0-9\]+\[\t \]+breakpoint keep y.* in factorial$proto at .*$srcfile:$bp_location7.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.*
*************** for {set i 6} {$i >= 1} {incr i -1} {
*** 232,238 ****
#
# Run until the breakpoint set at a quoted function
#
! gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, (0x\[0-9a-f\]+ in )?marker2 \\(a=43\\) at .*$srcfile:($bp_location8|$bp_location9).*" \
"run until quoted breakpoint"
#
# run until the file:function breakpoint at a line number in a file
--- 241,247 ----
#
# Run until the breakpoint set at a quoted function
#
! gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, (0x\[0-9a-f\]+ in )?marker2 \\(a=43\\) at .*$srcfile1:($bp_location8|$bp_location9).*" \
"run until quoted breakpoint"
#
# run until the file:function breakpoint at a line number in a file
*************** gdb_expect {
*** 393,399 ****
# Run to the desired default location. If not positioned here, the
# tests below don't work.
#
! gdb_test "until $bp_location1" "main .* at .*:$bp_location1.*" "until $bp_location1"
# Verify that GDB allows one to just say "break", which is treated
--- 402,408 ----
# Run to the desired default location. If not positioned here, the
# tests below don't work.
#
! gdb_test "until $bp_location1" "main .* at .*:$bp_location1.*" "until bp_location1"
# Verify that GDB allows one to just say "break", which is treated
*************** if ![runto_main] then { fail "break test
*** 445,454 ****
send_gdb "break $bp_location1\n"
gdb_expect {
-re "Breakpoint (\[0-9\]*) at .*, line $bp_location1.*$gdb_prompt $"\
! {pass "set to-be-silent break $bp_location1"}
-re "$gdb_prompt $"\
! {fail "set to-be-silent break $bp_location1"}
! timeout {fail "(timeout) set to-be-silent break $bp_location1"}
}
send_gdb "commands $expect_out(1,string)\n"
--- 454,463 ----
send_gdb "break $bp_location1\n"
gdb_expect {
-re "Breakpoint (\[0-9\]*) at .*, line $bp_location1.*$gdb_prompt $"\
! {pass "set to-be-silent break bp_location1"}
-re "$gdb_prompt $"\
! {fail "set to-be-silent break bp_location1"}
! timeout {fail "(timeout) set to-be-silent break bp_location1"}
}
send_gdb "commands $expect_out(1,string)\n"
*************** send_gdb "silent\n"
*** 456,488 ****
send_gdb "end\n"
gdb_expect {
-re ".*$gdb_prompt $"\
! {pass "set silent break $bp_location1"}
! timeout {fail "(timeout) set silent break $bp_location1"}
}
send_gdb "info break $expect_out(1,string)\n"
gdb_expect {
-re "\[0-9\]*\[ \t\]*breakpoint.*:$bp_location1\r\n\[ \t\]*silent.*$gdb_prompt $"\
! {pass "info silent break $bp_location1"}
-re "$gdb_prompt $"\
! {fail "info silent break $bp_location1"}
! timeout {fail "(timeout) info silent break $bp_location1"}
}
send_gdb "continue\n"
gdb_expect {
-re "Continuing.\r\n$gdb_prompt $"\
! {pass "hit silent break $bp_location1"}
-re "$gdb_prompt $"\
! {fail "hit silent break $bp_location1"}
! timeout {fail "(timeout) hit silent break $bp_location1"}
}
send_gdb "bt\n"
gdb_expect {
-re "#0 main .* at .*:$bp_location1.*$gdb_prompt $"\
! {pass "stopped for silent break $bp_location1"}
-re "$gdb_prompt $"\
! {fail "stopped for silent break $bp_location1"}
! timeout {fail "(timeout) stopped for silent break $bp_location1"}
}
# Verify that GDB can at least parse a breakpoint with the
--- 465,497 ----
send_gdb "end\n"
gdb_expect {
-re ".*$gdb_prompt $"\
! {pass "set silent break bp_location1"}
! timeout {fail "(timeout) set silent break bp_location1"}
}
send_gdb "info break $expect_out(1,string)\n"
gdb_expect {
-re "\[0-9\]*\[ \t\]*breakpoint.*:$bp_location1\r\n\[ \t\]*silent.*$gdb_prompt $"\
! {pass "info silent break bp_location1"}
-re "$gdb_prompt $"\
! {fail "info silent break bp_location1"}
! timeout {fail "(timeout) info silent break bp_location1"}
}
send_gdb "continue\n"
gdb_expect {
-re "Continuing.\r\n$gdb_prompt $"\
! {pass "hit silent break bp_location1"}
-re "$gdb_prompt $"\
! {fail "hit silent break bp_location1"}
! timeout {fail "(timeout) hit silent break bp_location1"}
}
send_gdb "bt\n"
gdb_expect {
-re "#0 main .* at .*:$bp_location1.*$gdb_prompt $"\
! {pass "stopped for silent break bp_location1"}
-re "$gdb_prompt $"\
! {fail "stopped for silent break bp_location1"}
! timeout {fail "(timeout) stopped for silent break bp_location1"}
}
# Verify that GDB can at least parse a breakpoint with the
*************** gdb_test "clear marker3" {Deleted breakp
*** 561,568 ****
send_gdb "set \$foo=$bp_location11\n"
gdb_expect {
-re "$gdb_prompt $"\
! {pass "set convenience variable \$foo to $bp_location11"}
! timeout {fail "(timeout) set convenience variable \$foo to $bp_location11"}
}
send_gdb "break \$foo\n"
gdb_expect {
--- 570,577 ----
send_gdb "set \$foo=$bp_location11\n"
gdb_expect {
-re "$gdb_prompt $"\
! {pass "set convenience variable \$foo to bp_location11"}
! timeout {fail "(timeout) set convenience variable \$foo to bp_location11"}
}
send_gdb "break \$foo\n"
gdb_expect {
*************** test_next_with_recursion
*** 849,856 ****
set binfileo2 ${objdir}/${subdir}/${testfile}o2
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfileo2}" executable {debug additional_flags="-O2" }] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfileo2}] {
--- 858,873 ----
set binfileo2 ${objdir}/${subdir}/${testfile}o2
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}O0.o" object {debug "additional_flags=-w -O2"}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}O1.o" object {debug "additional_flags=-w -O2"}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}O0.o ${binfile}O1.o" "${binfileo2}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfileo2}] {
*************** gdb_test "break main" \
*** 877,883 ****
# test break at function
#
gdb_test "break marker4" \
! "Breakpoint.*at.* file .*$srcfile, line.*" \
"breakpoint small function, optimized file"
#
--- 894,900 ----
# test break at function
#
gdb_test "break marker4" \
! "Breakpoint.*at.* file .*$srcfile1, line.*" \
"breakpoint small function, optimized file"
#
*************** if ![target_info exists use_gdb_stub] {
*** 922,940 ****
# has no exactly matching line symbol, and GDB reports the breakpoint
# as if it were in the middle of a line rather than at the beginning.
! set bp_location13 [gdb_get_line_number "set breakpoint 13 here"]
! set bp_location14 [gdb_get_line_number "set breakpoint 14 here"]
send_gdb "continue\n"
gdb_expect {
! -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
pass "run until breakpoint set at small function, optimized file"
}
! -re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
pass "run until breakpoint set at small function, optimized file"
}
! -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:$bp_location14\[\r\n\]+$bp_location14\[\t \]+void marker4.*" {
# marker4() is defined at line 46 when compiled with -DPROTOTYPES
! pass "run until breakpoint set at small function, optimized file (line $bp_location14)"
}
-re ".*$gdb_prompt " {
fail "run until breakpoint set at small function, optimized file"
--- 939,957 ----
# has no exactly matching line symbol, and GDB reports the breakpoint
# as if it were in the middle of a line rather than at the beginning.
! set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile1]
! set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile1]
send_gdb "continue\n"
gdb_expect {
! -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile1:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
pass "run until breakpoint set at small function, optimized file"
}
! -re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile1:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
pass "run until breakpoint set at small function, optimized file"
}
! -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile1:$bp_location14\[\r\n\]+$bp_location14\[\t \]+void marker4.*" {
# marker4() is defined at line 46 when compiled with -DPROTOTYPES
! pass "run until breakpoint set at small function, optimized file (line bp_location14)"
}
-re ".*$gdb_prompt " {
fail "run until breakpoint set at small function, optimized file"
Index: gdb.base/completion.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/completion.exp,v
retrieving revision 1.18
diff -c -p -r1.18 completion.exp
*** gdb.base/completion.exp 7 Aug 2003 17:58:44 -0000 1.18
--- gdb.base/completion.exp 9 Dec 2003 04:52:45 -0000
***************
*** 38,45 ****
# "info ajksdlfk " no completions
# "info" " "
# "info " ambiguous (all info commands)
! # "p \"break" unambiguous (completes to filename "break.c")
! # "p \"break." unambiguous (should complete to "break.c" but does not,
# due to readline limitations)
# "p 'a" ambiguous (all symbols starting with a)
# "p b-a" ambiguous (all symbols starting with a)
--- 38,45 ----
# "info ajksdlfk " no completions
# "info" " "
# "info " ambiguous (all info commands)
! # "p \"break1" unambiguous (completes to filename "break1.c")
! # "p \"break1." unambiguous (should complete to "break1.c" but does not,
# due to readline limitations)
# "p 'a" ambiguous (all symbols starting with a)
# "p b-a" ambiguous (all symbols starting with a)
*************** set bug_id 0
*** 64,72 ****
set testfile "break"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfile}] {
--- 64,82 ----
set testfile "break"
set srcfile ${testfile}.c
+ set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfile}] {
*************** gdb_expect {
*** 351,411 ****
}
! send_gdb "p \"break\t"
sleep 1
gdb_expect {
! -re "^p \"break\\\x07$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break'"}
! timeout {fail "(timeout) complete 'p \"break'"}
}
}
! -re "^p \"break\\.c\"$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { pass "complete 'p \"break'"}
! timeout {fail "(timeout) complete 'p \"break'"}
}
}
! -re "^p \"break.*$"
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break'"}
! timeout {fail "(timeout) complete 'p \"break'"}
}
}
! -re ".*$gdb_prompt $" { fail "complete 'p \"break'" }
! timeout { fail "(timeout) complete 'p \"break'" }
}
setup_xfail "*-*-*"
! send_gdb "p \"break.\t"
sleep 1
gdb_expect {
! -re "^p \"break\\.\\\x07$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break.'"}
! timeout {fail "(timeout) complete 'p \"break.'"}
}
}
! -re "^p \"break\\.c\"$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { pass "complete 'p \"break.'"}
! timeout {fail "(timeout) complete 'p \"break.'"}
}
}
! -re "^p \"break\\..*$"
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break.'"}
! timeout {fail "(timeout) complete 'p \"break.'"}
}
}
! -re ".*$gdb_prompt $" { fail "complete 'p \"break.'" }
! timeout { fail "(timeout) complete 'p \"break.'" }
}
send_gdb "p 'a\t"
--- 361,421 ----
}
! send_gdb "p \"break1\t"
sleep 1
gdb_expect {
! -re "^p \"break1\\\x07$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break1'"}
! timeout {fail "(timeout) complete 'p \"break1'"}
}
}
! -re "^p \"break1\\.c\"$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { pass "complete 'p \"break1'"}
! timeout {fail "(timeout) complete 'p \"break1'"}
}
}
! -re "^p \"break1.*$"
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break1'"}
! timeout {fail "(timeout) complete 'p \"break1'"}
}
}
! -re ".*$gdb_prompt $" { fail "complete 'p \"break1'" }
! timeout { fail "(timeout) complete 'p \"break1'" }
}
setup_xfail "*-*-*"
! send_gdb "p \"break1.\t"
sleep 1
gdb_expect {
! -re "^p \"break1\\.\\\x07$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'"}
! timeout {fail "(timeout) complete 'p \"break1.'"}
}
}
! -re "^p \"break1\\.c\"$"\
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { pass "complete 'p \"break1.'"}
! timeout {fail "(timeout) complete 'p \"break1.'"}
}
}
! -re "^p \"break1\\..*$"
{ send_gdb "\n"
gdb_expect {
! -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'"}
! timeout {fail "(timeout) complete 'p \"break1.'"}
}
}
! -re ".*$gdb_prompt $" { fail "complete 'p \"break1.'" }
! timeout { fail "(timeout) complete 'p \"break1.'" }
}
send_gdb "p 'a\t"
*************** gdb_expect {
*** 682,688 ****
-re "marker1.*$gdb_prompt info func marker$"\
{ send_gdb "\n"
gdb_expect {
! -re "All functions matching regular expression \"marker\":.*File.*break.c:\r\nint marker1\\((void|)\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long int\\);.*$gdb_prompt $"\
{ pass "complete 'info func marke'"}
-re ".*$gdb_prompt $" { fail "complete 'info func marke'"}
timeout {fail "(timeout) complete 'info func marke'"}
--- 692,698 ----
-re "marker1.*$gdb_prompt info func marker$"\
{ send_gdb "\n"
gdb_expect {
! -re "All functions matching regular expression \"marker\":.*File.*break1.c:\r\nint marker1\\((void|)\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long int\\);.*$gdb_prompt $"\
{ pass "complete 'info func marke'"}
-re ".*$gdb_prompt $" { fail "complete 'info func marke'"}
timeout {fail "(timeout) complete 'info func marke'"}
Index: gdb.base/condbreak.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/condbreak.exp,v
retrieving revision 1.3
diff -c -p -r1.3 condbreak.exp
*** gdb.base/condbreak.exp 23 May 2001 19:04:13 -0000 1.3
--- gdb.base/condbreak.exp 9 Dec 2003 04:52:45 -0000
***************
*** 1,4 ****
! # Copyright 1997, 1998, 1999, 2000, 2001 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,4 ----
! # Copyright 1997, 1998, 1999, 2000, 2001, 2003 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
***************
*** 12,18 ****
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
! # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
--- 12,18 ----
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
! # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
*************** set bug_id 0
*** 35,44 ****
set testfile "break"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfile}] {
--- 35,53 ----
set testfile "break"
set srcfile ${testfile}.c
+ set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
if [get_compiler_info ${binfile}] {
*************** if [target_info exists gdb_stub] {
*** 55,60 ****
--- 64,76 ----
gdb_step_for_stub;
}
+ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
+ set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
+ set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
+ set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1]
+ set bp_location15 [gdb_get_line_number "set breakpoint 15 here" $srcfile1]
+ set bp_location16 [gdb_get_line_number "set breakpoint 16 here" $srcfile1]
+
#
# test break at function
#
*************** gdb_test "break main" \
*** 66,80 ****
# test conditional break at function
#
gdb_test "break marker1 if 1==1" \
! "Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "delete 2" ""
#
# test conditional break at line number
#
! gdb_test "break 79 if 1==1" \
! "Breakpoint.*at.* file .*$srcfile, line 79\\."
gdb_test "delete 3" ""
--- 82,96 ----
# test conditional break at function
#
gdb_test "break marker1 if 1==1" \
! "Breakpoint.*at.* file .*$srcfile1, line.*"
gdb_test "delete 2" ""
#
# test conditional break at line number
#
! gdb_test "break $srcfile:$bp_location1 if 1==1" \
! "Breakpoint.*at.* file .*$srcfile, line $bp_location1\\."
gdb_test "delete 3" ""
*************** gdb_test "delete 3" ""
*** 82,97 ****
# test conditional break at function
#
gdb_test "break marker1 if (1==1)" \
! "Breakpoint.*at.* file .*$srcfile, line.*"
#
# test conditional break at line number
#
! gdb_test "break 79 if (1==1)" \
! "Breakpoint.*at.* file .*$srcfile, line 79\\."
gdb_test "break marker2 if (a==43)" \
! "Breakpoint.*at.* file .*$srcfile, line.*"
#
# check to see what breakpoints are set
--- 98,113 ----
# test conditional break at function
#
gdb_test "break marker1 if (1==1)" \
! "Breakpoint.*at.* file .*$srcfile1, line.*"
#
# test conditional break at line number
#
! gdb_test "break $srcfile:$bp_location1 if (1==1)" \
! "Breakpoint.*at.* file .*$srcfile, line $bp_location1\\."
gdb_test "break marker2 if (a==43)" \
! "Breakpoint.*at.* file .*$srcfile1, line.*"
#
# check to see what breakpoints are set
*************** if {$hp_aCC_compiler} {
*** 105,119 ****
set marker2_proto ""
}
- set main_line 75
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker1$marker1_proto at .*$srcfile:4\[38\].*
\[\t \]+stop only if 1 == 1.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:79.*
\[\t \]+stop only if 1 == 1.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker2$marker2_proto at .*$srcfile:4\[49\].*
\[\t \]+stop only if a == 43.*" \
"breakpoint info"
--- 121,134 ----
set marker2_proto ""
}
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location6.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker1$marker1_proto at .*$srcfile1:($bp_location15|$bp_location16).*
\[\t \]+stop only if 1 == 1.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.*
\[\t \]+stop only if 1 == 1.*
! \[0-9\]+\[\t \]+breakpoint keep y.* in marker2$marker2_proto at .*$srcfile1:($bp_location8|$bp_location9).*
\[\t \]+stop only if a == 43.*" \
"breakpoint info"
*************** rerun_to_main
*** 128,134 ****
#
# run until the breakpoint at a line number
#
! gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:79.*79\[\t \]+printf.*factorial.*" \
"run until breakpoint set at a line number"
#
--- 143,149 ----
#
# run until the breakpoint at a line number
#
! gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location1.*$bp_location1\[\t \]+printf.*factorial.*" \
"run until breakpoint set at a line number"
#
*************** gdb_test "continue" "Continuing\\..*Brea
*** 173,182 ****
# Until the Dwarf2 writer gets fixed, I'm going to XFAIL its behavior.
send_gdb "continue\n"
gdb_expect {
! -re "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile:4\[38\].*4\[38\]\[\t \]+.*$gdb_prompt $" {
pass "run until breakpoint at marker1"
}
! -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker1 \\(\\) at .*$srcfile:4\[38\].*4\[38\]\[\t \]+.*$gdb_prompt $" {
xfail "run until breakpoint at marker1"
}
-re "$gdb_prompt $" {
--- 188,197 ----
# Until the Dwarf2 writer gets fixed, I'm going to XFAIL its behavior.
send_gdb "continue\n"
gdb_expect {
! -re "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile1:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.*$gdb_prompt $" {
pass "run until breakpoint at marker1"
}
! -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker1 \\(\\) at .*$srcfile1:($bp_location15|$bp_location16).*($bp_location15|$bp_location16)\[\t \]+.*$gdb_prompt $" {
xfail "run until breakpoint at marker1"
}
-re "$gdb_prompt $" {
*************** gdb_expect {
*** 192,201 ****
setup_xfail hppa2.0w-*-* 11512CLLbs
send_gdb "continue\n"
gdb_expect {
! -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile:4\[49\].*4\[49\]\[\t \]+.*" {
pass "run until breakpoint at marker2"
}
! -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=43\\) at .*$srcfile:4\[49\].*4\[49\]\[\t \]+.*" {
xfail "run until breakpoint at marker2"
}
-re "$gdb_prompt $" {
--- 207,216 ----
setup_xfail hppa2.0w-*-* 11512CLLbs
send_gdb "continue\n"
gdb_expect {
! -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile1:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+.*" {
pass "run until breakpoint at marker2"
}
! -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=43\\) at .*$srcfile1:($bp_location8|$bp_location9).*($bp_location8|$bp_location9)\[\t \]+.*" {
xfail "run until breakpoint at marker2"
}
-re "$gdb_prompt $" {
Index: gdb.base/define.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/define.exp,v
retrieving revision 1.3
diff -c -p -r1.3 define.exp
*** gdb.base/define.exp 23 May 2001 19:04:13 -0000 1.3
--- gdb.base/define.exp 9 Dec 2003 04:52:46 -0000
***************
*** 1,4 ****
! # Copyright 1998, 1999, 2001 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,4 ----
! # Copyright 1998, 1999, 2001, 2003 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
***************
*** 12,18 ****
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
! # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
--- 12,18 ----
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
! # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
*************** set bug_id 0
*** 34,43 ****
set testfile "break"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
gdb_exit
--- 34,52 ----
set testfile "break"
set srcfile ${testfile}.c
+ set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
gdb_exit
*************** gdb_start
*** 45,50 ****
--- 54,62 ----
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
+ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
+ set bp_location11 [gdb_get_line_number "set breakpoint 11 here"]
+
if ![runto_main] then { fail "define tests suppressed" }
# Verify that GDB allows a user to define their very own commands.
*************** gdb_expect {
*** 68,74 ****
#
send_gdb "nextwhere\n"
gdb_expect {
! -re ".*79\[ \t\]*printf.*#0\[ \t\]*main.*:79.*$gdb_prompt $"\
{pass "use user command: nextwhere"}
-re "$gdb_prompt $"\
{fail "use user command: nextwhere"}
--- 80,86 ----
#
send_gdb "nextwhere\n"
gdb_expect {
! -re ".*$bp_location1\[ \t\]*printf.*#0\[ \t\]*main.*:$bp_location1.*$gdb_prompt $"\
{pass "use user command: nextwhere"}
-re "$gdb_prompt $"\
{fail "use user command: nextwhere"}
*************** gdb_expect {
*** 224,230 ****
send_gdb "next\n"
gdb_expect {
! -re "#0\[ \t\]*main.*:81.*$gdb_prompt $"\
{pass "use hook-stop command"}
-re "$gdb_prompt $"\
{fail "use hook-stop command"}
--- 236,242 ----
send_gdb "next\n"
gdb_expect {
! -re "#0\[ \t\]*main.*:$bp_location11.*$gdb_prompt $"\
{pass "use hook-stop command"}
-re "$gdb_prompt $"\
{fail "use hook-stop command"}
Index: gdb.base/ena-dis-br.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ena-dis-br.exp,v
retrieving revision 1.3
diff -c -p -r1.3 ena-dis-br.exp
*** gdb.base/ena-dis-br.exp 18 Sep 2002 15:34:10 -0000 1.3
--- gdb.base/ena-dis-br.exp 9 Dec 2003 04:52:46 -0000
***************
*** 1,5 ****
! # Copyright 1997, 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,4 ----
! # Copyright 1997, 1998, 1999, 2003 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
***************
*** 13,19 ****
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
! # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
--- 12,18 ----
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
! # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
*************** set bug_id 0
*** 32,40 ****
set testfile "break"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! 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."
}
--- 31,48 ----
set testfile "break"
set srcfile ${testfile}.c
+ set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
*************** gdb_start
*** 43,48 ****
--- 51,67 ----
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
+ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
+ set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
+ set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1]
+ set bp_location11 [gdb_get_line_number "set breakpoint 11 here"]
+ set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile1]
+ set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile1]
+ set bp_location15 [gdb_get_line_number "set breakpoint 15 here" $srcfile1]
+ set bp_location16 [gdb_get_line_number "set breakpoint 16 here" $srcfile1]
+ set bp_location17 [gdb_get_line_number "set breakpoint 17 here" $srcfile1]
+ set bp_location18 [gdb_get_line_number "set breakpoint 18 here" $srcfile1]
+
if ![runto_main] then { fail "enable/disable break tests suppressed" }
# Verify that we can set a breakpoint (the location is irrelevant),
*************** if ![runto_main] then { fail "enable/dis
*** 50,56 ****
#
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
--- 69,75 ----
#
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
*************** gdb_expect {
*** 98,104 ****
#
send_gdb "break marker2\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[49\].*$gdb_prompt $"\
{pass "break marker2"}
-re "$gdb_prompt $"\
{fail "break marker2"}
--- 117,123 ----
#
send_gdb "break marker2\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location8|$bp_location9).*$gdb_prompt $"\
{pass "break marker2"}
-re "$gdb_prompt $"\
{fail "break marker2"}
*************** if ![runto_main] then { fail "enable/dis
*** 156,162 ****
send_gdb "break marker3\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line (45|50).*$gdb_prompt $"\
{pass "break marker3"}
-re "$gdb_prompt $"\
{fail "break marker3"}
--- 175,181 ----
send_gdb "break marker3\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location17|$bp_location18).*$gdb_prompt $"\
{pass "break marker3"}
-re "$gdb_prompt $"\
{fail "break marker3"}
*************** gdb_expect {
*** 181,187 ****
send_gdb "continue\n"
gdb_expect {
! -re ".*marker3 .*:(45|50).*$gdb_prompt $"\
{pass "continue to auto-deleted break marker3"}
-re "Breakpoint \[0-9\]*, marker3.*$gdb_prompt $"\
{fail "continue to auto-deleted break marker3"}
--- 200,206 ----
send_gdb "continue\n"
gdb_expect {
! -re ".*marker3 .*:($bp_location17|$bp_location18).*$gdb_prompt $"\
{pass "continue to auto-deleted break marker3"}
-re "Breakpoint \[0-9\]*, marker3.*$gdb_prompt $"\
{fail "continue to auto-deleted break marker3"}
*************** gdb_expect {
*** 206,212 ****
#
send_gdb "break marker4\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line (46|51).*$gdb_prompt $"\
{pass "break marker4"}
-re "$gdb_prompt $"\
{fail "break marker4"}
--- 225,231 ----
#
send_gdb "break marker4\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location14|$bp_location13).*$gdb_prompt $"\
{pass "break marker4"}
-re "$gdb_prompt $"\
{fail "break marker4"}
*************** if ![runto_main] then { fail "enable/dis
*** 237,243 ****
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
--- 256,262 ----
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
*************** if ![runto_main] then { fail "enable/dis
*** 328,334 ****
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
--- 347,353 ----
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
*************** rerun_to_main
*** 365,371 ****
send_gdb "continue\n"
gdb_expect {
! -re ".*marker1 .*:4\[38\].*$gdb_prompt $"\
{pass "continue to ignored & auto-deleted break marker1"}
-re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
{fail "continue to ignored & auto-deleted break marker1"}
--- 384,390 ----
send_gdb "continue\n"
gdb_expect {
! -re ".*marker1 .*:($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "continue to ignored & auto-deleted break marker1"}
-re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
{fail "continue to ignored & auto-deleted break marker1"}
*************** if ![runto_main] then { fail "enable/dis
*** 381,387 ****
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
--- 400,406 ----
send_gdb "break marker1\n"
gdb_expect {
! -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location15|$bp_location16).*$gdb_prompt $"\
{pass "break marker1"}
-re "$gdb_prompt $"\
{fail "break marker1"}
*************** gdb_expect {
*** 423,431 ****
#
if ![runto_main] then { fail "enable/disable break tests suppressed" }
! send_gdb "break 79\n"
gdb_expect {
! -re "Breakpoint \[0-9\]*.*, line 79.*$gdb_prompt $"\
{pass "prepare to continue with ignore count"}
-re "$gdb_prompt $"\
{fail "prepare to continue with ignore count"}
--- 442,450 ----
#
if ![runto_main] then { fail "enable/disable break tests suppressed" }
! send_gdb "break $bp_location1\n"
gdb_expect {
! -re "Breakpoint \[0-9\]*.*, line $bp_location1.*$gdb_prompt $"\
{pass "prepare to continue with ignore count"}
-re "$gdb_prompt $"\
{fail "prepare to continue with ignore count"}
*************** gdb_expect {
*** 442,448 ****
send_gdb "next\n"
gdb_expect {
! -re ".*81\[ \t\]*marker1.*$gdb_prompt $"\
{pass "step after continue with ignore count"}
-re "$gdb_prompt $"\
{fail "step after continue with ignore count"}
--- 461,467 ----
send_gdb "next\n"
gdb_expect {
! -re ".*$bp_location11\[ \t\]*marker1.*$gdb_prompt $"\
{pass "step after continue with ignore count"}
-re "$gdb_prompt $"\
{fail "step after continue with ignore count"}
Index: gdb.base/info-proc.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/info-proc.exp,v
retrieving revision 1.1
diff -c -p -r1.1 info-proc.exp
*** gdb.base/info-proc.exp 5 Jan 2002 02:44:07 -0000 1.1
--- gdb.base/info-proc.exp 9 Dec 2003 04:52:46 -0000
***************
*** 1,4 ****
! # Copyright 2002 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,4 ----
! # Copyright 2002, 2003 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
*************** if $tracelevel then {
*** 27,38 ****
set prms_id 0
set bug_id 0
- set testfile "break"
- set srcfile ${testfile}.c
- set binfile ${objdir}/${subdir}/${testfile}
set ws "\[ \t\]+"
! 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."
}
--- 27,48 ----
set prms_id 0
set bug_id 0
set ws "\[ \t\]+"
! set testfile "break"
! set srcfile ${testfile}.c
! set srcfile1 ${testfile}1.c
! set binfile ${objdir}/${subdir}/${testfile}
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
Index: gdb.base/maint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/maint.exp,v
retrieving revision 1.20
diff -c -p -r1.20 maint.exp
*** gdb.base/maint.exp 20 Nov 2003 15:36:34 -0000 1.20
--- gdb.base/maint.exp 9 Dec 2003 04:52:47 -0000
***************
*** 1,4 ****
! # Copyright 1998, 1999, 2000, 2001, 2002 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,4 ----
! # Copyright 1998, 1999, 2000, 2001, 2002, 2003 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
*************** set bug_id 0
*** 65,74 ****
set testfile "break"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != ""
! } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
--- 65,83 ----
set testfile "break"
set srcfile ${testfile}.c
+ set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
*************** gdb_expect {
*** 412,422 ****
timeout { fail "(timeout) maint info sections DATA" }
}
send_gdb "maint info breakpoints\n"
gdb_expect {
! -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex\[ \t\]+in main at.*break.c:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\
{ pass "maint info breakpoints" }
! -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n-1\[ \t\]+shlib events\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex.*breakpoint already hit.*$gdb_prompt $"\
{ pass "maint info breakpoints (with shlib events)" }
-re ".*$gdb_prompt $" { fail "maint info breakpoints" }
timeout { fail "(timeout) maint info breakpoints" }
--- 421,433 ----
timeout { fail "(timeout) maint info sections DATA" }
}
+ set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
+
send_gdb "maint info breakpoints\n"
gdb_expect {
! -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex\[ \t\]+in main at.*break.c:$bp_location6\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\
{ pass "maint info breakpoints" }
! -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:$bp_location6\r\n\[ \t\]+breakpoint already hit 1 time\r\n-1\[ \t\]+shlib events\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex.*breakpoint already hit.*$gdb_prompt $"\
{ pass "maint info breakpoints (with shlib events)" }
-re ".*$gdb_prompt $" { fail "maint info breakpoints" }
timeout { fail "(timeout) maint info breakpoints" }
Index: gdb.base/until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/until.exp,v
retrieving revision 1.3
diff -c -p -r1.3 until.exp
*** gdb.base/until.exp 3 Feb 2003 16:04:18 -0000 1.3
--- gdb.base/until.exp 9 Dec 2003 04:52:47 -0000
*************** if $tracelevel then {
*** 23,35 ****
strace $tracelevel
}
! set testfile break
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
! remote_exec build "rm -f ${binfile}"
! 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."
}
gdb_exit
--- 23,43 ----
strace $tracelevel
}
! set testfile "break"
set srcfile ${testfile}.c
+ set srcfile1 ${testfile}1.c
set binfile ${objdir}/${subdir}/${testfile}
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
! }
!
! if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug additional_flags=-w}] != "" } {
! gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
gdb_exit
*************** gdb_start
*** 37,42 ****
--- 45,55 ----
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
+ set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
+ set bp_location19 [gdb_get_line_number "set breakpoint 19 here"]
+ set bp_location20 [gdb_get_line_number "set breakpoint 20 here"]
+ set bp_location21 [gdb_get_line_number "set breakpoint 21 here"]
+
if ![runto_main] then {
fail "Can't run to main"
return 0
*************** if ![runto_main] then {
*** 45,52 ****
# Verify that "until <location>" works. (This is really just syntactic
# sugar for "tbreak <location>; continue".)
#
! gdb_test "until 79" \
! "main .* at .*:79.*" \
"until line number"
# Verify that a malformed "advance" is gracefully caught.
--- 58,65 ----
# Verify that "until <location>" works. (This is really just syntactic
# sugar for "tbreak <location>; continue".)
#
! gdb_test "until $bp_location1" \
! "main .* at .*:$bp_location1.*" \
"until line number"
# Verify that a malformed "advance" is gracefully caught.
*************** delete_breakpoints
*** 62,69 ****
# inner invocations of factorial() are completed and we are back at this
# frame.
#
! gdb_test "until 99" \
! "factorial.*value=720.*at.*${srcfile}:99.*return \\(value\\)." \
"until factorial, recursive function"
# Run to a function called by main
--- 75,82 ----
# inner invocations of factorial() are completed and we are back at this
# frame.
#
! gdb_test "until $bp_location19" \
! "factorial.*value=720.*at.*${srcfile}:$bp_location19.*return \\(value\\).*" \
"until factorial, recursive function"
# Run to a function called by main
*************** delete_breakpoints
*** 76,81 ****
# 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\\)|83.*marker3 \\(.stack., .trace.\\))." \
"until func, not called by current frame"
--- 89,94 ----
# stop at main, the caller, where we put the 'guard' breakpoint.
#
gdb_test "until marker3" \
! "($hex in |)main.*argc.*argv.*envp.*at.*${srcfile}:($bp_location20.*marker2 \\(43\\)|$bp_location21.*marker3 \\(.stack., .trace.\\)).*" \
"until func, not called by current frame"
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] Outwit compiler dead code elimination in break.exp test
@ 2003-12-01 16:55 Michael Elizabeth Chastain
0 siblings, 0 replies; 20+ messages in thread
From: Michael Elizabeth Chastain @ 2003-12-01 16:55 UTC (permalink / raw)
To: fnf; +Cc: ezannoni, gdb-patches
ff> The messages will now be something like:
ff> PASS: gdb.base/break.exp: set to-be-silent break bp_location1
ff> instead of:
ff> PASS: gdb.base/break.exp: set to-be-silent break 83
Mmmmm, a test suite discussion. Can I throw two cents in? :)
Either message looks fine to me. It's important that the message
be unique within the test script, and either message would be unique
within the test script. And it's important that the message not change
from run to run, and "break 83" does not change from run to run
unless someone actually changes the test script.
So "break 83" wasn't a big problem but "break bp_location1" appeals
more to me esthetically.
Michael C
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2003-12-29 20:20 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-29 23:05 [PATCH] Outwit compiler dead code elimination in break.exp test Fred Fish
2003-11-30 1:04 ` Fred Fish
2003-11-30 1:07 ` Daniel Jacobowitz
2003-11-30 1:26 ` Fred Fish
2003-12-01 0:46 ` Fred Fish
2003-12-01 14:58 ` Elena Zannoni
2003-12-01 15:30 ` Fred Fish
2003-12-01 15:46 ` Elena Zannoni
2003-12-01 16:39 ` Fred Fish
2003-12-01 14:23 ` Elena Zannoni
2003-12-01 14:44 ` Daniel Jacobowitz
2003-12-01 17:52 ` Andrew Cagney
2003-12-01 18:10 ` Fred Fish
2003-12-09 1:02 ` Michael Snyder
2003-12-07 21:21 ` [PATCH] Outwit compiler dead code elimination in break.exp test (revised patch) Fred Fish
2003-12-08 0:31 ` Andrew Cagney
2003-12-01 16:55 [PATCH] Outwit compiler dead code elimination in break.exp test Michael Elizabeth Chastain
2003-12-08 23:49 [PATCH] Outwit compiler dead code elimination in break.exp test (revised patch) Andrew Cagney
2003-12-09 5:06 ` [PATCH] Outwit compiler dead code elimination in break.exp test Fred Fish
2003-12-09 6:52 Michael Elizabeth Chastain
2003-12-29 20:20 ` Elena Zannoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox