jdk/test/com/sun/jdi/JdbMethodExitTest.sh
author jjg
Thu, 22 May 2008 15:51:41 -0700
changeset 655 1ebc7ce89018
parent 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
6705945: com.sun.tools.javac.zip files do not have valid copyright Reviewed-by: mcimadamore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#!/bin/sh
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
# Copyright 2004-2005 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
# have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#  @test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#  @bug 6202891
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#  @summary TTY: Add support for method exit event return values to jdb
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#  @author Jim Holmlund
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#  @run shell JdbMethodExitTest.sh
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
# These are variables that can be set to control execution
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#pkg=untitled7
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
classname=JdbMethodExitTest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
compileOptions=-g
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
#java="java_g"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
#set -x
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
createJavaFile()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    cat <<EOF > $classname.java.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import java.net.URLClassLoader;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
import java.net.URL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * This tests the jdb trace command
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
class $classname {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    // These are the values that will be returned by the methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    static URL[] urls = new URL[1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    public static byte      byteValue = 89;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    public static char      charValue = 'x';
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    public static double    doubleValue = 2.2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    public static float     floatValue = 3.3f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    public static int       intValue = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    public static short     shortValue = 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    public static boolean   booleanValue = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    public static Class       classValue = Object.class;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    public static ClassLoader classLoaderValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
            urls[0] = new URL("hi there");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        } catch (java.net.MalformedURLException ee) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        classLoaderValue = new URLClassLoader(urls);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    public static Thread      threadValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    public static ThreadGroup threadGroupValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    public static String      stringValue = "abc";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    public static int[]       intArrayValue = new int[] {1, 2, 3};
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    public static $classname  objectValue = 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        new $classname();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    public String ivar = stringValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    // These are the instance methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    public byte i_bytef()            { return byteValue; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    public char i_charf()            { return charValue; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    public double i_doublef()        { return doubleValue; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    public float i_floatf()          { return floatValue; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    public int i_intf()              { return intValue; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    public short i_shortf()          { return shortValue; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    public boolean i_booleanf()      { return booleanValue; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    public String i_stringf()        { return stringValue; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    public Class i_classf()          { return classValue; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    public ClassLoader i_classLoaderf()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                                     { return classLoaderValue; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    public Thread i_threadf()        { return threadValue = Thread.currentThread(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    public ThreadGroup i_threadGroupf()  
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
                                     { return threadGroupValue = threadValue.getThreadGroup(); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    public int[] i_intArrayf()       { return intArrayValue; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    public Object i_nullObjectf()    { return null; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    public Object i_objectf()        { return objectValue; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    public void i_voidf()            {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    static void doit($classname xx) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        xx.i_bytef();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        xx.i_charf();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        xx.i_doublef();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        xx.i_floatf();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        xx.i_intf();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        xx.i_shortf();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        xx.i_booleanf();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        xx.i_stringf();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        xx.i_intArrayf();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        xx.i_classf();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        xx.i_classLoaderf();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        xx.i_threadf();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        xx.i_threadGroupf();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        xx.i_nullObjectf();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        xx.i_objectf();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        xx.i_voidf();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        // Prove it works for native methods too
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        StrictMath.sin(doubleValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        stringValue.intern();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    public static void bkpt() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
       int i = 0;     //@1 breakpoint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    public static String traceMethods() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        return "traceMethods";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    public static String traceMethods1() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        return "traceMethods1";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    public static String traceExits() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        return "traceExits";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    public static String traceExits1() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        return "traceExits1";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    public static String traceExit() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        return "traceExit";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    public static String traceExit1() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        return "traceExit1";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    public static void main(String[] args) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        // The debugger will stop at the start of main,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        // enable method exit events, and then do
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        // a resume.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        $classname xx = new $classname();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        bkpt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        // test all possible return types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        doit(xx);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        bkpt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
       // test trace methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
       traceMethods();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
       // test trace go methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
       traceMethods1();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
       bkpt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
       // test trace method exits
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
       traceExits();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
       // test trace method exits
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
       traceExits1();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
       bkpt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
       
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
       // test trace method exit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
       traceExit();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
       // test trace method exit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
       traceExit1();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
       bkpt();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
       
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
EOF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
# drive jdb by sending cmds to it and examining its output
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
dojdbCmds()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    setBkpts @1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    # test all possible return types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    runToBkpt @1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    cmd untrace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    cmd trace methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    cmd trace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    jdbFailIfNotPresent "trace methods in effect"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    cmd trace go methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    cmd trace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    jdbFailIfNotPresent "trace go methods in effect"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    cmd trace method exits
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    cmd trace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    jdbFailIfNotPresent "trace method exits in effect"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    cmd trace go method exits
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    cmd trace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    jdbFailIfNotPresent "trace go method exits in effect"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    cmd trace method exit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    cmd trace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    jdbFailIfNotPresent "trace method exit in effect for JdbMethodExitTest.bkpt"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    cmd trace go method exit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    cmd trace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    jdbFailIfNotPresent "trace go method exit in effect for JdbMethodExitTest.bkpt"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    # trace exit of methods with all the return values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    # (but just check a couple of them)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    cmd trace go exits
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    cmd cont
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    jdbFailIfNotPresent "instance of JdbMethodExitTest"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    jdbFailIfNotPresent "return value = 8"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    # Get out of bkpt back to the call to traceMethods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    cmd step up
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    cmd trace methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    cmd cont
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    jdbFailIfNotPresent "Method entered:"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    cmd cont
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    jdbFailIfNotPresent "Method exited: return value = \"traceMethods\""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    cmd step up
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    cmd trace go methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    cmd cont
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    jdbFailIfNotPresent "Method entered: \"thread=main\", JdbMethodExitTest.traceMethods1"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    jdbFailIfNotPresent 'Method exited: .* JdbMethodExitTest.traceMethods1'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    cmd untrace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    cmd step up
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    cmd trace method exits
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    cmd cont
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    jdbFailIfNotPresent "Method exited: return value = \"traceExits\""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    cmd untrace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    cmd step up
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    cmd trace go method exits
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
    cmd cont
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    jdbFailIfNotPresent 'Method exited: .* JdbMethodExitTest.traceExits1'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    cmd untrace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
    cmd step up
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    cmd step            # step into traceExit()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
    cmd trace method exit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    cmd cont
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    jdbFailIfNotPresent "Method exited: return value = \"traceExit\""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
    cmd untrace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    cmd step up
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
    cmd step
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    cmd step           # skip over setting return value in caller :-(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
    cmd trace go method exit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    cmd cont
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
    jdbFailIfNotPresent 'Method exited: .*JdbMethodExitTest.traceExit1'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    cmd quit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
mysetup()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
    if [ -z "$TESTSRC" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
        TESTSRC=.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
    fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
    for ii in . $TESTSRC $TESTSRC/.. ; do
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
        if [ -r "$ii/ShellScaffold.sh" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
            . $ii/ShellScaffold.sh 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
            break
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
        fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
    done
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
# You could replace this next line with the contents
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
# of ShellScaffold.sh and this script will run just the same.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
mysetup
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
runit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
jdbFailIfNotPresent "Breakpoint hit"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
pass