comparison agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java @ 2072:d6cd0d55d0b5

6987812: 2/3 SAJDI: "gHotSpotVMTypes was not initialized properly in the remote process" Summary: Change ExportDirectoryTableImpl to return the 'Export RVA' field without modification. Read 'Base Of Data' field in optional header when PE32 format COFF file is read. Refine search for dbgeng.dll and dbghelp.dll. Other cleanups. Reviewed-by: swamyv, poonam
author dcubed
date Thu, 23 Dec 2010 07:58:35 -0800
parents c18cbe5936b8
children 3582bf76420e
comparison
equal deleted inserted replaced
2071:07c62ff47437 2072:d6cd0d55d0b5
1 /* 1 /*
2 * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
97 long typeEntryIsIntegerTypeOffset; 97 long typeEntryIsIntegerTypeOffset;
98 long typeEntryIsUnsignedOffset; 98 long typeEntryIsUnsignedOffset;
99 long typeEntrySizeOffset; 99 long typeEntrySizeOffset;
100 long typeEntryArrayStride; 100 long typeEntryArrayStride;
101 101
102 // Fetch the address of the VMTypeEntry*. We get this symbol first
103 // and try to use it to make sure that symbol lookup is working.
104 Address entryAddr = lookupInProcess("gHotSpotVMTypes");
105 // System.err.println("gHotSpotVMTypes address = " + entryAddr);
106 // Dereference this once to get the pointer to the first VMTypeEntry
107 // dumpMemory(entryAddr, 80);
108 entryAddr = entryAddr.getAddressAt(0);
109
110 if (entryAddr == null) {
111 throw new RuntimeException("gHotSpotVMTypes was not initialized properly in the remote process; can not continue");
112 }
113
102 typeEntryTypeNameOffset = getLongValueFromProcess("gHotSpotVMTypeEntryTypeNameOffset"); 114 typeEntryTypeNameOffset = getLongValueFromProcess("gHotSpotVMTypeEntryTypeNameOffset");
103 typeEntrySuperclassNameOffset = getLongValueFromProcess("gHotSpotVMTypeEntrySuperclassNameOffset"); 115 typeEntrySuperclassNameOffset = getLongValueFromProcess("gHotSpotVMTypeEntrySuperclassNameOffset");
104 typeEntryIsOopTypeOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsOopTypeOffset"); 116 typeEntryIsOopTypeOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsOopTypeOffset");
105 typeEntryIsIntegerTypeOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsIntegerTypeOffset"); 117 typeEntryIsIntegerTypeOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsIntegerTypeOffset");
106 typeEntryIsUnsignedOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsUnsignedOffset"); 118 typeEntryIsUnsignedOffset = getLongValueFromProcess("gHotSpotVMTypeEntryIsUnsignedOffset");
107 typeEntrySizeOffset = getLongValueFromProcess("gHotSpotVMTypeEntrySizeOffset"); 119 typeEntrySizeOffset = getLongValueFromProcess("gHotSpotVMTypeEntrySizeOffset");
108 typeEntryArrayStride = getLongValueFromProcess("gHotSpotVMTypeEntryArrayStride"); 120 typeEntryArrayStride = getLongValueFromProcess("gHotSpotVMTypeEntryArrayStride");
109
110 // Fetch the address of the VMTypeEntry*
111 Address entryAddr = lookupInProcess("gHotSpotVMTypes");
112 // System.err.println("gHotSpotVMTypes address = " + entryAddr);
113 // Dereference this once to get the pointer to the first VMTypeEntry
114 // dumpMemory(entryAddr, 80);
115 entryAddr = entryAddr.getAddressAt(0);
116
117 if (entryAddr == null) {
118 throw new RuntimeException("gHotSpotVMTypes was not initialized properly in the remote process; can not continue");
119 }
120 121
121 // Start iterating down it until we find an entry with no name 122 // Start iterating down it until we find an entry with no name
122 Address typeNameAddr = null; 123 Address typeNameAddr = null;
123 do { 124 do {
124 // Fetch the type name first 125 // Fetch the type name first