This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH RFC] Fix break.exp optimization related failure


I recently encountered the following FAIL in the FR-V work that I've
been doing:

FAIL: gdb.base/break.exp: run until breakpoint set at small function, optimized file

The reason for this failure is that gcc has optimized out the call
to marker4().  I've determined that this happens not only using -O2,
but with -O1 as well.  Surprisingly, it even happens when using the
following set of switches:

    -O1 -fno-defer-pop -fno-thread-jumps -fno-loop-optimize
    -fno-crossjumping -fno-if-conversion -fno-if-conversion2
    -fno-guess-branch-probability -fno-cprop-registers
    -fno-omit-frame-pointer

The various -fno-* options *should* be disabling the set of options
enabled by -O1.  Anyway, I've been told that this optimization is
a special case of GCSE and apparently there's no way to disable it
via a command line switch.

By simply declaring the function in question as "weak", we can get
GCC to avoid this optimization for the reasons given in the comment
in the patch.  I am reasonably confident that this method will work
regardless of future optimization work done on GCC.  (My first thought
was to throw in a suitable -fno-something option to avoid the behavior
that I'm seeing, but the problem with this - if it would work at all -
is that the requisite option might not be available in past or future
compilers.)

The changes to break.exp look significant, but are only line number
changes.  I added exactly 20 lines to break.c, so most line numbers
increase by 20.  Those that don't are either before or within the
range of lines affected by my patch.

I'll commit this in about a week's time unless there are significant
objections.

Kevin

	* gdb.base/break.c (marker4): Add weak declaration for GCC.
	* gdb.base/break.exp: Update line numbers to account for lines
	added to break.c.

Index: testsuite/gdb.base/break.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.c,v
retrieving revision 1.2
diff -u -p -r1.2 break.c
--- testsuite/gdb.base/break.c	7 Jan 2002 19:21:26 -0000	1.2
+++ testsuite/gdb.base/break.c	26 Sep 2003 23:58:44 -0000
@@ -43,11 +43,31 @@ char *arg;
 int marker1 (void) { return (0); }
 int marker2 (int a) { return (1); }
 void marker3 (char *a, char *b) {}
+
+#ifdef __GNUC__
+/* Certain versions of GCC will, at -O1 or higher, optimize out calls
+   to functions which do nothing.  Marking the function as "weak"
+   disables GCC's ability to optimize out the call since (at link
+   time) there *could* (but isn't in this case) be an overriding
+   function which actually does something.  Using the "weak" attribute
+   in this way is preferable to making the function do something since
+   these simple "do nothing" functions are frequently useful for
+   finding problems.  (See above.)  We only mark marker4() as weak
+   since it's the only function affected by the -O2 test.  */
+void __attribute__ ((__weak__)) marker4 (long);
+#endif
+
 void marker4 (long d) {}
 #else
 int marker1 () { return (0); }
 int marker2 (a) int a; { return (1); }
 void marker3 (a, b) char *a, *b; {}
+
+#ifdef __GNUC__
+/* See comment above.  */
+void __attribute__ ((__weak__)) marker4 ();
+#endif
+
 void marker4 (d) long d; {}
 #endif
 
Index: testsuite/gdb.base/break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.exp,v
retrieving revision 1.17
diff -u -p -r1.17 break.exp
--- testsuite/gdb.base/break.exp	5 Apr 2003 13:35:25 -0000	1.17
+++ testsuite/gdb.base/break.exp	26 Sep 2003 23:58:44 -0000
@@ -109,22 +109,22 @@ gdb_test "break $srcfile:factorial" \
 gdb_test "list main" \
     ".*main \\(argc, argv, envp\\).*" \
     "use `list' to establish default source file"
-gdb_test "break 79" \
-    "Breakpoint.*at.* file .*$srcfile, line 79\\." \
+gdb_test "break 99" \
+    "Breakpoint.*at.* file .*$srcfile, line 99\\." \
     "breakpoint line number"
 
 #
 # test duplicate breakpoint
 #
