8129348: Debugger hangs in trace mode with TRACE_SENDS

Reviewed-by: sspitsyn
This commit is contained in:
Cheleswer Sahu 2015-10-29 05:24:30 -07:00 committed by Kevin Walls
parent 90176d92ba
commit 52458bf82e

View File

@ -236,6 +236,15 @@ abstract class InvokableTypeImpl extends ReferenceTypeImpl {
final MethodImpl method,
final ValueImpl[] args,
final int options) {
/*
* Cache the values of args when TRACE_SENDS is enabled, for later printing.
* If not cached, printing causes a remote call while synchronized, and deadlock.
*/
if ((vm.traceFlags & VirtualMachineImpl.TRACE_SENDS) != 0) {
for (ValueImpl arg: args) {
arg.toString();
}
}
CommandSender sender = getInvokeMethodSender(thread, method, args, options);
PacketStream stream;
if ((options & ClassType.INVOKE_SINGLE_THREADED) != 0) {