OSDN Git Service

* gdb.base/break.c: Add 10a breakpoint at }
authorNathan Sidwell <nathan@codesourcery.com>
Tue, 13 Jun 2006 08:46:17 +0000 (08:46 +0000)
committerNathan Sidwell <nathan@codesourcery.com>
Tue, 13 Jun 2006 08:46:17 +0000 (08:46 +0000)
* gdb.base/break.exp: Add test for breakpoint at }
* gdb.cp/anon-union.cc: Add code at end of function.
* gdb.cp/anon-union.exp: Adjust end of function breakpoint.
* gdb.mi/var-cmd.c: Add code at end of function.
* gdb.mi/mi-var-display.exp: Adjust end of next.
* gdb.mi/mi2-var-display.exp: Likewise.
* gdb.base/fileio.c: Add stop function and insert calls at
stopping places.
* gdb.base/fileio.exp: Breakpoint stop function and remove
explicit line number references.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/break.c
gdb/testsuite/gdb.base/break.exp
gdb/testsuite/gdb.base/fileio.c
gdb/testsuite/gdb.base/fileio.exp
gdb/testsuite/gdb.cp/anon-union.cc
gdb/testsuite/gdb.cp/anon-union.exp
gdb/testsuite/gdb.mi/mi-var-display.exp
gdb/testsuite/gdb.mi/mi2-var-display.exp
gdb/testsuite/gdb.mi/var-cmd.c

index 35809e4..7695bca 100644 (file)
@@ -1,3 +1,17 @@
+2006-06-13  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * gdb.base/break.c: Add 10a breakpoint at }
+       * gdb.base/break.exp: Add test for breakpoint at }
+       * gdb.cp/anon-union.cc: Add code at end of function.
+       * gdb.cp/anon-union.exp: Adjust end of function breakpoint.
+       * gdb.mi/var-cmd.c: Add code at end of function.
+       * gdb.mi/mi-var-display.exp: Adjust end of next.
+       * gdb.mi/mi2-var-display.exp: Likewise.
+       * gdb.base/fileio.c: Add stop function and insert calls at
+       stopping places.
+       * gdb.base/fileio.exp: Breakpoint stop function and remove
+       explicit line number references.
+
 2006-05-19  Joel Brobecker  <brobecker@adacore.com>
 
         * gdb.base/del.exp (test_delete_alias): New function.
index bf398fc..db8dbdf 100644 (file)
@@ -99,7 +99,7 @@ char *argv[], **envp;
     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 */
-}
+} /* set breakpoint 10a here */
 
 #ifdef PROTOTYPES
 int factorial (int value)
index 13458a9..d99d13b 100644 (file)
@@ -262,6 +262,17 @@ gdb_test "step" \
     ".*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location10.*$bp_location10\[\t \]+return argc;.*breakpoint 10 here.*" \
     "step onto breakpoint"
 
+# Check to see if breakpoint can be set on ending brace of function
+set bp_location10a [gdb_get_line_number "set breakpoint 10a here"]
+
+gdb_test "break $bp_location10a" \
+    "Breakpoint.*at.* file .*$srcfile, line $bp_location10a\\." \
+    "setting breakpoint at }"
+
+gdb_test "continue" \
+    ".*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location10a.*$bp_location10a\[\t \]+}.*breakpoint 10a here.*" \
+    "continue to breakpoint at }"
+
 #
 # delete all breakpoints so we can start over, course this can be a test too
 #
index 69b51a2..f0883c6 100644 (file)
@@ -68,6 +68,8 @@ static const char *strerrno (int err);
 
 #define STRING      "Hello World"
 
+static void stop () {}
+
 int
 test_open ()
 {
@@ -78,8 +80,10 @@ test_open ()
   ret = open (FILENAME, O_CREAT | O_TRUNC | O_RDWR, S_IWUSR | S_IRUSR);
   printf ("open 1: ret = %d, errno = %d %s\n", ret, errno,
          ret >= 0 ? "OK" : "");
+  
   if (ret >= 0)
     close (ret);
+  stop ();
   /* Creating an already existing file (created by fileio.exp) */
   errno = 0;
   ret = open (FILENAME, O_CREAT | O_EXCL | O_WRONLY, S_IWUSR | S_IRUSR);
@@ -87,6 +91,7 @@ test_open ()
          strerrno (errno));
   if (ret >= 0)
     close (ret);
