Eliminate literal line numbers in call-rt-st.exp
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Fri, 24 Oct 2014 09:15:10 +0000 (09:15 +0000)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Thu, 13 Nov 2014 09:14:30 +0000 (10:14 +0100)
Remove literal line numbers from the regexps in call-rt-st.exp.  Add
appropriate eye-catchers to call-rt-st.c and refer to those instead.

gdb/testsuite/ChangeLog:

* gdb.base/call-rt-st.c: Add eye-catchers.
* gdb.base/call-rt-st.exp: Refer to eye-catchers instead of
literal line numbers.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/call-rt-st.c
gdb/testsuite/gdb.base/call-rt-st.exp

index f1ea38017a42983e0b9c26b44ab917d76c45e0a8..128e5c791537e7fb7914b087e568e4842f04771e 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-13  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
+       * gdb.base/call-rt-st.c: Add eye-catchers.
+       * gdb.base/call-rt-st.exp: Refer to eye-catchers instead of
+       literal line numbers.
+
 2014-11-13  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
        * gdb.base/call-ar-st.c: Add eye-catchers.
index 09dd5bb52a90c49c51dd624196635515530af051..a583babf161d575934f932f769929156a3bd5937 100644 (file)
@@ -125,7 +125,7 @@ void loop_count () {
 
      int index;
 
-     for (index=0; index<4; index++);
+     for (index=0; index<4; index++); /* -break1- */
 }
 
 /*****************************************************************
@@ -772,9 +772,9 @@ int main ()  {
   print_int_char_combo(*int_char_combo);
   print_struct_rep(*struct1);
 
-  loop_count();
+  loop_count();                        /* -finish2- */
 
-  return 0;
+  return 0;                    /* -finish1- */
 }
 
 
index 0ca312caa3aabbbaa5847581d00885f5c18e666f..e9f7fb1f873a1fbc94001d901955c9cd9b50db1f 100644 (file)
@@ -64,19 +64,20 @@ if ![runto_main] then {
 }
 
 
+set stop_line [gdb_get_line_number "-break1-"]
 gdb_test "break loop_count" \
-    "Breakpoint.* file .*call-rt-st.c, line 128\\." \
+    "Breakpoint.* file .*call-rt-st.c, line $stop_line\\." \
     "breakpoint loop_count"
 
 gdb_test "continue" \
-    "Continuing\\..*Breakpoint.*loop_count \\(\\) at.*call-rt-st.c:128\[ \t\r\n\]+128\[\t \]+for \\(index=0; index.4; index..\\);\[\r\n \]+" \
+    "Continuing\\..*Breakpoint.*loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+$stop_line\[\t \]+for \\(index=0; index.4; index..\\);.*\[\r\n \]+" \
     "continue to loop_count"
 
 gdb_test_multiple "finish" "finish out from loop count" {
-    -re "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:128\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:777\[ \t\r\n\]+777\[\t \]+return 0;.*$gdb_prompt $" {
-       pass "finish out from loop_count (line 777)"
+    -re "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:${decimal}\[ \t\r\n\]+${decimal}\[\t \]+return 0;.*-finish1-.*$gdb_prompt $" {
+       pass "finish out from loop_count (finish1)"
     }
-    -re  "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:128\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:775\[ \t\r\n\]+775\[\t \]+loop_count.*$gdb_prompt $" {
+    -re  "Run till exit from .0  loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:${decimal}\[ \t\r\n\]+${decimal}\[\t \]+loop_count.*-finish2-.*$gdb_prompt $" {
        pass "finish out from loop_count (line 775)"
     }
 }