15f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes/*
25f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes * Licensed to the Apache Software Foundation (ASF) under one or more
35f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes * contributor license agreements.  See the NOTICE file distributed with
45f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes * this work for additional information regarding copyright ownership.
55f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes * The ASF licenses this file to You under the Apache License, Version 2.0
65f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes * (the "License"); you may not use this file except in compliance with
75f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes * the License.  You may obtain a copy of the License at
85f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes *
95f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes *     http://www.apache.org/licenses/LICENSE-2.0
105f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes *
115f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes *  Unless required by applicable law or agreed to in writing, software
125f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes *  distributed under the License is distributed on an "AS IS" BASIS,
135f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
145f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes *
155f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes *  See the License for the specific language governing permissions and
165f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes *  limitations under the License.
175f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes */
185f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
195f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes/**
205f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes * @author Anton V. Karnachuk
215f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes */
225f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
235f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes/**
245f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes * Created on 10.02.2005
255f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes */
265f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughespackage org.apache.harmony.jpda.tests.jdwp.StackFrame;
275f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
285f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughesimport org.apache.harmony.jpda.tests.share.JPDADebuggeeSynchronizer;
295f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughesimport org.apache.harmony.jpda.tests.share.SyncDebuggee;
305f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
315f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughespublic class StackTraceDebuggee extends SyncDebuggee {
325f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
335f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes    public static void main(String [] args) {
345f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        runDebuggee(StackTraceDebuggee.class);
355f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes    }
365f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
375f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes    public void run() {
385f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        String currentThreadName = Thread.currentThread().getName();
395f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        synchronizer.sendMessage(currentThreadName);
405f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
415f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
425f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        nestledMethod1();
435f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes    }
445f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
455f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes    private void nestledMethod1() {
465f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY);
475f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
485f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
495f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        nestledMethod2();
505f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes    }
515f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
525f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes    private void nestledMethod2() {
535f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY);
545f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
555f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
565f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        nestledMethod3();
575f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes    }
585f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
595f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes    private void nestledMethod3() {
605f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        boolean boolLocalVariable = true;
615f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        int intLocalVariable = -512;
625f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        String strLocalVariable = "test string";
635f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        logWriter.println("boolLocalVariable = " + boolLocalVariable);
645f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        logWriter.println("intLocalVariable = " + intLocalVariable);
655f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        logWriter.println("strLocalVariable = " +strLocalVariable);
665f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
675f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY);
685f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes        synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE);
695f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
705f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes    }
715f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes
725f0a23683aa603d8c50b6dd071a565821b76067bElliott Hughes}