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.
1015 *
1016 * 3) for application threads that have not started or already
1017 * ended by ignoring the interrupt. In the former case, the application
1018 * is relying on timing to determine whether or not the thread sees
1019 * the interrupt; in the latter case, the interrupt is meaningless.
|
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 // for a hidden class, map from "Ljava/lang/Foo;/1234" to "java.lang.Foo/1234"
1001 // so skip ';' and copy the suffix
1002 if ((*p == ';') && (*(p+1) == '/')) {
1003 while (*(p+1) != '\0') {
1004 char c = *(p+1);
1005 *(p-1) = c;
1006 p++;
1007 }
1008 }
1009 *(p-1) = '\0';
1010 }
1011
1012 static void
1013 handleInterrupt(void)
1014 {
1015 /*
1016 * An interrupt is handled:
1017 *
1018 * 1) for running application threads by deferring the interrupt
1019 * until the current event handler has concluded.
1020 *
1021 * 2) for debugger threads by ignoring the interrupt; this is the
1022 * most robust solution since debugger threads don't use interrupts
1023 * to signal any condition.
1024 *
1025 * 3) for application threads that have not started or already
1026 * ended by ignoring the interrupt. In the former case, the application
1027 * is relying on timing to determine whether or not the thread sees
1028 * the interrupt; in the latter case, the interrupt is meaningless.
|