RFR: 8062247: Allow WhiteBox test to access JVM offsets
Yumin Qi
yumin.qi at oracle.com
Mon Nov 3 21:15:17 UTC 2014
If you check the name passed to this function, it already told (I just
changed to getOffsetForName and in testing):
wb.getOffsetForName("FileMapHeader::_crc")
Do not need to give type info(that will need build a list for type info
like in vmStructs). This is a simple code fore testing purpose, I think
we should keep it simple. I added that if the offsetname not supported,
throw exception instead. Will post webrev today after jprt finished.
Thanks
Yumin
On 11/3/2014 12:05 PM, Mikhailo Seledtsov wrote:
> Hi Yumin,
>
> If this API is intended to get offsets for various data structures, I
> would expect a data structure type identified to be passed as a
> parameter. For instance,
>
> public native int getOffset(String dataStructureId, String fieldName)
> where
> dataStructureId would be some kind of ID for data structure,
> either data structure name or internal alias
> fieldName - the name of the field for which the offset value
> is returned
> A specific error code could be returned for unsupported
> dataStructureId
>
> Alternatively, this could be an API specific to a given
> data-structure. E.g. getMySpecifiedDatastructOffset(String fieldName)
>
> Thank you,
> Misha
>
>
> On 11/2/2014 9:52 PM, Yumin Qi wrote:
>> Misha,
>>
>> It is a generic name, now it only targets on FileMapHeader, it can
>> add other data structure of vm if needed in future. Maybe a name like
>> getOffsetForName(String name) is better?
>>
>> Thanks
>> Yumin
>>
>> On 10/31/2014 11:56 AM, Mikhailo Seledtsov wrote:
>>> Hi Yumin,
>>>
>>> The name getOffsets() seems too generic. Perhaps, we could rename
>>> it to be more specific to the task.
>>>
>>> Thank you,
>>> Misha
>>>
>>> On 10/29/2014 5:46 PM, Yumin Qi wrote:
>>>> Please review the new changeset at same location.
>>>> New API supply an interface to get data member offset by it's name.
>>>> http://cr.openjdk.java.net/~minqi/8062247/webrev00/
>>>>
>>>> Thanks
>>>> Yumin
>>>>
>>>> On 10/27/2014 9:01 PM, Yumin Qi wrote:
>>>>> Please review
>>>>>
>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8062247
>>>>> webrev: http://cr.openjdk.java.net/~minqi/8062247/webrev00/
>>>>>
>>>>> Summary: Internal test failed since the variable offsets changed
>>>>> in hotspot. The way to get offset in the test is hard-coded. To
>>>>> reduce the risk of future changes of hotspot offsets, the fix add
>>>>> a WhiteBox API function to get a map for FileMapHeaderInfo, which
>>>>> return the members' offsets in a Hashtable.
>>>>>
>>>>> Tests: JPRT, jtreg.
>>>>>
>>>>> Thanks
>>>>> Yumin
>>>>
>>>
>>
>
More information about the hotspot-runtime-dev
mailing list