155 // dispatch to the diagnostic commands used for serviceability functions. |
155 // dispatch to the diagnostic commands used for serviceability functions. |
156 static jint jcmd(AttachOperation* op, outputStream* out) { |
156 static jint jcmd(AttachOperation* op, outputStream* out) { |
157 Thread* THREAD = Thread::current(); |
157 Thread* THREAD = Thread::current(); |
158 // All the supplied jcmd arguments are stored as a single |
158 // All the supplied jcmd arguments are stored as a single |
159 // string (op->arg(0)). This is parsed by the Dcmd framework. |
159 // string (op->arg(0)). This is parsed by the Dcmd framework. |
160 DCmd::parse_and_execute(out, op->arg(0), ' ', THREAD); |
160 DCmd::parse_and_execute(DCmd_Source_AttachAPI, out, op->arg(0), ' ', THREAD); |
161 if (HAS_PENDING_EXCEPTION) { |
161 if (HAS_PENDING_EXCEPTION) { |
162 java_lang_Throwable::print(PENDING_EXCEPTION, out); |
162 java_lang_Throwable::print(PENDING_EXCEPTION, out); |
163 out->cr(); |
163 out->cr(); |
164 CLEAR_PENDING_EXCEPTION; |
164 CLEAR_PENDING_EXCEPTION; |
165 // The exception has been printed on the output stream |
165 // The exception has been printed on the output stream |