+  stop ();
   /* Open directory (for writing) */
   errno = 0;
   ret = open (".", O_WRONLY);
@@ -94,6 +99,7 @@ test_open ()
          strerrno (errno));
   if (ret >= 0)
     close (ret);
+  stop ();
   /* Opening nonexistant file */
   errno = 0;
   ret = open (NONEXISTANT, O_RDONLY);
@@ -101,12 +107,14 @@ test_open ()
          strerrno (errno));
   if (ret >= 0)
     close (ret);
+  stop ();
   /* Open for write but no write permission */
   errno = 0;
   ret = open (NOWRITE, O_CREAT | O_RDONLY, S_IRUSR);
   if (ret >= 0)
     {
       close (ret);
+      stop ();
       errno = 0;
       ret = open (NOWRITE, O_WRONLY);
       printf ("open 5: ret = %d, errno = %d %s\n", ret, errno,
@@ -115,7 +123,11 @@ test_open ()
        close (ret);
     }
   else
-    printf ("open 5: ret = %d, errno = %d\n", ret, errno);
+    {
+      stop ();
+      printf ("open 5: ret = %d, errno = %d\n", ret, errno);
+    }
+  stop ();
 }
 
 int
@@ -136,11 +148,13 @@ test_write ()
     }
   else
     printf ("write 1: ret = %d, errno = %d\n", ret, errno);
+  stop ();
   /* Write using invalid file descriptor */
   errno = 0;
   ret = write (999, STRING, strlen (STRING));
   printf ("write 2: ret = %d, errno = %d, %s\n", ret, errno,
          strerrno (errno));
+  stop ();
   /* Write to a read-only file */
   errno = 0;
   fd = open (FILENAME, O_RDONLY);
@@ -153,6 +167,7 @@ test_write ()
     }
   else
     printf ("write 3: ret = %d, errno = %d\n", ret, errno);
+  stop ();
 }
 
 int
@@ -178,11 +193,13 @@ test_read ()
     }
   else
     printf ("read 1: ret = %d, errno = %d\n", ret, errno);
+  stop ();
   /* Read using invalid file descriptor */
   errno = 0;
   ret = read (999, buf, 16);
   printf ("read 2: ret = %d, errno = %d %s\n", ret, errno,
          strerrno (errno));
+  stop ();
 }
 
 int
@@ -200,10 +217,12 @@ test_lseek ()
       ret = lseek (fd, 0, SEEK_CUR);
       printf ("lseek 1: ret = %ld, errno = %d, %s\n", (long) ret, errno,
               ret == 0 ? "OK" : "");
+      stop ();
       errno = 0;
       ret = lseek (fd, 0, SEEK_END);
       printf ("lseek 2: ret = %ld, errno = %d, %s\n", (long) ret, errno,
               ret == 11 ? "OK" : "");
+      stop ();
       errno = 0;
       ret = lseek (fd, 3, SEEK_SET);
       printf ("lseek 3: ret = %ld, errno = %d, %s\n", (long) ret, errno,
@@ -212,12 +231,17 @@ test_lseek ()
     }
   else
     {
-      printf ("lseek 1: ret = %d, errno = %d\n", ret, errno);
-      printf ("lseek 2: ret = %d, errno = %d\n", ret, errno);
-      printf ("lseek 3: ret = %d, errno = %d\n", ret, errno);
+      printf ("lseek 1: ret = %d, errno = %d %s\n", ret, errno,
+             strerrno (errno));
+      stop ();
+      printf ("lseek 2: ret = %d, errno = %d %s\n", ret, errno,
+             strerrno (errno));
+      stop ();
+      printf ("lseek 3: ret = %d, errno = %d %s\n", ret, errno,
+             strerrno (errno));
     }
   /* Seeking on an invalid file descriptor */
-
+  stop ();
 }
 
 int
