< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/GetLocalVariable/getlocal003/getlocal003.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 65,131 **** table[i].start_location + table[i].length < location) { continue; /* The local variable is not visible */ } print_LocalVariableEntry(&table[i]); char sig = table[i].signature[0]; - int slot = table[i].slot; if (sig == 'Z' || sig == 'B' || sig == 'C' || sig == 'S') { sig = 'I'; // covered by GetLocalInt } ! err = jvmti->GetLocalInt(thr, 0, slot, &intVal); printf(" GetLocalInt: %s (%d)\n", TranslateError(err), err); if (err != JVMTI_ERROR_NONE && sig == 'I') { printf("FAIL: GetLocalInt failed to get value of int\n"); result = STATUS_FAILED; } else if (err != JVMTI_ERROR_TYPE_MISMATCH && sig != 'I') { printf("FAIL: GetLocalInt did not return JVMTI_ERROR_TYPE_MISMATCH for non-int\n"); result = STATUS_FAILED; } ! err = jvmti->GetLocalLong(thr, 0, slot, &longVal); printf(" GetLocalLong: %s (%d)\n", TranslateError(err), err); if (err != JVMTI_ERROR_NONE && sig == 'J') { printf("FAIL: GetLocalLong failed to get value of long\n"); result = STATUS_FAILED; ! } else if (err != JVMTI_ERROR_INVALID_SLOT && ! err != JVMTI_ERROR_TYPE_MISMATCH && ! sig != 'J') { ! printf("FAIL: GetLocalLong did not return JVMTI_ERROR_INVALID_SLOT" ! " nor JVMTI_ERROR_TYPE_MISMATCH for non-long\n"); result = STATUS_FAILED; } ! err = jvmti->GetLocalFloat(thr, 0, slot, &floatVal); printf(" GetLocalFloat: %s (%d)\n", TranslateError(err), err); ! if (err != JVMTI_ERROR_NONE && sig == 'F') { printf("FAIL: GetLocalFloat failed to get value of float\n"); result = STATUS_FAILED; ! } else if (err != JVMTI_ERROR_TYPE_MISMATCH && sig != 'F') { printf("FAIL: GetLocalFloat did not return JVMTI_ERROR_TYPE_MISMATCH for non-float\n"); result = STATUS_FAILED; } ! err = jvmti->GetLocalDouble(thr, 0, slot, &doubleVal); printf(" GetLocalDouble: %s (%d)\n", TranslateError(err), err); ! if (err != JVMTI_ERROR_NONE && sig == 'D') { printf("FAIL: GetLocalDouble failed to get value of double\n"); result = STATUS_FAILED; ! } else if (err != JVMTI_ERROR_INVALID_SLOT && ! err != JVMTI_ERROR_TYPE_MISMATCH && ! sig != 'D') { ! printf("FAIL: GetLocalDouble did not return JVMTI_ERROR_INVALID_SLOT" ! " nor JVMTI_ERROR_TYPE_MISMATCH for non-double\n"); result = STATUS_FAILED; } ! err = jvmti->GetLocalObject(thr, 0, slot, &obj); printf(" GetLocalObject: %s (%d)\n", TranslateError(err), err); ! if (err != JVMTI_ERROR_NONE && sig == 'L') { printf("FAIL: GetLocalObject failed to get value of object\n"); result = STATUS_FAILED; ! } else if (err != JVMTI_ERROR_TYPE_MISMATCH && sig != 'L') { printf("FAIL: GetLocalObject did not return JVMTI_ERROR_TYPE_MISMATCH for non-object\n"); result = STATUS_FAILED; } } } --- 65,124 ---- table[i].start_location + table[i].length < location) { continue; /* The local variable is not visible */ } print_LocalVariableEntry(&table[i]); char sig = table[i].signature[0]; if (sig == 'Z' || sig == 'B' || sig == 'C' || sig == 'S') { sig = 'I'; // covered by GetLocalInt } ! err = jvmti->GetLocalInt(thr, 0, table[i].slot, &intVal); printf(" GetLocalInt: %s (%d)\n", TranslateError(err), err); if (err != JVMTI_ERROR_NONE && sig == 'I') { printf("FAIL: GetLocalInt failed to get value of int\n"); result = STATUS_FAILED; } else if (err != JVMTI_ERROR_TYPE_MISMATCH && sig != 'I') { printf("FAIL: GetLocalInt did not return JVMTI_ERROR_TYPE_MISMATCH for non-int\n"); result = STATUS_FAILED; } ! err = jvmti->GetLocalLong(thr, 0, table[i].slot, &longVal); printf(" GetLocalLong: %s (%d)\n", TranslateError(err), err); if (err != JVMTI_ERROR_NONE && sig == 'J') { printf("FAIL: GetLocalLong failed to get value of long\n"); result = STATUS_FAILED; ! } else if (err != JVMTI_ERROR_TYPE_MISMATCH && sig != 'J') { ! printf("FAIL: GetLocalLong did not return JVMTI_ERROR_TYPE_MISMATCH for non-long\n"); result = STATUS_FAILED; } ! err = jvmti->GetLocalFloat(thr, 0, table[i].slot, &floatVal); printf(" GetLocalFloat: %s (%d)\n", TranslateError(err), err); ! if (err != JVMTI_ERROR_NONE && table[i].signature[0] == 'F') { printf("FAIL: GetLocalFloat failed to get value of float\n"); result = STATUS_FAILED; ! } else if (err != JVMTI_ERROR_TYPE_MISMATCH && table[i].signature[0] != 'F') { printf("FAIL: GetLocalFloat did not return JVMTI_ERROR_TYPE_MISMATCH for non-float\n"); result = STATUS_FAILED; } ! err = jvmti->GetLocalDouble(thr, 0, table[i].slot, &doubleVal); printf(" GetLocalDouble: %s (%d)\n", TranslateError(err), err); ! if (err != JVMTI_ERROR_NONE && table[i].signature[0] == 'D') { printf("FAIL: GetLocalDouble failed to get value of double\n"); result = STATUS_FAILED; ! } else if (err != JVMTI_ERROR_TYPE_MISMATCH && table[i].signature[0] != 'D') { ! printf("FAIL: GetLocalDouble did not return JVMTI_ERROR_TYPE_MISMATCH for non-double\n"); result = STATUS_FAILED; } ! err = jvmti->GetLocalObject(thr, 0, table[i].slot, &obj); printf(" GetLocalObject: %s (%d)\n", TranslateError(err), err); ! if (err != JVMTI_ERROR_NONE && table[i].signature[0] == 'L') { printf("FAIL: GetLocalObject failed to get value of object\n"); result = STATUS_FAILED; ! } else if (err != JVMTI_ERROR_TYPE_MISMATCH && table[i].signature[0] != 'L') { printf("FAIL: GetLocalObject did not return JVMTI_ERROR_TYPE_MISMATCH for non-object\n"); result = STATUS_FAILED; } } }
< prev index next >