-gdb_test "break 79" \
-    "Note: breakpoint \[0-9\]+ also set at pc.*Breakpoint \[0-9\]+ at.* file .*$srcfile, line 79\\." \
+gdb_test "break 99" \
+    "Note: breakpoint \[0-9\]+ also set at pc.*Breakpoint \[0-9\]+ at.* file .*$srcfile, line 99\\." \
     "breakpoint duplicate"
 
 #
 # test break at line number in file
 #
-gdb_test "break $srcfile:85" \
-    "Breakpoint.*at.* file .*$srcfile, line 85\\." \
+gdb_test "break $srcfile:105" \
+    "Breakpoint.*at.* file .*$srcfile, line 105\\." \
     "breakpoint line number in file"
 
 
@@ -133,20 +133,20 @@ gdb_test "break $srcfile:85" \
 # Verify the breakpoint was put at the start of the conditional.
 #
 gdb_test "break multi_line_if_conditional" \
-    "Breakpoint.*at.* file .*$srcfile, line 109\\." \
+    "Breakpoint.*at.* file .*$srcfile, line 129\\." \
     "breakpoint at start of multi line if conditional"
 
 gdb_test "break multi_line_while_conditional" \
-    "Breakpoint.*at.* file .*$srcfile, line 124\\." \
+    "Breakpoint.*at.* file .*$srcfile, line 144\\." \
     "breakpoint at start of multi line while conditional"
 
 #
 # check to see what breakpoints are set
 #
 if [target_info exists gdb_stub] {
-    set main_line 72
+    set main_line 92
 } else {
-    set main_line 75
+    set main_line 95
 }
 
 if {$hp_aCC_compiler} {
@@ -158,13 +158,13 @@ if {$hp_aCC_compiler} {
 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:4\[49\].*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in factorial$proto at .*$srcfile:96.*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:79.*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:79.*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:85.*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in multi_line_if_conditional at .*$srcfile:109.*
-\[0-9\]+\[\t \]+breakpoint     keep y.* in multi_line_while_conditional at .*$srcfile:124" \
+\[0-9\]+\[\t \]+breakpoint     keep y.* in marker2 at .*$srcfile:\(44\|63\).*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in factorial$proto at .*$srcfile:116.*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:99.*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:99.*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:105.*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in multi_line_if_conditional at .*$srcfile:129.*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in multi_line_while_conditional at .*$srcfile:144" \
     "breakpoint info"
 
 # FIXME: The rest of this test doesn't work with anything that can't
@@ -191,52 +191,52 @@ if ![target_info exists use_gdb_stub] {
 	send_gdb "y\n"
 	exp_continue
     }
-    -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:75.*75\[\t \]+if .argc.* \{.*$gdb_prompt $"\
+    -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:95.*95\[\t \]+if .argc.* \{.*$gdb_prompt $"\
 	                    { pass "run until function breakpoint" }
     -re ".*$gdb_prompt $"       { fail "run until function breakpoint" }
     timeout	            { fail "run until function breakpoint (timeout)" }
   }
 } else {
     if ![target_info exists gdb_stub] {
-	gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:75.*75\[\t \]+if .argc.*\{.*" "stub continue"
+	gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:95.*95\[\t \]+if .argc.*\{.*" "stub continue"
     }
 }
 
 #
 # 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.*" \
+gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:99.*99\[\t \]+printf.*factorial.*" \
 			"run until breakpoint set at a line number"
 
 #
 # Run until the breakpoint set in a function in a file
 #
 for {set i 6} {$i >= 1} {incr i -1} {
-	gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, factorial \\(value=$i\\) at .*$srcfile:96.*96\[\t \]+.*if .value > 1. \{.*" \
+	gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, factorial \\(value=$i\\) at .*$srcfile:116.*116\[\t \]+.*if .value > 1. \{.*" \
 			"run until file:function($i) breakpoint"
 }
 
 #
 # 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:4\[49\].*" \
+gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, (0x\[0-9a-f\]+ in )?marker2 \\(a=43\\) at .*$srcfile:\(44\|63\).*" \
 		"run until quoted breakpoint"
 #
 # run until the file:function breakpoint at a line number in a file
 #
-gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:85.*85\[\t \]+argc = \\(argc == 12345\\);.*" \
+gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:105.*105\[\t \]+argc = \\(argc == 12345\\);.*" \
 		"run until file:linenum breakpoint"
 
 # Test break at offset +1
 
 gdb_test "break +1" \
-    "Breakpoint.*at.* file .*$srcfile, line 86\\." \
+    "Breakpoint.*at.* file .*$srcfile, line 106\\." \
     "breakpoint offset +1"
 
 # Check to see if breakpoint is hit when stepped onto
 
 gdb_test "step" \
-    ".*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:86.*86\[\t \]+return argc;" \
+    ".*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:106.*106\[\t \]+return argc;" \
     "step onto breakpoint"
 
 #
@@ -260,37 +260,37 @@ gdb_test "tbreak $srcfile:factorial" "Br
 #
 # test break at line number
 #
-send_gdb "tbreak 79\n"
+send_gdb "tbreak 99\n"
 gdb_expect {
-    -re "Breakpoint.*at.* file .*$srcfile, line 79.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" }
+    -re "Breakpoint.*at.* file .*$srcfile, line 99.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" }
 	-re ".*$gdb_prompt $"   { pass "Temporary breakpoint line number #1" }
 	timeout	    { fail "breakpoint line number #1 (timeout)" }
 }
 
-gdb_test "tbreak 75" "Breakpoint.*at.* file .*$srcfile, line 75.*" "Temporary breakpoint line number #2"
+gdb_test "tbreak 95" "Breakpoint.*at.* file .*$srcfile, line 95.*" "Temporary breakpoint line number #2"
 
 #
 # test break at line number in file
 #
-send_gdb "tbreak $srcfile:85\n"
+send_gdb "tbreak $srcfile:105\n"
 gdb_expect {
-    -re "Breakpoint.*at.* file .*$srcfile, line 85.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" }
+    -re "Breakpoint.*at.* file .*$srcfile, line 105.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" }
 	-re ".*$gdb_prompt $"   { pass "Temporary breakpoint line number in file #1" }
 	timeout	    { fail "Temporary breakpoint line number in file #1 (timeout)" }
 }
 
