Smarter process-tree-printing for Chrome
This commit is contained in:
parent
216935d60f
commit
d7baec744e
|
@ -365,11 +365,15 @@ World.prototype.textProcessTree = function (ownPid) {
|
||||||
} else {
|
} else {
|
||||||
var label = p.behavior.name || p.behavior.constructor.name || '';
|
var label = p.behavior.name || p.behavior.constructor.name || '';
|
||||||
var tombstoneString = p.exitReason ? ' (EXITED: ' + p.exitReason + ') ' : '';
|
var tombstoneString = p.exitReason ? ' (EXITED: ' + p.exitReason + ') ' : '';
|
||||||
lines.push(prefix + '-- ' + pid + ': ' + label +
|
var stringifiedState;
|
||||||
tombstoneString +
|
try {
|
||||||
JSON.stringify(p.behavior, function (k, v) {
|
stringifiedState = JSON.stringify(p.behavior, function (k, v) {
|
||||||
return k === 'name' ? undefined : v;
|
return (k === 'name') ? undefined : v;
|
||||||
}));
|
});
|
||||||
|
} catch (e) {
|
||||||
|
stringifiedState = "(cannot convert process state to JSON)";
|
||||||
|
}
|
||||||
|
lines.push(prefix + '-- ' + pid + ': ' + label + tombstoneString + stringifiedState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue