8205719: Windows Java_sun_tools_attach_VirtualMachineImpl_enqueue() method should include exitCode in exception message
authorcjplummer
Wed, 27 Jun 2018 19:09:17 -0700
changeset 50859 29169633327c
parent 50858 2d3e99a72541
child 50860 480a96a43b62
8205719: Windows Java_sun_tools_attach_VirtualMachineImpl_enqueue() method should include exitCode in exception message Summary: Include GetExitCodeThread() result in the exception message Reviewed-by: sspitsyn, dcubed
src/jdk.attach/windows/native/libattach/VirtualMachineImpl.c
--- a/src/jdk.attach/windows/native/libattach/VirtualMachineImpl.c	Wed Jun 27 17:02:41 2018 -0700
+++ b/src/jdk.attach/windows/native/libattach/VirtualMachineImpl.c	Wed Jun 27 19:09:17 2018 -0700
@@ -490,9 +490,11 @@
                         JNU_ThrowIOException(env,
                             "Unable to enqueue operation: the target VM does not support attach mechanism");
                         break;
-                    default :
-                        JNU_ThrowInternalError(env,
-                            "Remote thread failed for unknown reason");
+                    default : {
+                        char errmsg[128];
+                        sprintf(errmsg, "Remote thread failed for unknown reason (%d)", exitCode);
+                        JNU_ThrowInternalError(env, errmsg);
+                    }
                 }
             }
         }