@@ -237,11 +261,13 @@ test_close ()
     }
   else
     printf ("close 1: ret = %d, errno = %d\n", ret, errno);
+  stop ();
   /* Close an invalid file descriptor */
   errno = 0;
   ret = close (999);
   printf ("close 2: ret = %d, errno = %d, %s\n", ret, errno,
          strerrno (errno));
+  stop ();
 }
 
 int
@@ -258,21 +284,25 @@ test_stat ()
            st.st_size == 11 ? "OK" : "");
   else
     printf ("stat 1: ret = %d, errno = %d\n", ret, errno);
+  stop ();
   /* NULL pathname */
   errno = 0;
   ret = stat (NULL, &st);
   printf ("stat 2: ret = %d, errno = %d %s\n", ret, errno,
          strerrno (errno));
+  stop ();
   /* Empty pathname */
   errno = 0;
   ret = stat ("", &st);
   printf ("stat 3: ret = %d, errno = %d %s\n", ret, errno,
          strerrno (errno));
+  stop ();
   /* Nonexistant file */
   errno = 0;
   ret = stat (NONEXISTANT, &st);
   printf ("stat 4: ret = %d, errno = %d %s\n", ret, errno,
          strerrno (errno));
+  stop ();
 }
 
 int
@@ -297,11 +327,13 @@ test_fstat ()
     }
   else
     printf ("fstat 1: ret = %d, errno = %d\n", ret, errno);
+  stop ();
   /* Fstat using invalid file descriptor */
   errno = 0;
   ret = fstat (999, &st);
   printf ("fstat 2: ret = %d, errno = %d %s\n", ret, errno,
          strerrno (errno));
+  stop ();
 }
 
 int
@@ -311,10 +343,14 @@ test_isatty ()
 
   /* Check std I/O */
   printf ("isatty 1: stdin %s\n", isatty (0) ? "yes OK" : "no");
+  stop ();
   printf ("isatty 2: stdout %s\n", isatty (1) ? "yes OK" : "no");
+  stop ();
   printf ("isatty 3: stderr %s\n", isatty (2) ? "yes OK" : "no");
+  stop ();
   /* Check invalid fd */
   printf ("isatty 4: invalid %s\n", isatty (999) ? "yes" : "no OK");
+  stop ();
   /* Check open file */
   fd = open (FILENAME, O_RDONLY);
   if (fd >= 0)
@@ -324,6 +360,7 @@ test_isatty ()
     }
   else
     printf ("isatty 5: file couldn't open\n");
+  stop ();
 }
 
 
@@ -343,9 +380,11 @@ test_system ()
     printf ("system 1: ret = %d /bin/sh unavailable???\n", ret);
   else
     printf ("system 1: ret = %d %s\n", ret, ret == 0 ? "OK" : "");
+  stop ();
   /* Invalid command (just guessing ;-) ) */
   ret = system ("wrtzlpfrmpft");
   printf ("system 2: ret = %d %s\n", ret, WEXITSTATUS (ret) == 127 ? "OK" : "");
+  stop ();
 }
 
 int
@@ -374,26 +413,31 @@ test_rename ()
     }
   else
     printf ("rename 1: ret = %d, errno = %d\n", ret, errno);
+  stop ();
   /* newpath is existing directory, oldpath is not a directory */
   errno = 0;
   ret = rename (RENAMED, TESTDIR2);
   printf ("rename 2: ret = %d, errno = %d %s\n", ret, errno,
          strerrno (errno));
+  stop ();
   /* newpath is a non-empty directory */
   errno = 0;
   ret = rename (TESTDIR2, TESTDIR1);
   printf ("rename 3: ret = %d, errno = %d %s\n", ret, errno,
           strerrno (errno));
+  stop ();
   /* newpath is a subdirectory of old path */
   errno = 0;
   ret = rename (TESTDIR1, TESTSUBDIR);
   printf ("rename 4: ret = %d, errno = %d %s\n", ret, errno,
          strerrno (errno));
