Date: Fri, 9 Jun 2023 10:11:07 +0800
Subject: Print the Exception event in more detail

---
 hotspot/src/share/vm/runtime/sharedRuntime.cpp | 6 +++---
 hotspot/src/share/vm/runtime/sharedRuntime.hpp | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
index 5eabd3df0..58c302da7 100644
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
@@ -599,19 +599,19 @@ oop SharedRuntime::retrieve_receiver( Symbol* sig, frame caller ) {
 }
 
 
-void SharedRuntime::throw_and_post_jvmti_exception(JavaThread *thread, Handle h_exception) {
+void SharedRuntime::throw_and_post_jvmti_exception(JavaThread *thread, Handle h_exception, const char *message) {
   if (JvmtiExport::can_post_on_exceptions()) {
     vframeStream vfst(thread, true);
     methodHandle method = methodHandle(thread, vfst.method());
     address bcp = method()->bcp_from(vfst.bci());
     JvmtiExport::post_exception_throw(thread, method(), bcp, h_exception());
   }
-  Exceptions::_throw(thread, __FILE__, __LINE__, h_exception);
+  Exceptions::_throw(thread, __FILE__, __LINE__, h_exception, message);
 }
 
 void SharedRuntime::throw_and_post_jvmti_exception(JavaThread *thread, Symbol* name, const char *message) {
   Handle h_exception = Exceptions::new_exception(thread, name, message);
-  throw_and_post_jvmti_exception(thread, h_exception);
+  throw_and_post_jvmti_exception(thread, h_exception, message);
 }
 
 // The interpreter code to call this tracing function is only
diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.hpp b/hotspot/src/share/vm/runtime/sharedRuntime.hpp
index c6a96a858..acab7ffc4 100644
--- a/hotspot/src/share/vm/runtime/sharedRuntime.hpp
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.hpp
@@ -246,7 +246,7 @@ class SharedRuntime: AllStatic {
 #endif // PRODUCT
 
   // Helper routine for full-speed JVMTI exception throwing support
-  static void throw_and_post_jvmti_exception(JavaThread *thread, Handle h_exception);
+  static void throw_and_post_jvmti_exception(JavaThread *thread, Handle h_exception, const char *message = NULL);
   static void throw_and_post_jvmti_exception(JavaThread *thread, Symbol* name, const char *message = NULL);
 
   // RedefineClasses() tracing support for obsolete method entry
-- 
2.22.0

