jdk/test/com/sun/jdi/ShellScaffold.sh
changeset 23603 c561991073ad
parent 23046 0b0407b1e2a5
child 23881 f4fc1826e04a
equal deleted inserted replaced
23602:ff671719d44a 23603:c561991073ad
   906     fi
   906     fi
   907 
   907 
   908     debuggeepid=
   908     debuggeepid=
   909     waitForJdbMsg Listening 4
   909     waitForJdbMsg Listening 4
   910 
   910 
   911     beOption="-agentlib:jdwp=transport=$transport,address=$address,server=n,suspend=y"
   911     beOption="-agentlib:jdwp=transport=$transport,address=$address,server=n,suspend=y" 
   912 #   beOption="-Xdebug -Xrunjdwp:transport=$transport,address=$address,server=n,suspend=y"
   912 #   beOption="-Xdebug -Xrunjdwp:transport=$transport,address=$address,server=n,suspend=y"
   913 
   913 
   914     thecmd="$jdk/bin/$java $mode -classpath $tmpFileDir $baseArgs $args \
   914     thecmd="$jdk/bin/$java $mode -classpath $tmpFileDir $baseArgs $args \
   915             -Djtreg.classDir=$TESTCLASSES \
   915             -Djtreg.classDir=$TESTCLASSES \
   916             -showversion \
   916             -showversion \
   974     while [ 1 = 1 ] ; do
   974     while [ 1 = 1 ] ; do
   975         findPid $jdbpid
   975         findPid $jdbpid
   976         if [ $? != 0 ] ; then
   976         if [ $? != 0 ] ; then
   977             break
   977             break
   978         fi
   978         fi
       
   979 
   979         if [ ! -z "$isWin98" ] ; then
   980         if [ ! -z "$isWin98" ] ; then
   980             $psCmd | $grep -i 'JDB\.EXE' >$devnull 2>&1
   981             $psCmd | $grep -i 'JDB\.EXE' >$devnull 2>&1
   981             if [ $? != 0 ] ; then
   982             if [ $? != 0 ] ; then
   982                 break
   983                 break
   983             fi
   984             fi
   984         fi
   985         fi
   985         # Something went wrong
   986 
   986         jdbFailIfPresent "Input stream closed"
   987         # (Don't use jdbFailIfPresent here since it is not safe 
       
   988         # to call from different processes)
       
   989 	$grep -s 'Input stream closed' $jdbOutFile > $devnull 2>&1
       
   990 	if [ $? = 0 ] ; then
       
   991             dofail "jdb input stream closed prematurely"
       
   992 	fi
   987 
   993 
   988         # If a failure has occured, quit
   994         # If a failure has occured, quit
   989         if [ -r "$failFile" ] ; then
   995         if [ -r "$failFile" ] ; then
   990             break
   996             break
   991         fi
   997         fi
   992 
   998 
   993         sleep ${sleep_seconds}
   999         sleep ${sleep_seconds}
   994     done
  1000     done
   995 
  1001 
   996     # jdb exited because its input stream closed prematurely
  1002     # jdb exited because its input stream closed prematurely
   997     jdbFailIfPresent "Input stream closed"
  1003     # (Don't use jdbFailIfPresent here since it is not safe 
       
  1004     # to call from different processes)
       
  1005     $grep -s 'Input stream closed' $jdbOutFile > $devnull 2>&1
       
  1006     if [ $? = 0 ] ; then
       
  1007         dofail "jdb input stream closed prematurely"
       
  1008     fi
   998 
  1009 
   999     # It is necessary here to avoid the situation when JDB exited but
  1010     # It is necessary here to avoid the situation when JDB exited but
  1000     # mydojdbCmds() didn't finish because it waits for JDB message
  1011     # mydojdbCmds() didn't finish because it waits for JDB message
  1001     # in waitForJdbMsg(), at the same time main process will finish
  1012     # in waitForJdbMsg(), at the same time main process will finish
  1002     # the execution with no errors.
  1013     # the execution with no errors.
  1083             # remove the copy of the target file
  1094             # remove the copy of the target file
  1084             rm -f "$theFile"
  1095             rm -f "$theFile"
  1085         fi
  1096         fi
  1086         unset theFile
  1097         unset theFile
  1087     esac
  1098     esac
       
  1099 
  1088     return $stat
  1100     return $stat
  1089 }
  1101 }
  1090 
  1102 
  1091 # $1 is the filename, $2 is the regexp to match and return,
  1103 # $1 is the filename, $2 is the regexp to match and return,
  1092 # $3 is the number of lines to search (from the end)
  1104 # $3 is the number of lines to search (from the end)