< prev index next >

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

Print this page

 418     switch (evinfo->ei) {
 419         case EI_SINGLE_STEP:
 420             writeSingleStepEvent(env, out, evinfo);
 421             break;
 422         case EI_BREAKPOINT:
 423             writeBreakpointEvent(env, out, evinfo);
 424             break;
 425         case EI_FIELD_ACCESS:
 426             writeFieldAccessEvent(env, out, evinfo);
 427             break;
 428         case EI_FIELD_MODIFICATION:
 429             writeFieldModificationEvent(env, out, evinfo);
 430             break;
 431         case EI_EXCEPTION:
 432             writeExceptionEvent(env, out, evinfo);
 433             break;
 434         case EI_THREAD_START:
 435         case EI_THREAD_END:
 436             writeThreadEvent(env, out, evinfo);
 437             break;







 438         case EI_CLASS_LOAD:
 439         case EI_CLASS_PREPARE:
 440             writeClassEvent(env, out, evinfo);
 441             break;
 442         case EI_MONITOR_CONTENDED_ENTER:
 443         case EI_MONITOR_CONTENDED_ENTERED:
 444         case EI_MONITOR_WAIT:
 445         case EI_MONITOR_WAITED:
 446             writeMonitorEvent(env, out, evinfo);
 447             break;
 448         case EI_VM_DEATH:
 449             writeVMDeathEvent(env, out, evinfo);
 450             break;
 451         default:
 452             EXIT_ERROR(AGENT_ERROR_INVALID_EVENT_TYPE,"unknown event index");
 453             break;
 454     }
 455     tossEventInfoRefs(env, evinfo);
 456 }
 457 

 544     for (i = 0; i < count; i++) {
 545         CommandSingle *single = &(recc->singleCommand[i]);
 546         switch (single->singleKind) {
 547             case COMMAND_SINGLE_EVENT:
 548                 handleEventCommandSingle(env, &out,
 549                                          &single->u.eventCommand);
 550                 break;
 551             case COMMAND_SINGLE_UNLOAD:
 552                 handleUnloadCommandSingle(env, &out,
 553                                           &single->u.unloadCommand);
 554                 break;
 555             case COMMAND_SINGLE_FRAME_EVENT:
 556                 handleFrameEventCommandSingle(env, &out,
 557                                               &single->u.frameEventCommand);
 558                 break;
 559         }
 560     }
 561 
 562     outStream_sendCommand(&out);
 563     outStream_destroy(&out);




 564 }
 565 
 566 static void
 567 handleReportInvokeDoneCommand(JNIEnv* env, ReportInvokeDoneCommand *command)
 568 {
 569     invoker_completeInvokeRequest(command->thread);
 570     tossGlobalRef(env, &(command->thread));
 571 }
 572 
 573 static void
 574 handleReportVMInitCommand(JNIEnv* env, ReportVMInitCommand *command)
 575 {
 576     PacketOutputStream out;
 577 
 578     if (command->suspendPolicy == JDWP_SUSPEND_POLICY(ALL)) {
 579         (void)threadControl_suspendAll();
 580     } else if (command->suspendPolicy == JDWP_SUSPEND_POLICY(EVENT_THREAD)) {
 581         (void)threadControl_suspendThread(command->thread, JNI_FALSE);
 582     }
 583 

 418     switch (evinfo->ei) {
 419         case EI_SINGLE_STEP:
 420             writeSingleStepEvent(env, out, evinfo);
 421             break;
 422         case EI_BREAKPOINT:
 423             writeBreakpointEvent(env, out, evinfo);
 424             break;
 425         case EI_FIELD_ACCESS:
 426             writeFieldAccessEvent(env, out, evinfo);
 427             break;
 428         case EI_FIELD_MODIFICATION:
 429             writeFieldModificationEvent(env, out, evinfo);
 430             break;
 431         case EI_EXCEPTION:
 432             writeExceptionEvent(env, out, evinfo);
 433             break;
 434         case EI_THREAD_START:
 435         case EI_THREAD_END:
 436             writeThreadEvent(env, out, evinfo);
 437             break;
 438         case EI_VIRTUAL_THREAD_START:
 439         case EI_VIRTUAL_THREAD_END:
 440             /* Note that when we wrote the evinfo->ei byte above, it was mapped to an EI_THREAD_XXX event
 441              * by eventIndex2jdwp(), so we didn't actually write the VIRTUAL_THREAD ei byte.
 442              */
 443             writeThreadEvent(env, out, evinfo);
 444             break;
 445         case EI_CLASS_LOAD:
 446         case EI_CLASS_PREPARE:
 447             writeClassEvent(env, out, evinfo);
 448             break;
 449         case EI_MONITOR_CONTENDED_ENTER:
 450         case EI_MONITOR_CONTENDED_ENTERED:
 451         case EI_MONITOR_WAIT:
 452         case EI_MONITOR_WAITED:
 453             writeMonitorEvent(env, out, evinfo);
 454             break;
 455         case EI_VM_DEATH:
 456             writeVMDeathEvent(env, out, evinfo);
 457             break;
 458         default:
 459             EXIT_ERROR(AGENT_ERROR_INVALID_EVENT_TYPE,"unknown event index");
 460             break;
 461     }
 462     tossEventInfoRefs(env, evinfo);
 463 }
 464 

 551     for (i = 0; i < count; i++) {
 552         CommandSingle *single = &(recc->singleCommand[i]);
 553         switch (single->singleKind) {
 554             case COMMAND_SINGLE_EVENT:
 555                 handleEventCommandSingle(env, &out,
 556                                          &single->u.eventCommand);
 557                 break;
 558             case COMMAND_SINGLE_UNLOAD:
 559                 handleUnloadCommandSingle(env, &out,
 560                                           &single->u.unloadCommand);
 561                 break;
 562             case COMMAND_SINGLE_FRAME_EVENT:
 563                 handleFrameEventCommandSingle(env, &out,
 564                                               &single->u.frameEventCommand);
 565                 break;
 566         }
 567     }
 568 
 569     outStream_sendCommand(&out);
 570     outStream_destroy(&out);
 571 
 572     // vthread fixme: if we didn't do any suspending, we should allow the vthread ThreadNode
 573     // to be released at this point. The thread in question can be extracted the way it is
 574     // done in the first loop above.
 575 }
 576 
 577 static void
 578 handleReportInvokeDoneCommand(JNIEnv* env, ReportInvokeDoneCommand *command)
 579 {
 580     invoker_completeInvokeRequest(command->thread);
 581     tossGlobalRef(env, &(command->thread));
 582 }
 583 
 584 static void
 585 handleReportVMInitCommand(JNIEnv* env, ReportVMInitCommand *command)
 586 {
 587     PacketOutputStream out;
 588 
 589     if (command->suspendPolicy == JDWP_SUSPEND_POLICY(ALL)) {
 590         (void)threadControl_suspendAll();
 591     } else if (command->suspendPolicy == JDWP_SUSPEND_POLICY(EVENT_THREAD)) {
 592         (void)threadControl_suspendThread(command->thread, JNI_FALSE);
 593     }
 594 
< prev index next >