提交 521e06c8 编写于 作者: Z zgu

8004802: jcmd VM.native_memory baseline=false crashes VM

Summary: NMT has to check option's value also to determine which command to execute
Reviewed-by: acorn, coleenp, hseigel
上级 23a02b07
...@@ -84,29 +84,32 @@ void NMTDCmd::execute(TRAPS) { ...@@ -84,29 +84,32 @@ void NMTDCmd::execute(TRAPS) {
} }
int nopt = 0; int nopt = 0;
if(_summary.is_set()) { ++nopt; } if(_summary.is_set() && _summary.value()) { ++nopt; }
if(_detail.is_set()) { ++nopt; } if(_detail.is_set() && _detail.value()) { ++nopt; }
if(_baseline.is_set()) { ++nopt; } if(_baseline.is_set() && _baseline.value()) { ++nopt; }
if(_summary_diff.is_set()) { ++nopt; } if(_summary_diff.is_set() && _summary_diff.value()) { ++nopt; }
if(_detail_diff.is_set()) { ++nopt; } if(_detail_diff.is_set() && _detail_diff.value()) { ++nopt; }
if(_shutdown.is_set()) { ++nopt; } if(_shutdown.is_set() && _shutdown.value()) { ++nopt; }
#ifndef PRODUCT #ifndef PRODUCT
if(_debug.is_set()) { ++nopt; } if(_debug.is_set() && _debug.value()) { ++nopt; }
#endif #endif
if(nopt > 1) { if(nopt > 1) {
output()->print_cr("At most one of the following option can be specified: " \ output()->print_cr("At most one of the following option can be specified: " \
"summary, detail, baseline, summary.diff, detail.diff, shutdown" "summary, detail, baseline, summary.diff, detail.diff, shutdown"
#ifndef PRODUCT #ifndef PRODUCT
" ,debug" ", debug"
#endif #endif
); );
return; return;
} } else if (nopt == 0) {
if (_summary.is_set()) {
if(nopt == 0) { output()->print_cr("No command to execute");
return;
} else {
_summary.set_value(true); _summary.set_value(true);
} }
}
#ifndef PRODUCT #ifndef PRODUCT
if (_debug.value()) { if (_debug.value()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册