jdk/test/com/sun/jdi/DeferredStepTest.sh
changeset 45028 b0ea3c0bfb81
parent 23046 0b0407b1e2a5
equal deleted inserted replaced
45027:0cf367e546fb 45028:b0ea3c0bfb81
     1 #!/bin/sh
     1 #!/bin/sh
     2 
     2 
     3 #
     3 #
     4 # Copyright (c) 2002, 2014 Oracle and/or its affiliates. All rights reserved.
     4 # Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
     5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     6 #
     6 #
     7 # This code is free software; you can redistribute it and/or modify it
     7 # This code is free software; you can redistribute it and/or modify it
     8 # under the terms of the GNU General Public License version 2 only, as
     8 # under the terms of the GNU General Public License version 2 only, as
     9 # published by the Free Software Foundation.
     9 # published by the Free Software Foundation.
    51     cat <<EOF > $classname.java.1
    51     cat <<EOF > $classname.java.1
    52 public class $classname {
    52 public class $classname {
    53   static class  jj1 implements Runnable {
    53   static class  jj1 implements Runnable {
    54     public void  run() {
    54     public void  run() {
    55         int count = 0;
    55         int count = 0;
    56         
    56 
    57         for ( int ii = 0; ii < 10; ii++) {  // line 6
    57         for ( int ii = 0; ii < 10; ii++) {  // line 6
    58             int intInPotato04 = 666;        // line 7
    58             int intInPotato04 = 666;        // line 7
    59             ++count;                        // line 8; @1 breakpoint
    59             ++count;                        // line 8; @1 breakpoint
    60             System.out.println("Thread: " + Thread.currentThread().getName());  // line 9
    60             System.out.println("Thread: " + Thread.currentThread().getName());  // line 9
    61         }
    61         }
    63   }
    63   }
    64 
    64 
    65   static class jj2 implements Runnable {
    65   static class jj2 implements Runnable {
    66     public void run() {
    66     public void run() {
    67         int count2 = 0;
    67         int count2 = 0;
    68         
    68 
    69         for (int ii = 0; ii < 10; ii++) {      // line 18
    69         for (int ii = 0; ii < 10; ii++) {      // line 18
    70             String StringInPotato05 = "I am";  // line 19
    70             String StringInPotato05 = "I am";  // line 19
    71             ++count2;                          // line 20; @1 breakpoint
    71             ++count2;                          // line 20; @1 breakpoint
    72             System.out.println("Thread: " + Thread.currentThread().getName());  // line 21
    72             System.out.println("Thread: " + Thread.currentThread().getName());  // line 21
    73         }
    73         }
   137         TESTSRC=.
   137         TESTSRC=.
   138     fi
   138     fi
   139 
   139 
   140     for ii in . $TESTSRC $TESTSRC/.. ; do
   140     for ii in . $TESTSRC $TESTSRC/.. ; do
   141         if [ -r "$ii/ShellScaffold.sh" ] ; then
   141         if [ -r "$ii/ShellScaffold.sh" ] ; then
   142             . $ii/ShellScaffold.sh 
   142             . $ii/ShellScaffold.sh
   143             break
   143             break
   144         fi
   144         fi
   145     done
   145     done
   146 }
   146 }
   147 
   147 
   155 This test should be run and checked manually.
   155 This test should be run and checked manually.
   156 
   156 
   157 If this works right, you should see StepEvents/Breakpoint events for lines
   157 If this works right, you should see StepEvents/Breakpoint events for lines
   158    8, 9, 6, 7, 8, 9, 6, ....   for thread jj11
   158    8, 9, 6, 7, 8, 9, 6, ....   for thread jj11
   159 and
   159 and
   160   20, 21, 18, 19, 20, 21, 18, ... for thread jj2 
   160   20, 21, 18, 19, 20, 21, 18, ... for thread jj2
   161 
   161 
   162 Since both threads are running at the same time, these
   162 Since both threads are running at the same time, these
   163 events can be intermixed.
   163 events can be intermixed.
   164 
   164 
   165 The bug is that you will frequently see step events missing.
   165 The bug is that you will frequently see step events missing.
   177 Kill the test and rerun it if this happens.
   177 Kill the test and rerun it if this happens.
   178 ****************************************************************
   178 ****************************************************************
   179 
   179 
   180 EOF
   180 EOF
   181 runit
   181 runit
   182 #jdbFailIfPresent "Nothing suspended" 
   182 #jdbFailIfPresent "Nothing suspended"
   183 #pass
   183 #pass