comparison src/share/vm/services/diagnosticFramework.hpp @ 6202:5a1f452f8f90

7178703: Fix handling of quoted arguments and better error messages in dcmd Reviewed-by: coleenp, mgronlun, rbackman
author sla
date Thu, 28 Jun 2012 11:37:28 +0200
parents d2a62e0f25eb
children 31a4e55f8c9d
comparison
equal deleted inserted replaced
6201:ace99a6ffc83 6202:5a1f452f8f90
236 } 236 }
237 237
238 static const char* name() { return "No Name";} 238 static const char* name() { return "No Name";}
239 static const char* description() { return "No Help";} 239 static const char* description() { return "No Help";}
240 static const char* disabled_message() { return "Diagnostic command currently disabled"; } 240 static const char* disabled_message() { return "Diagnostic command currently disabled"; }
241 // The impact() method returns a description of the intrusiveness of the diagnostic
242 // command on the Java Virtual Machine behavior. The rational for this method is that some
243 // diagnostic commands can seriously disrupt the behavior of the Java Virtual Machine
244 // (for instance a Thread Dump for an application with several tens of thousands of threads,
245 // or a Head Dump with a 40GB+ heap size) and other diagnostic commands have no serious
246 // impact on the JVM (for instance, getting the command line arguments or the JVM version).
247 // The recommended format for the description is <impact level>: [longer description],
248 // where the impact level is selected among this list: {Low, Medium, High}. The optional
249 // longer description can provide more specific details like the fact that Thread Dump
250 // impact depends on the heap size.
241 static const char* impact() { return "Low: No impact"; } 251 static const char* impact() { return "Low: No impact"; }
242 static int num_arguments() { return 0; } 252 static int num_arguments() { return 0; }
243 outputStream* output() { return _output; } 253 outputStream* output() { return _output; }
244 bool is_heap_allocated() { return _is_heap_allocated; } 254 bool is_heap_allocated() { return _is_heap_allocated; }
245 virtual void print_help(const char* name) { 255 virtual void print_help(const char* name) {
248 virtual void parse(CmdLine* line, char delim, TRAPS) { 258 virtual void parse(CmdLine* line, char delim, TRAPS) {
249 DCmdArgIter iter(line->args_addr(), line->args_len(), delim); 259 DCmdArgIter iter(line->args_addr(), line->args_len(), delim);
250 bool has_arg = iter.next(CHECK); 260 bool has_arg = iter.next(CHECK);
251 if (has_arg) { 261 if (has_arg) {
252 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 262 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
253 "Unknown argument in diagnostic command"); 263 "The argument list of this diagnostic command should be empty.");
254 } 264 }
255 } 265 }
256 virtual void execute(TRAPS) { } 266 virtual void execute(TRAPS) { }
257 virtual void reset(TRAPS) { } 267 virtual void reset(TRAPS) { }
258 virtual void cleanup() { } 268 virtual void cleanup() { }