975 {
976 return JVMTI_FUNC_PTR(gdata->jvmti,GetSourceDebugExtension)
977 (gdata->jvmti, clazz, extensionPtr);
978 }
979
980 /*
981 * Convert the signature "Ljava/lang/Foo;" to a
982 * classname "java.lang.Foo" compatible with the pattern.
983 * Signature is overwritten in-place.
984 */
985 void
986 convertSignatureToClassname(char *convert)
987 {
988 char *p;
989
990 p = convert + 1;
991 while ((*p != ';') && (*p != '\0')) {
992 char c = *p;
993 if (c == '/') {
994 *(p-1) = '.';
995 } else {
996 *(p-1) = c;
997 }
998 p++;
999 }
1000 *(p-1) = '\0';
1001 }
1002
1003 static void
1004 handleInterrupt(void)
1005 {
1006 /*
1007 * An interrupt is handled:
1008 *
1009 * 1) for running application threads by deferring the interrupt
1010 * until the current event handler has concluded.
1011 *
1012 * 2) for debugger threads by ignoring the interrupt; this is the
1013 * most robust solution since debugger threads don't use interrupts
1014 * to signal any condition.
|
975 {
976 return JVMTI_FUNC_PTR(gdata->jvmti,GetSourceDebugExtension)
977 (gdata->jvmti, clazz, extensionPtr);
978 }
979
980 /*
981 * Convert the signature "Ljava/lang/Foo;" to a
982 * classname "java.lang.Foo" compatible with the pattern.
983 * Signature is overwritten in-place.
984 */
985 void
986 convertSignatureToClassname(char *convert)
987 {
988 char *p;
989
990 p = convert + 1;
991 while ((*p != ';') && (*p != '\0')) {
992 char c = *p;
993 if (c == '/') {
994 *(p-1) = '.';
995 } else if (c == '.') {
996 // class signature of a hidden class is "Ljava/lang/Foo.1234;"
997 // map to "java.lang.Foo/1234"
998 *(p-1) = '/';
999 } else {
1000 *(p-1) = c;
1001 }
1002 p++;
1003 }
1004 *(p-1) = '\0';
1005 }
1006
1007 static void
1008 handleInterrupt(void)
1009 {
1010 /*
1011 * An interrupt is handled:
1012 *
1013 * 1) for running application threads by deferring the interrupt
1014 * until the current event handler has concluded.
1015 *
1016 * 2) for debugger threads by ignoring the interrupt; this is the
1017 * most robust solution since debugger threads don't use interrupts
1018 * to signal any condition.
|