+  stop ();
   /* oldpath does not exist */
   errno = 0;
   ret = rename (NONEXISTANT, FILENAME);
   printf ("rename 5: ret = %d, errno = %d %s\n", ret, errno,
          strerrno (errno));
+  stop ();
 }
 
 int
@@ -408,6 +452,7 @@ test_unlink ()
   ret = unlink (RENAMED);
   printf ("unlink 1: ret = %d, errno = %d %s\n", ret, errno,
          strerrno (errno));
+  stop ();
   /* No write access */
   sprintf (name, "%s/%s", TESTDIR2, FILENAME);
   errno = 0;
@@ -428,11 +473,13 @@ test_unlink ()
     }
   else
     printf ("unlink 2: ret = %d, errno = %d\n", ret, errno);
+  stop ();
   /* pathname doesn't exist */
   errno = 0;
   ret = unlink (NONEXISTANT);
   printf ("unlink 3: ret = %d, errno = %d %s\n", ret, errno,
           strerrno (errno));
+  stop ();
 }
 
 int
@@ -443,10 +490,12 @@ test_time ()
   errno = 0;
   ret = time (&t);
   printf ("time 1: ret = %ld, errno = %d, t = %ld %s\n", (long) ret, errno, (long) t, ret == t ? "OK" : "");
+  stop ();
   errno = 0;
   ret = time (NULL);
   printf ("time 2: ret = %ld, errno = %d, t = %ld %s\n",
          (long) ret, errno, (long) t, ret >= t && ret < t + 10 ? "OK" : "");
+  stop ();
 }
 
 static const char *
index 2a717bf..1da8b16 100644 (file)
@@ -69,159 +69,141 @@ if ![runto_main] then {
     continue
 }
 
-send_gdb "tbreak 81\n" ; gdb_expect -re "$gdb_prompt $"
+send_gdb "break stop\n" ; gdb_expect -re "Breakpoint .*$srcfile.*$gdb_prompt $"
+set stop_msg ".*Breakpoint .* stop \\(\\) at.*$srcfile:.*static void stop \\(\\) {}.*"
+
 gdb_test continue \
-"Continuing\\..*open 1:.*OK.*test_open \\(\\) at.*$srcfile:81.*" \
+"Continuing\\..*open 1:.*OK$stop_msg" \
 "Open a file"
 
-send_gdb "tbreak 88\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*open 2:.*EEXIST.*test_open \\(\\) at.*$srcfile:88.*" \
+"Continuing\\..*open 2:.*EEXIST$stop_msg" \
 "Creating already existing file returns EEXIST"
 
-send_gdb "tbreak 95\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*open 3:.*EISDIR.*test_open \\(\\) at.*$srcfile:95.*" \
+"Continuing\\..*open 3:.*EISDIR$stop_msg" \
 "Open directory for writing returns EISDIR"
 
-send_gdb "tbreak 102\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*open 4:.*ENOENT.*test_open \\(\\) at.*$srcfile:102.*" \
+"Continuing\\..*open 4:.*ENOENT$stop_msg" \
 "Opening nonexistant file returns ENOENT"
 
-send_gdb "tbreak 109\n" ; gdb_expect -re "$gdb_prompt $"
 send_gdb "continue\n" ; gdb_expect -re "$gdb_prompt $"
 catch "system \"chmod -f -w nowrt.fileio.test\""
 
-send_gdb "tbreak 119\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*open 5:.*EACCES.*test_open \\(\\) at.*$srcfile:119.*" \
+"Continuing\\..*open 5:.*EACCES$stop_msg" \
 "Open for write but no write permission returns EACCES"
 
-send_gdb "tbreak 140\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*write 1:.*OK.*test_write \\(\\) at.*$srcfile:140.*" \
+"Continuing\\..*write 1:.*OK$stop_msg" \
 "Writing to a file"
 
-send_gdb "tbreak 145\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*write 2:.*EBADF.*test_write \\(\\) at.*$srcfile:145.*" \
+"Continuing\\..*write 2:.*EBADF$stop_msg" \
 "Write using invalid file descriptor returns EBADF"
 
