2004-06-07 Randolph Chung <tausq@debian.org>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / selftest.exp
index 5d9419ed29862aa52aa921ff7196826e9efce0b5..4196b74e7860e28c352cf29bf529b07b4a111515 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
@@ -32,15 +32,6 @@ if [is_remote target] {
     return
 }
 
-if [istarget "m68k*-*-hpux*"] then {
-    # The top-level makefile passes CFLAGS= (no -g) for hp300.  This probably
-    # should be fixed (it is only needed for gcc bootstrapping, not gdb),
-    # but until then.....
-    setup_xfail "*-*-*"
-    fail "cannot test self if compiled without debug info"
-    return -1
-}
-
 # Not all of the lines of code near the start of main are executed for
 # every machine.  Also, optimization may reorder some of the lines.
 # So all we do is try to step or next over everything until we get
@@ -52,7 +43,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
@@ -104,6 +95,9 @@ proc do_steps_and_nexts {} {
                set command "next"
            }
            -re ".*START_PROGRESS.*$gdb_prompt $" {
+               # Note: ezannoni/2004/02/17: This check should be
+               # removed, since as of today that source line is not
+               # in gdb anymore.
                set description "next over START_PROGRESS and everything it calls"
                set command "next"
            }
@@ -115,6 +109,10 @@ proc do_steps_and_nexts {} {
                set description "next over init_malloc and everything it calls"
                set command "next"
            }
+           -re ".*lim_at_start.*$gdb_prompt $" {
+               set description "next over lim_at_start initialization"
+               set command "next"
+           }
            -re ".*count . 0x3.*$gdb_prompt $" {
                set description "next over conditional stack alignment code 1"
                set command "next"
@@ -176,6 +174,18 @@ proc do_steps_and_nexts {} {
                set description "step over gdb_sysroot initialization"
                set command "step"
            }
+           -re ".*ndir = 0.*$gdb_prompt $" {
+               set description "step over ndir initialization"
+               set command "step"
+           }
+           -re ".*instream = stdin.*$gdb_prompt $" {
+               set description "step over instream initialization"
+               set command "step"
+           }
+           -re ".*getcwd .gdb_dirbuf, sizeof .gdb_dirbuf..;.*$gdb_prompt $" {
+               set description "next over getcwd"
+               set command "next"
+           }
            -re "\[ \t\]+\{\r\n$gdb_prompt $" {
                setup_xfail "mips-*-irix5*"
                fail "$description ended up at odd location"
@@ -323,10 +333,36 @@ 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 ".*cmdarg = .* xmalloc.*$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"
        }
This page took 0.026385 seconds and 4 git commands to generate.