1290
1291 bad_option_with_errmsg:
1292 ERROR_MESSAGE(("JDWP %s: %s=%s", errmsg, AGENTLIB, options));
1293 return JNI_FALSE;
1294
1295 bad_option_no_msg:
1296 ERROR_MESSAGE(("JDWP %s: %s=%s", "invalid option", AGENTLIB, options));
1297 return JNI_FALSE;
1298 }
1299
1300 /* All normal exit doors lead here */
1301 void
1302 debugInit_exit(jvmtiError error, const char *msg)
1303 {
1304 int exit_code = 0;
1305
1306 /* Pick an error code */
1307 if ( error != JVMTI_ERROR_NONE ) {
1308 exit_code = 1;
1309 if ( docoredump ) {
1310 finish_logging(exit_code);
1311 abort();
1312 }
1313 }
1314 if ( msg==NULL ) {
1315 msg = "";
1316 }
1317
1318 LOG_MISC(("Exiting with error %s(%d): %s", jvmtiErrorText(error), error, msg));
1319
1320 gdata->vmDead = JNI_TRUE;
1321
1322 /* Let's try and cleanup the JVMTI, if we even have one */
1323 if ( gdata->jvmti != NULL ) {
1324 /* Dispose of jvmti (gdata->jvmti becomes NULL) */
1325 disposeEnvironment(gdata->jvmti);
1326 }
1327
1328 /* Finish up logging. We reach here if JDWP is doing the exiting. */
1329 finish_logging(exit_code); /* Only first call matters */
1330
1331 /* Let's give the JNI a FatalError if non-exit 0, which is historic way */
1332 if ( exit_code != 0 ) {
1333 JNIEnv *env = NULL;
1334 jniFatalError(env, msg, error, exit_code);
1335 }
1336
1337 /* Last chance to die, this kills the entire process. */
1338 forceExit(exit_code);
1339 }
|
1290
1291 bad_option_with_errmsg:
1292 ERROR_MESSAGE(("JDWP %s: %s=%s", errmsg, AGENTLIB, options));
1293 return JNI_FALSE;
1294
1295 bad_option_no_msg:
1296 ERROR_MESSAGE(("JDWP %s: %s=%s", "invalid option", AGENTLIB, options));
1297 return JNI_FALSE;
1298 }
1299
1300 /* All normal exit doors lead here */
1301 void
1302 debugInit_exit(jvmtiError error, const char *msg)
1303 {
1304 int exit_code = 0;
1305
1306 /* Pick an error code */
1307 if ( error != JVMTI_ERROR_NONE ) {
1308 exit_code = 1;
1309 if ( docoredump ) {
1310 LOG_MISC(("Dumping core as requested by command line"));
1311 finish_logging(exit_code);
1312 abort();
1313 }
1314 }
1315
1316 if ( msg==NULL ) {
1317 msg = "";
1318 }
1319
1320 LOG_MISC(("Exiting with error %s(%d): %s", jvmtiErrorText(error), error, msg));
1321
1322 if (gdata != NULL) {
1323 gdata->vmDead = JNI_TRUE;
1324
1325 /* Let's try and cleanup the JVMTI, if we even have one */
1326 if ( gdata->jvmti != NULL ) {
1327 /* Dispose of jvmti (gdata->jvmti becomes NULL) */
1328 disposeEnvironment(gdata->jvmti);
1329 }
1330 }
1331
1332 /* Finish up logging. We reach here if JDWP is doing the exiting. */
1333 finish_logging(exit_code); /* Only first call matters */
1334
1335 /* Let's give the JNI a FatalError if non-exit 0, which is historic way */
1336 if ( exit_code != 0 ) {
1337 JNIEnv *env = NULL;
1338 jniFatalError(env, msg, error, exit_code);
1339 }
1340
1341 /* Last chance to die, this kills the entire process. */
1342 forceExit(exit_code);
1343 }
|