-gdb_test  "tbreak $srcfile:81" "Breakpoint.*at.* file .*$srcfile, line 81.*" "Temporary breakpoint line number in file #2"
+gdb_test  "tbreak $srcfile:101" "Breakpoint.*at.* file .*$srcfile, line 101.*" "Temporary breakpoint line number in file #2"
 
 #
 # check to see what breakpoints are set (temporary this time)
 #
 gdb_test "info break" "Num Type.*Disp Enb Address.*What.*\[\r\n\]
 \[0-9\]+\[\t \]+breakpoint     del.*y.*in main at .*$srcfile:$main_line.*\[\r\n\]
-\[0-9\]+\[\t \]+breakpoint     del.*y.*in factorial$proto at .*$srcfile:96.*\[\r\n\]
-\[0-9\]+\[\t \]+breakpoint     del.*y.*in main at .*$srcfile:79.*\[\r\n\]
-\[0-9\]+\[\t \]+breakpoint     del.*y.*in main at .*$srcfile:75.*\[\r\n\]
-\[0-9\]+\[\t \]+breakpoint     del.*y.*in main at .*$srcfile:85.*\[\r\n\]
-\[0-9\]+\[\t \]+breakpoint     del.*y.*in main at .*$srcfile:81.*" \
+\[0-9\]+\[\t \]+breakpoint     del.*y.*in factorial$proto at .*$srcfile:116.*\[\r\n\]
+\[0-9\]+\[\t \]+breakpoint     del.*y.*in main at .*$srcfile:99.*\[\r\n\]
+\[0-9\]+\[\t \]+breakpoint     del.*y.*in main at .*$srcfile:95.*\[\r\n\]
+\[0-9\]+\[\t \]+breakpoint     del.*y.*in main at .*$srcfile:105.*\[\r\n\]
+\[0-9\]+\[\t \]+breakpoint     del.*y.*in main at .*$srcfile:101.*" \
     "Temporary breakpoint info"
 
 
