* gdb.base/selftest.exp (do_steps_and_nexts): Increase maximum
authorDaniel Jacobowitz <drow@false.org>
Sat, 28 Jun 2003 16:36:42 +0000 (16:36 +0000)
committerDaniel Jacobowitz <drow@false.org>
Sat, 28 Jun 2003 16:36:42 +0000 (16:36 +0000)
initial line count of 'captured_main' from 26 to 32.
(test_with_self): Allow xmalloc call to be interleaved with the
preceding two lines.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/selftest.exp

index e2a6aea068b9e6250a51f0c4817ab68813af2b7f..c19f3f56b91a077a0b39cc18192d87f179417b0b 100644 (file)
@@ -1,3 +1,11 @@
+2003-06-22  Michael Chastain  <mec@shout.net>
+           Daniel Jacobowitz  <drow@mvista.com>
+
+       * gdb.base/selftest.exp (do_steps_and_nexts): Increase maximum
+       initial line count of 'captured_main' from 26 to 32.
+       (test_with_self): Allow xmalloc call to be interleaved with the
+       preceding two lines.
+
 2003-06-24  Joel Brobecker  <brobecker@gnat.com>
 
        * gdb.base/bang.exp: New testcase.
index a899e36011130dba63590702a5d3734f47e356f5..57f4f3ff7aa0db5adc8a59576d1405581c00798c 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright 1988, 1990, 1991, 1992, 1994, 1997, 1999, 2000, 2002
+#   Copyright 1988, 1990, 1991, 1992, 1994, 1997, 1999, 2000, 2002, 2003
 #   Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -52,7 +52,7 @@ proc do_steps_and_nexts {} {
  
     gdb_reinitialize_dir $srcdir/..
 
-    for {set count 0} {$count < 26} {incr count} {
+    for {set count 0} {$count < 32} {incr count} {
        send_gdb "list\n"
        # NOTE: carlton/2002-12-11: The "initial brace" and
        # "current_directory initialization" possibilities happen to
@@ -327,10 +327,31 @@ proc test_with_self { executable } {
     # If we don't actually enter the xmalloc call when we give a
     # step command that seems like a genuine bug.  It seems to happen
     # on most RISC processors.
+    # NOTE drow/2003-06-22: However, if we step back to the preceding two
+    # lines, just keep stepping until we enter.
+    set stepped_back 0
     setup_xfail "alpha-*-*" "mips-*-*"
     set description "step into xmalloc call"
     send_gdb "step\n"
     gdb_expect {
+       -re "ncmd = 0;.*$gdb_prompt $" {
+           set stepped_back 1
+           send_gdb "step\n"
+           exp_continue
+       }
+       -re "dirsize = 1;.*$gdb_prompt $" {
+           set stepped_back 1
+           send_gdb "step\n"
+           exp_continue
+       }
+       -re ".*dirarg = .* xmalloc.*$gdb_prompt $" {
+           if { $stepped_back == 1 } {
+               send_gdb "step\n"
+               exp_continue
+           } else {
+               fail "$description"
+           }
+       }
        -re "xmalloc.*size=.*at.*utils.c.*$gdb_prompt $" {
            pass "$description"
        }