< prev index next >

src/jdk.jdwp.agent/share/native/libjdwp/StackFrameImpl.c

Print this page




 231         return JNI_TRUE;
 232     }
 233     frame = inStream_readFrameID(in);
 234     if (inStream_error(in)) {
 235         return JNI_TRUE;
 236     }
 237     variableCount = inStream_readInt(in);
 238     if (inStream_error(in)) {
 239         return JNI_TRUE;
 240     }
 241 
 242     /*
 243      * Validate the frame id
 244      */
 245     serror = validateThreadFrame(thread, frame);
 246     if (serror != JDWP_ERROR(NONE)) {
 247         outStream_setError(out, serror);
 248         return JNI_TRUE;
 249     }
 250 









 251     (void)outStream_writeInt(out, variableCount);
 252     for (i = 0; (i < variableCount) && !outStream_error(out); i++) {
 253         jint slot;
 254         jbyte typeKey;
 255         FrameNumber fnum;
 256 
 257         slot = inStream_readInt(in);
 258         if (inStream_error(in))
 259             break;
 260         typeKey = inStream_readByte(in);
 261         if (inStream_error(in))
 262             break;
 263 
 264         fnum = getFrameNumber(frame);
 265         serror = writeVariableValue(env, out, thread, fnum, slot, typeKey);
 266         if (serror != JDWP_ERROR(NONE)) {
 267             outStream_setError(out, serror);
 268             break;
 269         }
 270     }


 431     frame = inStream_readFrameID(in);
 432     if (inStream_error(in)) {
 433         return JNI_TRUE;
 434     }
 435 
 436     /*
 437      * Validate the frame id
 438      */
 439     serror = validateThreadFrame(thread, frame);
 440     if (serror != JDWP_ERROR(NONE)) {
 441         outStream_setError(out, serror);
 442         return JNI_TRUE;
 443     }
 444 
 445     if (threadControl_isDebugThread(thread)) {
 446         outStream_setError(out, JDWP_ERROR(INVALID_THREAD));
 447         return JNI_TRUE;
 448     }
 449 
 450     fnum = getFrameNumber(frame);

 451     error = threadControl_popFrames(thread, fnum);
 452     if (error != JVMTI_ERROR_NONE) {
 453         serror = map2jdwpError(error);
 454         outStream_setError(out, serror);
 455     }
 456     return JNI_TRUE;
 457 }
 458 
 459 void *StackFrame_Cmds[] = { (void *)0x4
 460     ,(void *)getValues
 461     ,(void *)setValues
 462     ,(void *)thisObject
 463     ,(void *)popFrames
 464 };


 231         return JNI_TRUE;
 232     }
 233     frame = inStream_readFrameID(in);
 234     if (inStream_error(in)) {
 235         return JNI_TRUE;
 236     }
 237     variableCount = inStream_readInt(in);
 238     if (inStream_error(in)) {
 239         return JNI_TRUE;
 240     }
 241 
 242     /*
 243      * Validate the frame id
 244      */
 245     serror = validateThreadFrame(thread, frame);
 246     if (serror != JDWP_ERROR(NONE)) {
 247         outStream_setError(out, serror);
 248         return JNI_TRUE;
 249     }
 250 
 251     if (isFiber(thread)) {
 252         thread = threadControl_getFiberCarrierOrHelperThread(thread);
 253         if (thread == NULL) {
 254             /* fiber fixme: we failed to get the helper thread. Just return 0 locals. */
 255             (void)outStream_writeInt(out, 0);
 256             return JNI_TRUE;
 257         }
 258     }
 259 
 260     (void)outStream_writeInt(out, variableCount);
 261     for (i = 0; (i < variableCount) && !outStream_error(out); i++) {
 262         jint slot;
 263         jbyte typeKey;
 264         FrameNumber fnum;
 265 
 266         slot = inStream_readInt(in);
 267         if (inStream_error(in))
 268             break;
 269         typeKey = inStream_readByte(in);
 270         if (inStream_error(in))
 271             break;
 272 
 273         fnum = getFrameNumber(frame);
 274         serror = writeVariableValue(env, out, thread, fnum, slot, typeKey);
 275         if (serror != JDWP_ERROR(NONE)) {
 276             outStream_setError(out, serror);
 277             break;
 278         }
 279     }


 440     frame = inStream_readFrameID(in);
 441     if (inStream_error(in)) {
 442         return JNI_TRUE;
 443     }
 444 
 445     /*
 446      * Validate the frame id
 447      */
 448     serror = validateThreadFrame(thread, frame);
 449     if (serror != JDWP_ERROR(NONE)) {
 450         outStream_setError(out, serror);
 451         return JNI_TRUE;
 452     }
 453 
 454     if (threadControl_isDebugThread(thread)) {
 455         outStream_setError(out, JDWP_ERROR(INVALID_THREAD));
 456         return JNI_TRUE;
 457     }
 458 
 459     fnum = getFrameNumber(frame);
 460     /* fiber fixme: add fiber support */
 461     error = threadControl_popFrames(thread, fnum);
 462     if (error != JVMTI_ERROR_NONE) {
 463         serror = map2jdwpError(error);
 464         outStream_setError(out, serror);
 465     }
 466     return JNI_TRUE;
 467 }
 468 
 469 void *StackFrame_Cmds[] = { (void *)0x4
 470     ,(void *)getValues
 471     ,(void *)setValues
 472     ,(void *)thisObject
 473     ,(void *)popFrames
 474 };
< prev index next >