@@ -378,7 +378,7 @@ gdb_expect {
 # Run to the desired default location. If not positioned here, the
 # tests below don't work.
 #
-gdb_test "until 79" "main .* at .*:79.*" "until 79"
+gdb_test "until 99" "main .* at .*:99.*" "until 99"
 
 
 # Verify that GDB allows one to just say "break", which is treated
@@ -427,13 +427,13 @@ gdb_expect {
 #
 if ![runto_main] then { fail "break tests suppressed" }
 
-send_gdb "break 79\n"
+send_gdb "break 99\n"
 gdb_expect {
-  -re "Breakpoint (\[0-9\]*) at .*, line 79.*$gdb_prompt $"\
-          {pass "set to-be-silent break 79"}
+  -re "Breakpoint (\[0-9\]*) at .*, line 99.*$gdb_prompt $"\
+          {pass "set to-be-silent break 99"}
   -re "$gdb_prompt $"\
-          {fail "set to-be-silent break 79"}
-  timeout {fail "(timeout) set to-be-silent break 79"}
+          {fail "set to-be-silent break 99"}
+  timeout {fail "(timeout) set to-be-silent break 99"}
 }
 
 send_gdb "commands $expect_out(1,string)\n"
@@ -441,33 +441,33 @@ send_gdb "silent\n"
 send_gdb "end\n"
 gdb_expect {
   -re ".*$gdb_prompt $"\
-          {pass "set silent break 79"}
-  timeout {fail "(timeout) set silent break 79"}
+          {pass "set silent break 99"}
+  timeout {fail "(timeout) set silent break 99"}
 }
 
 send_gdb "info break $expect_out(1,string)\n"
 gdb_expect {
-  -re "\[0-9\]*\[ \t\]*breakpoint.*:79\r\n\[ \t\]*silent.*$gdb_prompt $"\
-          {pass "info silent break 79"}
+  -re "\[0-9\]*\[ \t\]*breakpoint.*:99\r\n\[ \t\]*silent.*$gdb_prompt $"\
+          {pass "info silent break 99"}
   -re "$gdb_prompt $"\
-          {fail "info silent break 79"}
-  timeout {fail "(timeout) info silent break 79"}
+          {fail "info silent break 99"}
+  timeout {fail "(timeout) info silent break 99"}
 }
 send_gdb "continue\n"
 gdb_expect {
   -re "Continuing.\r\n$gdb_prompt $"\
-          {pass "hit silent break 79"}
+          {pass "hit silent break 99"}
   -re "$gdb_prompt $"\
-          {fail "hit silent break 79"}
-  timeout {fail "(timeout) hit silent break 79"}
+          {fail "hit silent break 99"}
+  timeout {fail "(timeout) hit silent break 99"}
 }
 send_gdb "bt\n"
 gdb_expect {
-  -re "#0  main .* at .*:79.*$gdb_prompt $"\
-          {pass "stopped for silent break 79"}
+  -re "#0  main .* at .*:99.*$gdb_prompt $"\
+          {pass "stopped for silent break 99"}
   -re "$gdb_prompt $"\
-          {fail "stopped for silent break 79"}
-  timeout {fail "(timeout) stopped for silent break 79"}
+          {fail "stopped for silent break 99"}
+  timeout {fail "(timeout) stopped for silent break 99"}
 }
 
 # Verify that GDB can at least parse a breakpoint with the
@@ -475,7 +475,7 @@ gdb_expect {
 # thread-specific breakpoint really triggers appropriately.
 # The gdb.threads subdirectory contains tests for that.)
 #
-send_gdb "break 80 thread 999\n"
+send_gdb "break 100 thread 999\n"
 gdb_expect {
   -re "Unknown thread 999.*$gdb_prompt $"\
           {pass "thread-specific breakpoint on non-existent thread disallowed"}
@@ -483,7 +483,7 @@ gdb_expect {
           {fail "thread-specific breakpoint on non-existent thread disallowed"}
   timeout {fail "(timeout) thread-specific breakpoint on non-existent thread disallowed"}
 }
-send_gdb "break 80 thread foo\n"
+send_gdb "break 100 thread foo\n"
 gdb_expect {
   -re "Junk after thread keyword..*$gdb_prompt $"\
           {pass "thread-specific breakpoint on bogus thread ID disallowed"}
@@ -495,7 +495,7 @@ gdb_expect {
 # Verify that GDB responds gracefully to a breakpoint command with
 # trailing garbage.
 #
-send_gdb "break 80 foo\n"
+send_gdb "break 100 foo\n"
 gdb_expect {
   -re "Junk at end of arguments..*$gdb_prompt $"\
           {pass "breakpoint with trailing garbage disallowed"}
@@ -514,9 +514,9 @@ gdb_expect {
           {pass "step over breakpoint"}
   timeout {fail "(timeout) step over breakpoint"}
 }
-send_gdb "clear 81\n"
+send_gdb "clear 101\n"
 gdb_expect {
-  -re "No breakpoint at 81..*$gdb_prompt $"\
+  -re "No breakpoint at 101..*$gdb_prompt $"\
           {pass "clear line has no breakpoint disallowed"}
   -re "$gdb_prompt $"\
           {fail "clear line has no breakpoint disallowed"}
@@ -542,15 +542,15 @@ gdb_test "clear marker3" {Deleted breakp
 
 # Verify that a breakpoint can be set via a convenience variable.
 #
-send_gdb "set \$foo=81\n"
+send_gdb "set \$foo=101\n"
 gdb_expect {
   -re "$gdb_prompt $"\
-          {pass "set convenience variable \$foo to 81"}
-  timeout {fail "(timeout) set convenience variable \$foo to 81"}
+          {pass "set convenience variable \$foo to 101"}
+  timeout {fail "(timeout) set convenience variable \$foo to 101"}
 }
 send_gdb "break \$foo\n"
 gdb_expect {
-  -re "Breakpoint (\[0-9\]*) at .*, line 81.*$gdb_prompt $"\
+  -re "Breakpoint (\[0-9\]*) at .*, line 101.*$gdb_prompt $"\
           {pass "set breakpoint via convenience variable"}
   -re "$gdb_prompt $"\
           {fail "set breakpoint via convenience variable"}
@@ -579,7 +579,7 @@ gdb_expect {
 #
 send_gdb "break marker2\n"
 gdb_expect {
-    -re "Breakpoint (\[0-9\]*) at .*, line 4\[49\].*$gdb_prompt $"\
+    -re "Breakpoint (\[0-9\]*) at .*, line \(44\|63\).*$gdb_prompt $"\
           {pass "set breakpoint on to-be-called function"}
   -re "$gdb_prompt $"\
           {fail "set breakpoint on to-be-called function"}
@@ -602,9 +602,9 @@ gdb_expect {
 #
 send_gdb "bt\n"
 gdb_expect {
-    -re "#0\[ \t\]*($hex in )?marker2.*:4\[49\]\r\n#1.*_sr4export.*$gdb_prompt $"\
+    -re "#0\[ \t\]*($hex in )?marker2.*:\(44\|63\)\r\n#1.*_sr4export.*$gdb_prompt $"\
             {pass "backtrace while in called function"}
-    -re "#0\[ \t\]*($hex in )?marker2.*:4\[49\]\r\n#1.*function called from gdb.*$gdb_prompt $"\
+    -re "#0\[ \t\]*($hex in )?marker2.*:\(44\|63\)\r\n#1.*function called from gdb.*$gdb_prompt $"\
 	    {pass "backtrace while in called function"}
     -re "$gdb_prompt $"\
             {fail "backtrace while in called function"}
@@ -617,11 +617,11 @@ gdb_expect {
 #
 send_gdb "finish\n"
 gdb_expect {
-    -re "Run till exit from .*marker2.* at .*4\[49\]\r\n.* in _sr4export.*$gdb_prompt $"\
+    -re "Run till exit from .*marker2.* at .*\(44\|63\)\r\n.* in _sr4export.*$gdb_prompt $"\
             {pass "finish from called function"}
-    -re "Run till exit from .*marker2.* at .*4\[49\]\r\n.*function called from gdb.*$gdb_prompt $"\
+    -re "Run till exit from .*marker2.* at .*\(44\|63\)\r\n.*function called from gdb.*$gdb_prompt $"\
             {pass "finish from called function"}
-    -re "Run till exit from .*marker2.* at .*4\[49\]\r\n.*Value returned.*$gdb_prompt $"\
+    -re "Run till exit from .*marker2.* at .*\(44\|63\)\r\n.*Value returned.*$gdb_prompt $"\
             {pass "finish from called function"}
     -re "$gdb_prompt $"\
             {fail "finish from called function"}
@@ -633,7 +633,7 @@ gdb_expect {
 #
 if ![runto_main] then { fail "break tests suppressed" }
 
-send_gdb "finish 123\n"
+send_gdb "finish 143\n"
 gdb_expect {
   -re "The \"finish\" command does not take any arguments.\r\n$gdb_prompt $"\
           {pass "finish with arguments disallowed"}
@@ -880,7 +880,7 @@ if ![target_info exists use_gdb_stub] {
 	send_gdb "y\n"
 	exp_continue
     }
-    -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:75.*75\[\t \]+if .argc.* \{.*$gdb_prompt $"\
+    -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:95.*95\[\t \]+if .argc.* \{.*$gdb_prompt $"\
 	                    { pass "run until function breakpoint, optimized file" }
     -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$gdb_prompt $"\
 	                    { pass "run until function breakpoint, optimized file (code motion)" }
@@ -889,7 +889,7 @@ if ![target_info exists use_gdb_stub] {
   }
 } else {
     if ![target_info exists gdb_stub] {
-	gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:75.*75\[\t \]+if .argc.*\{.*" "stub continue, optimized file"
+	gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:95.*95\[\t \]+if .argc.*\{.*" "stub continue, optimized file"
     }
 }
 
@@ -908,15 +908,15 @@ if ![target_info exists use_gdb_stub] {
 
 send_gdb "continue\n"
 gdb_expect {
-    -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:51\[\r\n\]+51\[\t \]+void marker4.*" {
+    -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:71\[\r\n\]+71\[\t \]+void marker4.*" {
 	pass "run until breakpoint set at small function, optimized file"
     }
-    -re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile:51\[\r\n\]+51\[\t \]+void marker4.*" {
+    -re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile:71\[\r\n\]+71\[\t \]+void marker4.*" {
 	pass "run until breakpoint set at small function, optimized file"
     }
-    -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:46\[\r\n\]+46\[\t \]+void marker4.*" {
-        # marker4() is defined at line 46 when compiled with -DPROTOTYPES
-	pass "run until breakpoint set at small function, optimized file (line 46)"
+    -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:60\[\r\n\]+60\[\t \]+void marker4.*" {
+        # marker4() is defined at line 60 when compiled with -DPROTOTYPES
+	pass "run until breakpoint set at small function, optimized file (line 60)"
     }
     -re ".*$gdb_prompt " {
 	fail "run until breakpoint set at small function, optimized file"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]