-send_gdb "tbreak 156\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*write 3:.*EBADF.*test_write \\(\\) at.*$srcfile:156.*" \
+"Continuing\\..*write 3:.*EBADF$stop_msg" \
 "Writing to a read-only file returns EBADF"
 
-send_gdb "tbreak 182\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*read 1:.*OK.*test_read \\(\\) at.*$srcfile:182.*" \
+"Continuing\\..*read 1:.*OK$stop_msg" \
 "Reading from a file"
 
-send_gdb "tbreak 186\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*read 2:.*EBADF.*test_read \\(\\) at.*$srcfile:186.*" \
+"Continuing\\..*read 2:.*EBADF$stop_msg" \
 "Read using invalid file descriptor returns EBADF"
 
-send_gdb "tbreak 221\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*lseek 1:.*OK.*lseek 2:.*OK.*lseek 3:.*OK.*test_lseek \\(\\) at.*$srcfile:221.*" \
-"Lseeking a file"
+"Continuing\\..*lseek 1:.*OK$stop_msg" \
+"Lseeking CUR a file"
+
+gdb_test continue \
+"Continuing\\..*lseek 2:.*OK$stop_msg" \
+"Lseeking END a file"
+
+gdb_test continue \
+"Continuing\\..*lseek 3:.*OK$stop_msg" \
+"Lseeking SET a file"
+
 
-send_gdb "tbreak 241\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*close 1:.*OK.*test_close \\(\\) at.*$srcfile:241.*" \
+"Continuing\\..*close 1:.*OK$stop_msg" \
 "Closing a file"
 
-send_gdb "tbreak 245\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*close 2:.*EBADF.*test_close \\(\\) at.*$srcfile:245.*" \
+"Continuing\\..*close 2:.*EBADF$stop_msg" \
 "Closing an invalid file descriptor returns EBADF"
 
-send_gdb "tbreak 262\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*stat 1:.*OK.*test_stat \\(\\) at.*$srcfile:262.*" \
+"Continuing\\..*stat 1:.*OK$stop_msg" \
 "Stat a file"
 
-send_gdb "tbreak 267\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-       "Continuing\\..*stat 2:.*(ENOENT|EFAULT).*test_stat \\(\\) at.*$srcfile:267.*" \
+       "Continuing\\..*stat 2:.*(ENOENT|EFAULT)$stop_msg" \
 "Stat a NULL pathname returns ENOENT or EFAULT"
 
-send_gdb "tbreak 272\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*stat 3:.*ENOENT.*test_stat \\(\\) at.*$srcfile:272.*" \
+"Continuing\\..*stat 3:.*ENOENT$stop_msg" \
 "Stat an empty pathname returns ENOENT"
 
-send_gdb "tbreak 276\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*stat 4:.*ENOENT.*test_stat \\(\\) at.*$srcfile:276.*" \
+"Continuing\\..*stat 4:.*ENOENT$stop_msg" \
 "Stat a nonexistant file returns ENOENT"
 
-send_gdb "tbreak 301\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*fstat 1:.*OK.*test_fstat \\(\\) at.*$srcfile:301.*" \
+"Continuing\\..*fstat 1:.*OK$stop_msg" \
 "Fstat an open file"
 
-send_gdb "tbreak 305\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*fstat 2:.*EBADF.*test_fstat \\(\\) at.*$srcfile:305.*" \
+"Continuing\\..*fstat 2:.*EBADF$stop_msg" \
 "Fstat an invalid file descriptor returns EBADF"
 
-send_gdb "tbreak 314\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*isatty 1:.*OK.*test_isatty \\(\\) at.*$srcfile:314.*" \
+"Continuing\\..*isatty 1:.*OK$stop_msg" \
 "Isatty (stdin)"
 
-send_gdb "tbreak 315\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*isatty 2:.*OK.*test_isatty \\(\\) at.*$srcfile:315.*" \
+"Continuing\\..*isatty 2:.*OK$stop_msg" \
 "Isatty (stdout)"
 
-send_gdb "tbreak 317\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*isatty 3:.*OK.*test_isatty \\(\\) at.*$srcfile:317.*" \
+"Continuing\\..*isatty 3:.*OK$stop_msg" \
 "Isatty (stderr)"
 
