< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t011/cm01t011.cpp

Print this page


   1 /*
   2  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */


 321     jvmtiCapabilities caps;
 322 */
 323 
 324     NSK_DISPLAY0("Checking positive: GetLocalVariableTable\n");
 325     if (!NSK_JVMTI_VERIFY(jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
 326         return NSK_FALSE;
 327 
 328 /* DEBUG -- while thread should be suspended
 329     memset(&caps, 0, sizeof(caps));
 330     caps.can_suspend = 1;
 331     if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
 332         return JNI_ERR;
 333     if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread)))
 334         return NSK_FALSE;
 335 */
 336 
 337     for (i = 0; i < count; i++) {
 338         if (strcmp(local_variable_table[i].name, "o") == 0) {
 339             NSK_DISPLAY0("Checking positive: GetLocalObject\n");
 340             if (!NSK_JVMTI_VERIFY(
 341                     jvmti->GetLocalObject(thread, 1, local_variable_table[i].slot, &object_value)))
 342                 return NSK_FALSE;
 343 
 344             NSK_DISPLAY0("Checking positive: SetLocalObject\n");
 345             if (!NSK_JVMTI_VERIFY(
 346                     jvmti->SetLocalObject(thread, 1, local_variable_table[i].slot, object_value)))
 347                 return NSK_FALSE;
 348         } else if (strcmp(local_variable_table[i].name, "i") == 0) {
 349             NSK_DISPLAY0("Checking positive: GetLocalInt\n");
 350             if (!NSK_JVMTI_VERIFY(
 351                     jvmti->GetLocalInt(thread, 1, local_variable_table[i].slot, &int_value)))
 352                 return NSK_FALSE;
 353 
 354             NSK_DISPLAY0("Checking positive: SetLocalInt\n");
 355             if (!NSK_JVMTI_VERIFY(
 356                     jvmti->SetLocalInt(thread, 1, local_variable_table[i].slot, int_value)))
 357                 return NSK_FALSE;
 358         } else if (strcmp(local_variable_table[i].name, "l") == 0) {
 359             NSK_DISPLAY0("Checking positive: GetLocalLong\n");
 360             if (!NSK_JVMTI_VERIFY(
 361                     jvmti->GetLocalLong(thread, 1, local_variable_table[i].slot, &long_value)))
 362                 return NSK_FALSE;
 363 
 364             NSK_DISPLAY0("Checking positive: SetLocalLong\n");
 365             if (!NSK_JVMTI_VERIFY(
 366                     jvmti->SetLocalLong(thread, 1, local_variable_table[i].slot, long_value)))
 367                 return NSK_FALSE;
 368         } else if (strcmp(local_variable_table[i].name, "f") == 0) {
 369             NSK_DISPLAY0("Checking positive: GetLocalFloat\n");
 370             if (!NSK_JVMTI_VERIFY(
 371                     jvmti->GetLocalFloat(thread, 1, local_variable_table[i].slot, &float_value)))
 372                 return NSK_FALSE;
 373 
 374             NSK_DISPLAY0("Checking positive: SetLocalFloat\n");
 375             if (!NSK_JVMTI_VERIFY(
 376                     jvmti->SetLocalFloat(thread, 1, local_variable_table[i].slot, float_value)))
 377                 return NSK_FALSE;
 378         } else if (strcmp(local_variable_table[i].name, "d") == 0) {
 379             NSK_DISPLAY0("Checking positive: GetLocalDouble\n");
 380             if (!NSK_JVMTI_VERIFY(
 381                     jvmti->GetLocalDouble(thread, 1, local_variable_table[i].slot, &double_value)))
 382                 return NSK_FALSE;
 383 
 384             NSK_DISPLAY0("Checking positive: SetLocalDouble\n");
 385             if (!NSK_JVMTI_VERIFY(
 386                     jvmti->SetLocalDouble(thread, 1, local_variable_table[i].slot, double_value)))
 387                 return NSK_FALSE;
 388         }
 389     }
 390 
 391 /* DEBUG -- while thread should be suspended
 392     if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread)))
 393         return NSK_FALSE;
 394     if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
 395         return JNI_ERR;
 396 */
 397 
 398     if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)local_variable_table)))
 399         return NSK_FALSE;
 400 
 401     return NSK_TRUE;
 402 }
 403 
 404 /* Check "can_get_source_info" functions
 405  */
 406 static int checkSourceInfoFunctions() {


   1 /*
   2  * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */


 321     jvmtiCapabilities caps;
 322 */
 323 
 324     NSK_DISPLAY0("Checking positive: GetLocalVariableTable\n");
 325     if (!NSK_JVMTI_VERIFY(jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
 326         return NSK_FALSE;
 327 
 328 /* DEBUG -- while thread should be suspended
 329     memset(&caps, 0, sizeof(caps));
 330     caps.can_suspend = 1;
 331     if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
 332         return JNI_ERR;
 333     if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread)))
 334         return NSK_FALSE;
 335 */
 336 
 337     for (i = 0; i < count; i++) {
 338         if (strcmp(local_variable_table[i].name, "o") == 0) {
 339             NSK_DISPLAY0("Checking positive: GetLocalObject\n");
 340             if (!NSK_JVMTI_VERIFY(
 341                     jvmti->GetLocalObject(thread, 2, local_variable_table[i].slot, &object_value)))
 342                 return NSK_FALSE;
 343 
 344             NSK_DISPLAY0("Checking positive: SetLocalObject\n");
 345             if (!NSK_JVMTI_VERIFY(
 346                     jvmti->SetLocalObject(thread, 2, local_variable_table[i].slot, object_value)))
 347                 return NSK_FALSE;
 348         } else if (strcmp(local_variable_table[i].name, "i") == 0) {
 349             NSK_DISPLAY0("Checking positive: GetLocalInt\n");
 350             if (!NSK_JVMTI_VERIFY(
 351                     jvmti->GetLocalInt(thread, 2, local_variable_table[i].slot, &int_value)))
 352                 return NSK_FALSE;
 353 
 354             NSK_DISPLAY0("Checking positive: SetLocalInt\n");
 355             if (!NSK_JVMTI_VERIFY(
 356                     jvmti->SetLocalInt(thread, 2, local_variable_table[i].slot, int_value)))
 357                 return NSK_FALSE;
 358         } else if (strcmp(local_variable_table[i].name, "l") == 0) {
 359             NSK_DISPLAY0("Checking positive: GetLocalLong\n");
 360             if (!NSK_JVMTI_VERIFY(
 361                     jvmti->GetLocalLong(thread, 2, local_variable_table[i].slot, &long_value)))
 362                 return NSK_FALSE;
 363 
 364             NSK_DISPLAY0("Checking positive: SetLocalLong\n");
 365             if (!NSK_JVMTI_VERIFY(
 366                     jvmti->SetLocalLong(thread, 2, local_variable_table[i].slot, long_value)))
 367                 return NSK_FALSE;
 368         } else if (strcmp(local_variable_table[i].name, "f") == 0) {
 369             NSK_DISPLAY0("Checking positive: GetLocalFloat\n");
 370             if (!NSK_JVMTI_VERIFY(
 371                     jvmti->GetLocalFloat(thread, 2, local_variable_table[i].slot, &float_value)))
 372                 return NSK_FALSE;
 373 
 374             NSK_DISPLAY0("Checking positive: SetLocalFloat\n");
 375             if (!NSK_JVMTI_VERIFY(
 376                     jvmti->SetLocalFloat(thread, 2, local_variable_table[i].slot, float_value)))
 377                 return NSK_FALSE;
 378         } else if (strcmp(local_variable_table[i].name, "d") == 0) {
 379             NSK_DISPLAY0("Checking positive: GetLocalDouble\n");
 380             if (!NSK_JVMTI_VERIFY(
 381                     jvmti->GetLocalDouble(thread, 2, local_variable_table[i].slot, &double_value)))
 382                 return NSK_FALSE;
 383 
 384             NSK_DISPLAY0("Checking positive: SetLocalDouble\n");
 385             if (!NSK_JVMTI_VERIFY(
 386                     jvmti->SetLocalDouble(thread, 2, local_variable_table[i].slot, double_value)))
 387                 return NSK_FALSE;
 388         }
 389     }
 390 
 391 /* DEBUG -- while thread should be suspended
 392     if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread)))
 393         return NSK_FALSE;
 394     if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
 395         return JNI_ERR;
 396 */
 397 
 398     if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)local_variable_table)))
 399         return NSK_FALSE;
 400 
 401     return NSK_TRUE;
 402 }
 403 
 404 /* Check "can_get_source_info" functions
 405  */
 406 static int checkSourceInfoFunctions() {


< prev index next >