This commit is contained in:
Rachel Protacio 2016-03-25 01:20:14 +00:00
commit f50eeb2649
7 changed files with 14 additions and 28 deletions

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -461,8 +461,6 @@ void ObjArrayKlass::oop_print_on(oop obj, outputStream* st) {
#endif //PRODUCT #endif //PRODUCT
static int max_objArray_print_length = 4;
void ObjArrayKlass::oop_print_value_on(oop obj, outputStream* st) { void ObjArrayKlass::oop_print_value_on(oop obj, outputStream* st) {
assert(obj->is_objArray(), "must be objArray"); assert(obj->is_objArray(), "must be objArray");
st->print("a "); st->print("a ");
@ -470,16 +468,6 @@ void ObjArrayKlass::oop_print_value_on(oop obj, outputStream* st) {
int len = objArrayOop(obj)->length(); int len = objArrayOop(obj)->length();
st->print("[%d] ", len); st->print("[%d] ", len);
obj->print_address_on(st); obj->print_address_on(st);
if (NOT_PRODUCT(PrintOopAddress ||) PrintMiscellaneous && (WizardMode || Verbose)) {
st->print("{");
for (int i = 0; i < len; i++) {
if (i > max_objArray_print_length) {
st->print("..."); break;
}
st->print(" " INTPTR_FORMAT, (intptr_t)(void*)objArrayOop(obj)->obj_at(i));
}
st->print(" }");
}
} }
const char* ObjArrayKlass::internal_name() const { const char* ObjArrayKlass::internal_name() const {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -44,9 +44,8 @@ void oopDesc::print_on(outputStream* st) const {
} }
void oopDesc::print_address_on(outputStream* st) const { void oopDesc::print_address_on(outputStream* st) const {
if (PrintOopAddress) { st->print("{" INTPTR_FORMAT "}", p2i(this));
st->print("{" INTPTR_FORMAT "}", p2i(this));
}
} }
void oopDesc::print() { print_on(tty); } void oopDesc::print() { print_on(tty); }
@ -76,7 +75,7 @@ void oopDesc::print_value_on(outputStream* st) const {
st->print("NULL"); st->print("NULL");
} else if (java_lang_String::is_instance(obj)) { } else if (java_lang_String::is_instance(obj)) {
java_lang_String::print(obj, st); java_lang_String::print(obj, st);
if (PrintOopAddress) print_address_on(st); print_address_on(st);
} else { } else {
klass()->oop_print_value_on(obj, st); klass()->oop_print_value_on(obj, st);
} }

View file

@ -385,6 +385,7 @@ static SpecialFlag const special_jvm_flags[] = {
{ "JNIDetachReleasesMonitors", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, { "JNIDetachReleasesMonitors", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
{ "UseAltSigs", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, { "UseAltSigs", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
{ "SegmentedHeapDumpThreshold", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, { "SegmentedHeapDumpThreshold", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
{ "PrintOopAddress", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
#ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
{ "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() }, { "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() },

View file

@ -951,9 +951,6 @@ public:
notproduct(bool, PrintMallocFree, false, \ notproduct(bool, PrintMallocFree, false, \
"Trace calls to C heap malloc/free allocation") \ "Trace calls to C heap malloc/free allocation") \
\ \
product(bool, PrintOopAddress, false, \
"Always print the location of the oop") \
\
notproduct(bool, VerifyCodeCache, false, \ notproduct(bool, VerifyCodeCache, false, \
"Verify code cache on memory allocation/deallocation") \ "Verify code cache on memory allocation/deallocation") \
\ \

View file

@ -508,12 +508,13 @@ void Exceptions::log_exception(Handle exception, stringStream tempst) {
ResourceMark rm; ResourceMark rm;
Symbol* message = java_lang_Throwable::detail_message(exception()); Symbol* message = java_lang_Throwable::detail_message(exception());
if (message != NULL) { if (message != NULL) {
log_info(exceptions)("Exception <%s: %s> (" INTPTR_FORMAT ")\n thrown in %s", log_info(exceptions)("Exception <%s: %s>\n thrown in %s",
exception->print_value_string(), exception->print_value_string(),
message->as_C_string(), p2i(exception()), tempst.as_string()); message->as_C_string(),
tempst.as_string());
} else { } else {
log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ")\n thrown in %s", log_info(exceptions)("Exception <%s>\n thrown in %s",
exception->print_value_string(), exception->print_value_string(),
p2i(exception()), tempst.as_string()); tempst.as_string());
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -38,7 +38,7 @@ public class TraceExceptionsTest {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-Xlog:exceptions=info", "NoClassFound"); "-Xlog:exceptions=info", "NoClassFound");
OutputAnalyzer output = new OutputAnalyzer(pb.start()); OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("<a 'java/lang/ClassNotFoundException': NoClassFound>"); output.shouldContain("<a 'java/lang/ClassNotFoundException'").shouldContain(": NoClassFound>");
output.shouldNotContain("<a 'java/lang/ClassNotFoundException'>"); output.shouldNotContain("<a 'java/lang/ClassNotFoundException'>");
output.shouldHaveExitValue(1); output.shouldHaveExitValue(1);
} }

View file

@ -45,7 +45,7 @@ public class ExceptionsTest {
static void analyzeOutputOn(ProcessBuilder pb) throws Exception { static void analyzeOutputOn(ProcessBuilder pb) throws Exception {
OutputAnalyzer output = new OutputAnalyzer(pb.start()); OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("<a 'java/lang/RuntimeException': Test exception 1 for logging>"); output.shouldContain("<a 'java/lang/RuntimeException'").shouldContain(": Test exception 1 for logging>");
output.shouldContain(" thrown in interpreter method "); output.shouldContain(" thrown in interpreter method ");
output.shouldHaveExitValue(0); output.shouldHaveExitValue(0);
} }