1/* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19/** 20 * @author Anatoly F. Bondarenko 21 */ 22 23/** 24 * Created on 13.07.2005 25 */ 26package org.apache.harmony.jpda.tests.jdwp.ObjectReference; 27 28import org.apache.harmony.jpda.tests.share.JPDADebuggeeSynchronizer; 29import org.apache.harmony.jpda.tests.share.SyncDebuggee; 30 31public class GetValues003Debuggee extends SyncDebuggee { 32 33 static GetValues003Debuggee testedObject; 34 35 int intArrayField[]; // JDWP_TAG_ARRAY = 91 36 GetValues003Debuggee objectArrayField[]; // JDWP_TAG_ARRAY = 91 37 GetValues003Debuggee objectField; // JDWP_TAG_OBJECT = 76 38 String stringField; // JDWP_TAG_STRING = 115 39 Thread threadField; // JDWP_TAG_THREAD = 116 40 ThreadGroup threadGroupField; // JDWP_TAG_THREAD_GROUP = 103 41 Class classField; // JDWP_TAG_CLASS_OBJECT = 99 42 ClassLoader classLoaderField; // DWP_TAG_CLASS_LOADER = 108 43 44 45 46 public void run() { 47 logWriter.println("--> Debuggee: GetValues003Debuggee: START"); 48 testedObject = new GetValues003Debuggee(); 49 50 testedObject.intArrayField = new int[1]; 51 testedObject.intArrayField[0]= 999; 52 testedObject.objectArrayField = new GetValues003Debuggee[1]; 53 testedObject.objectArrayField[0] = new GetValues003Debuggee(); 54 testedObject.objectField = new GetValues003Debuggee(); 55 testedObject.stringField = "stringField"; 56 testedObject.threadField = new GetValues003DebuggeeThread(); 57 testedObject.threadGroupField = new ThreadGroup("ThreadGroupName"); 58 testedObject.classField = GetValues003Debuggee.class; 59 testedObject.classLoaderField = testedObject.classField.getClassLoader(); 60 61 testedObject.intArrayField = null; 62 testedObject.objectArrayField = null; 63 testedObject.objectField = null; 64 testedObject.stringField = null; 65 testedObject.threadField = null; 66 testedObject.threadGroupField = null; 67 testedObject.classField = null; 68 testedObject.classLoaderField = null; 69 70 logWriter.println("\n--> Debuggee: GetValues003Debuggee: Before ObjectReference::GetValues command:"); 71 logWriter.println("--> intArrayField value = " + testedObject.intArrayField); 72 logWriter.println("--> objectArrayField value = " + testedObject.objectArrayField); 73 logWriter.println("--> objectField value = " + testedObject.objectField); 74 logWriter.println("--> stringField value = " + testedObject.stringField); 75 logWriter.println("--> threadField value = " + testedObject.threadField); 76 logWriter.println("--> threadGroupField value = " + testedObject.threadGroupField); 77 logWriter.println("--> classField value = " + testedObject.classField); 78 logWriter.println("--> classLoaderField value = " + testedObject.classLoaderField); 79 80 synchronizer.sendMessage(JPDADebuggeeSynchronizer.SGNL_READY); 81 82 synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_CONTINUE); 83 84 logWriter.println("--> Debuggee: GetValues003Debuggee: FINISH"); 85 } 86 87 public static void main(String [] args) { 88 runDebuggee(GetValues003Debuggee.class); 89 } 90} 91 92class GetValues003DebuggeeThread extends Thread { 93 public void myMethod() { 94 } 95} 96