-send_gdb "tbreak 319\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*isatty 4:.*OK.*test_isatty \\(\\) at.*$srcfile:319.*" \
+"Continuing\\..*isatty 4:.*OK$stop_msg" \
 "Isatty (invalid fd)"
 
-send_gdb "tbreak 327\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*isatty 5:.*OK.*test_isatty \\(\\) at.*$srcfile:327.*" \
+"Continuing\\..*isatty 5:.*OK$stop_msg" \
 "Isatty (open file)"
 
 send_gdb "set remote system-call-allowed 1\n"; gdb_expect -re ".*$gdb_prompt $"
-send_gdb "tbreak 347\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*system 1:.*OK.*test_system \\(\\) at.*$srcfile:347.*" \
+"Continuing\\..*system 1:.*OK$stop_msg" \
 "System(3) call"
 
 # Is this ok?  POSIX says system returns a waitpid status?
-send_gdb "tbreak 349\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*system 2:.*OK.*test_system \\(\\) at.*$srcfile:349.*" \
+"Continuing\\..*system 2:.*OK$stop_msg" \
 "System with invalid command returns 127"
 
-send_gdb "tbreak 378\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*rename 1:.*OK.*test_rename \\(\\) at.*$srcfile:378.*" \
+"Continuing\\..*rename 1:.*OK$stop_msg" \
 "Rename a file"
 
-send_gdb "tbreak 383\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*rename 2:.*EISDIR.*test_rename \\(\\) at.*$srcfile:383.*" \
+"Continuing\\..*rename 2:.*EISDIR$stop_msg" \
 "Renaming a file to existing directory returns EISDIR"
 
