< prev index next >

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

Print this page




 501 
 502         case JDWP_REQUEST_MODIFIER(ClassExclude): {
 503             if (patternStringMatch(classname,
 504                       filter->u.ClassExclude.classPattern)) {
 505                 return JNI_FALSE;
 506             }
 507             break;
 508         }
 509 
 510         case JDWP_REQUEST_MODIFIER(Step):
 511                 if (!isSameObject(env, thread, filter->u.Step.thread)) {
 512                     return JNI_FALSE;
 513                 }
 514                 if (!stepControl_handleStep(env, thread, clazz, method)) {
 515                     return JNI_FALSE;
 516                 }
 517                 break;
 518 
 519           case JDWP_REQUEST_MODIFIER(SourceNameMatch): {
 520               char* desiredNamePattern = filter->u.SourceNameOnly.sourceNamePattern;
 521               if (!searchAllSourceNames(env, clazz,
 522                            desiredNamePattern) == 1) {
 523                   /* The name isn't in the SDE; try the sourceName in the ref
 524                    * type
 525                    */
 526                   char *sourceName = 0;
 527                   jvmtiError error = JVMTI_FUNC_PTR(gdata->jvmti,GetSourceFileName)
 528                                             (gdata->jvmti, clazz, &sourceName);
 529                   if (error == JVMTI_ERROR_NONE &&
 530                       sourceName != 0 &&
 531                       patternStringMatch(sourceName, desiredNamePattern)) {
 532                           // got a hit - report the event
 533                           jvmtiDeallocate(sourceName);
 534                           break;
 535                   }
 536                   // We have no match, we have no source file name,
 537                   // or we got a JVM TI error. Don't report the event.
 538                   jvmtiDeallocate(sourceName);
 539                   return JNI_FALSE;
 540               }
 541               break;
 542           }




 501 
 502         case JDWP_REQUEST_MODIFIER(ClassExclude): {
 503             if (patternStringMatch(classname,
 504                       filter->u.ClassExclude.classPattern)) {
 505                 return JNI_FALSE;
 506             }
 507             break;
 508         }
 509 
 510         case JDWP_REQUEST_MODIFIER(Step):
 511                 if (!isSameObject(env, thread, filter->u.Step.thread)) {
 512                     return JNI_FALSE;
 513                 }
 514                 if (!stepControl_handleStep(env, thread, clazz, method)) {
 515                     return JNI_FALSE;
 516                 }
 517                 break;
 518 
 519           case JDWP_REQUEST_MODIFIER(SourceNameMatch): {
 520               char* desiredNamePattern = filter->u.SourceNameOnly.sourceNamePattern;
 521               if (searchAllSourceNames(env, clazz,
 522                            desiredNamePattern) != 1) {
 523                   /* The name isn't in the SDE; try the sourceName in the ref
 524                    * type
 525                    */
 526                   char *sourceName = 0;
 527                   jvmtiError error = JVMTI_FUNC_PTR(gdata->jvmti,GetSourceFileName)
 528                                             (gdata->jvmti, clazz, &sourceName);
 529                   if (error == JVMTI_ERROR_NONE &&
 530                       sourceName != 0 &&
 531                       patternStringMatch(sourceName, desiredNamePattern)) {
 532                           // got a hit - report the event
 533                           jvmtiDeallocate(sourceName);
 534                           break;
 535                   }
 536                   // We have no match, we have no source file name,
 537                   // or we got a JVM TI error. Don't report the event.
 538                   jvmtiDeallocate(sourceName);
 539                   return JNI_FALSE;
 540               }
 541               break;
 542           }


< prev index next >