< prev index next >
src/hotspot/share/services/diagnosticFramework.cpp
Print this page
rev 50538 : [mq]: jcmd-cleanups
*** 249,259 ****
}
arg = arg->next();
}
}
! void DCmdParser::print_help(outputStream* out, const char* cmd_name) {
out->print("Syntax : %s %s", cmd_name, _options == NULL ? "" : "[options]");
GenDCmdArgument* arg = _arguments_list;
while (arg != NULL) {
if (arg->is_mandatory()) {
out->print(" <%s>", arg->name());
--- 249,259 ----
}
arg = arg->next();
}
}
! void DCmdParser::print_help(outputStream* out, const char* cmd_name) const {
out->print("Syntax : %s %s", cmd_name, _options == NULL ? "" : "[options]");
GenDCmdArgument* arg = _arguments_list;
while (arg != NULL) {
if (arg->is_mandatory()) {
out->print(" <%s>", arg->name());
*** 321,331 ****
arg->cleanup();
arg = arg->next();
}
}
! int DCmdParser::num_arguments() {
GenDCmdArgument* arg = _arguments_list;
int count = 0;
while (arg != NULL) {
count++;
arg = arg->next();
--- 321,331 ----
arg->cleanup();
arg = arg->next();
}
}
! int DCmdParser::num_arguments() const {
GenDCmdArgument* arg = _arguments_list;
int count = 0;
while (arg != NULL) {
count++;
arg = arg->next();
*** 336,346 ****
arg = arg->next();
}
return count;
}
! GrowableArray<const char *>* DCmdParser::argument_name_array() {
int count = num_arguments();
GrowableArray<const char *>* array = new GrowableArray<const char *>(count);
GenDCmdArgument* arg = _arguments_list;
while (arg != NULL) {
array->append(arg->name());
--- 336,346 ----
arg = arg->next();
}
return count;
}
! GrowableArray<const char *>* DCmdParser::argument_name_array() const {
int count = num_arguments();
GrowableArray<const char *>* array = new GrowableArray<const char *>(count);
GenDCmdArgument* arg = _arguments_list;
while (arg != NULL) {
array->append(arg->name());
*** 352,362 ****
arg = arg->next();
}
return array;
}
! GrowableArray<DCmdArgumentInfo*>* DCmdParser::argument_info_array() {
int count = num_arguments();
GrowableArray<DCmdArgumentInfo*>* array = new GrowableArray<DCmdArgumentInfo *>(count);
int idx = 0;
GenDCmdArgument* arg = _arguments_list;
while (arg != NULL) {
--- 352,362 ----
arg = arg->next();
}
return array;
}
! GrowableArray<DCmdArgumentInfo*>* DCmdParser::argument_info_array() const {
int count = num_arguments();
GrowableArray<DCmdArgumentInfo*>* array = new GrowableArray<DCmdArgumentInfo *>(count);
int idx = 0;
GenDCmdArgument* arg = _arguments_list;
while (arg != NULL) {
*** 397,406 ****
--- 397,407 ----
CmdLine line = iter.next();
if (line.is_stop()) {
break;
}
if (line.is_executable()) {
+ ResourceMark rm;
DCmd* command = DCmdFactory::create_local_DCmd(source, line, out, CHECK);
assert(command != NULL, "command error must be handled before this line");
DCmdMark mark(command);
command->parse(&line, delim, CHECK);
command->execute(source, CHECK);
*** 411,421 ****
void DCmdWithParser::parse(CmdLine* line, char delim, TRAPS) {
_dcmdparser.parse(line, delim, CHECK);
}
! void DCmdWithParser::print_help(const char* name) {
_dcmdparser.print_help(output(), name);
}
void DCmdWithParser::reset(TRAPS) {
_dcmdparser.reset(CHECK);
--- 412,422 ----
void DCmdWithParser::parse(CmdLine* line, char delim, TRAPS) {
_dcmdparser.parse(line, delim, CHECK);
}
! void DCmdWithParser::print_help(const char* name) const {
_dcmdparser.print_help(output(), name);
}
void DCmdWithParser::reset(TRAPS) {
_dcmdparser.reset(CHECK);
*** 423,437 ****
void DCmdWithParser::cleanup() {
_dcmdparser.cleanup();
}
! GrowableArray<const char*>* DCmdWithParser::argument_name_array() {
return _dcmdparser.argument_name_array();
}
! GrowableArray<DCmdArgumentInfo*>* DCmdWithParser::argument_info_array() {
return _dcmdparser.argument_info_array();
}
void DCmdFactory::push_jmx_notification_request() {
MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
--- 424,438 ----
void DCmdWithParser::cleanup() {
_dcmdparser.cleanup();
}
! GrowableArray<const char*>* DCmdWithParser::argument_name_array() const {
return _dcmdparser.argument_name_array();
}
! GrowableArray<DCmdArgumentInfo*>* DCmdWithParser::argument_info_array() const {
return _dcmdparser.argument_info_array();
}
void DCmdFactory::push_jmx_notification_request() {
MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
*** 517,540 ****
DCmdFactory::push_jmx_notification_request();
}
return 0; // Actually, there's no checks for duplicates
}
- DCmd* DCmdFactory::create_global_DCmd(DCmdSource source, CmdLine &line,
- outputStream* out, TRAPS) {
- DCmdFactory* f = factory(source, line.cmd_addr(), line.cmd_len());
- if (f != NULL) {
- if (f->is_enabled()) {
- THROW_MSG_NULL(vmSymbols::java_lang_IllegalArgumentException(),
- f->disabled_message());
- }
- return f->create_Cheap_instance(out);
- }
- THROW_MSG_NULL(vmSymbols::java_lang_IllegalArgumentException(),
- "Unknown diagnostic command");
- }
-
DCmd* DCmdFactory::create_local_DCmd(DCmdSource source, CmdLine &line,
outputStream* out, TRAPS) {
DCmdFactory* f = factory(source, line.cmd_addr(), line.cmd_len());
if (f != NULL) {
if (!f->is_enabled()) {
--- 518,527 ----
< prev index next >