-send_gdb "tbreak 388\n" ; gdb_expect -re "$gdb_prompt $"
 set test "Renaming a directory to a non-empty directory returns ENOTEMPTY or EEXIST"
 gdb_test_multiple continue "${test}" {
-    -re "Continuing\\..*rename 3:.*(ENOTEMPTY|EEXIST).*test_rename \\(\\) at.*$srcfile:388.*$gdb_prompt $" {
+    -re "Continuing\\..*rename 3:.*(ENOTEMPTY|EEXIST)$stop_msg$gdb_prompt $" {
        pass "${test}"
     }
-    -re "Continuing\\..*rename 3:.*EBUSY.*test_rename \\(\\) at.*$srcfile:388.*$gdb_prompt $" {
+    -re "Continuing\\..*rename 3:.*EBUSY$stop_msg$gdb_prompt $" {
        # At least version <= 2.6/2004-01-08 of the Linux Kernel gets
        # this wrong (reporting EBUSY) when the file system is NFS
        # mounted.
@@ -230,45 +212,38 @@ gdb_test_multiple continue "${test}" {
     }
 }
 
-send_gdb "tbreak 393\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*rename 4:.*EINVAL.*test_rename \\(\\) at.*$srcfile:393.*" \
+"Continuing\\..*rename 4:.*EINVAL$stop_msg" \
 "Renaming a directory to a subdir of itself returns EINVAL"
 
-send_gdb "tbreak 397\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*rename 5:.*ENOENT.*test_rename \\(\\) at.*$srcfile:397.*" \
+"Continuing\\..*rename 5:.*ENOENT$stop_msg" \
 "Renaming a nonexistant file returns ENOENT"
 
-send_gdb "tbreak 412\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*unlink 1:.*OK.*test_unlink \\(\\) at.*$srcfile:412.*" \
+"Continuing\\..*unlink 1:.*OK$stop_msg" \
 "Unlink a file"
 
-send_gdb "tbreak 432\n" ; gdb_expect -re "$gdb_prompt $"
 # This test fails on Cygwin because unlink() succeeds on Win32 systems
 # in that situation.
 if [ishost *cygwin*] {
     setup_xfail "*-*-*"
 }
 gdb_test continue \
-"Continuing\\..*unlink 2:.*EACCES.*test_unlink \\(\\) at.*$srcfile:432.*" \
+"Continuing\\..*unlink 2:.*EACCES$stop_msg" \
 "Unlinking a file in a directory w/o write access returns EACCES"
 
-send_gdb "tbreak 436\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*unlink 3:.*ENOENT.*test_unlink \\(\\) at.*$srcfile:436.*" \
+"Continuing\\..*unlink 3:.*ENOENT$stop_msg" \
 "Unlinking a nonexistant file returns ENOENT"
 
-send_gdb "tbreak 446\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*time 1:.*OK.*test_time \\(\\) at.*$srcfile:446.*" \
+"Continuing\\..*time 1:.*OK$stop_msg" \
 "Time(2) call returns the same value as in parameter"
 
 sleep 2
-send_gdb "tbreak 450\n" ; gdb_expect -re "$gdb_prompt $"
 gdb_test continue \
-"Continuing\\..*time 2:.*OK.*test_time \\(\\) at.*$srcfile:450.*" \
+"Continuing\\..*time 2:.*OK$stop_msg" \
 "Time(2) returns feasible values"
 
 send_gdb "quit\n"
index 0b3fd13..fa75251 100644 (file)
@@ -52,4 +52,5 @@ int main()
 
   w = 45;
 
+  int j = 0;
 }
index 4c34dcf..c63cfaf 100644 (file)
@@ -288,7 +288,7 @@ gdb_expect {
 # Step over next assignment to w
 send_gdb "next\n"
 gdb_expect {
-   -re "55\[ \t\]*\}\r\n$gdb_prompt $" {
+    -re "55\[ \t\]*int j = 0;\r\n$gdb_prompt $" {
       pass "next 4"
     }
     -re ".*$gdb_prompt $" { fail "next 4" }
index 5658b29..72f5cf0 100644 (file)
@@ -40,16 +40,16 @@ mi_delete_breakpoints
 mi_gdb_reinitialize_dir $srcdir/$subdir
 mi_gdb_load ${binfile}
 
-set line_dct_close_brace [expr [gdb_get_line_number "snp2.long_ptr = &z3;"] + 1]
+set line_dct_end [gdb_get_line_number "{int a = 0;}"]
 
-mi_gdb_test "200-break-insert $line_dct_close_brace" \
-       "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"$line_dct_close_brace\",times=\"0\"\}" \
+mi_gdb_test "200-break-insert $srcfile:$line_dct_end" \
+       "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"$line_dct_end\",times=\"0\"\}" \
        "break-insert operation"
 
 mi_run_cmd
 # The running part has been checked already by mi_run_cmd
 gdb_expect {
-    -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_dct_close_brace\"\}\r\n$mi_gdb_prompt$" {
+    -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_dct_end\"\}\r\n$mi_gdb_prompt$" {
        pass "run to do_children_tests"
     }
     -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
index a196440..0465945 100644 (file)
@@ -40,16 +40,16 @@ mi_delete_breakpoints
 mi_gdb_reinitialize_dir $srcdir/$subdir
 mi_gdb_load ${binfile}
 
-set line_dct_close_brace [expr [gdb_get_line_number "snp2.long_ptr = &z3;"] + 1]
+set line_dct_end [gdb_get_line_number "{int a = 0;}"]
 
-mi_gdb_test "200-break-insert $line_dct_close_brace" \
-       "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"$line_dct_close_brace\",times=\"0\"\}" \
+mi_gdb_test "200-break-insert $srcfile:$line_dct_end" \
+       "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"$line_dct_end\",times=\"0\"\}" \
        "break-insert operation"
 
 mi_run_cmd
 # The running part has been checked already by mi_run_cmd
 gdb_expect {
-    -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"$line_dct_close_brace\"\}\r\n$mi_gdb_prompt$" {
+    -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"$line_dct_end\"\}\r\n$mi_gdb_prompt$" {
        pass "run to do_children_tests"
     }
     -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
index 4ccd570..761e804 100644 (file)
@@ -278,6 +278,7 @@ do_children_tests (void)
   snp0.long_ptr = &y3;
   snp1.long_ptr = &x3;
   snp2.long_ptr = &z3;
+  {int a = 0;}
 }
 
 void