src/share/vm/services/diagnosticCommand.cpp

Print this page
rev 5746 : 8031304: Add dcmd to print all loaded dynamic libraries.
Summary: Adding VM.dynlibs as a dcmd to dump all loaded dynamic libraries.
Reviewed-by: duke
Contributed-by: fredrik.arvidsson@oracle.com

*** 23,32 **** --- 23,33 ---- */ #include "precompiled.hpp" #include "gc_implementation/shared/vmGCOperations.hpp" #include "runtime/javaCalls.hpp" + #include "runtime/os.hpp" #include "services/diagnosticArgument.hpp" #include "services/diagnosticCommand.hpp" #include "services/diagnosticFramework.hpp" #include "services/heapDumper.hpp" #include "services/management.hpp"
*** 42,51 **** --- 43,53 ---- DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HelpDCmd>(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VersionDCmd>(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CommandLineDCmd>(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintSystemPropertiesDCmd>(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintVMFlagsDCmd>(full_export, true, false)); + DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMDynamicLibrariesDCmd>(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMUptimeDCmd>(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemGCDCmd>(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RunFinalizationDCmd>(full_export, true, false)); #if INCLUDE_SERVICES // Heap dumping/inspection supported DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false));
*** 608,619 **** Handle str = java_lang_String::create_from_str(options.as_string(), CHECK); JavaCalls::call_static(&result, ik, vmSymbols::startRemoteAgent_name(), vmSymbols::string_void_signature(), str, CHECK); } JMXStartLocalDCmd::JMXStartLocalDCmd(outputStream *output, bool heap_allocated) : ! DCmd(output, heap_allocated) ! { // do nothing } void JMXStartLocalDCmd::execute(DCmdSource source, TRAPS) { ResourceMark rm(THREAD); --- 610,620 ---- Handle str = java_lang_String::create_from_str(options.as_string(), CHECK); JavaCalls::call_static(&result, ik, vmSymbols::startRemoteAgent_name(), vmSymbols::string_void_signature(), str, CHECK); } JMXStartLocalDCmd::JMXStartLocalDCmd(outputStream *output, bool heap_allocated) : ! DCmd(output, heap_allocated) { // do nothing } void JMXStartLocalDCmd::execute(DCmdSource source, TRAPS) { ResourceMark rm(THREAD);
*** 630,640 **** JavaValue result(T_VOID); JavaCalls::call_static(&result, ik, vmSymbols::startLocalAgent_name(), vmSymbols::void_method_signature(), CHECK); } - void JMXStopRemoteDCmd::execute(DCmdSource source, TRAPS) { ResourceMark rm(THREAD); HandleMark hm(THREAD); // Load and initialize the sun.management.Agent class --- 631,640 ----
*** 648,652 **** --- 648,661 ---- JavaValue result(T_VOID); JavaCalls::call_static(&result, ik, vmSymbols::stopRemoteAgent_name(), vmSymbols::void_method_signature(), CHECK); } + VMDynamicLibrariesDCmd::VMDynamicLibrariesDCmd(outputStream *output, bool heap_allocated) : + DCmd(output, heap_allocated) { + // do nothing + } + + void VMDynamicLibrariesDCmd::execute(DCmdSource source, TRAPS) { + os::print_dll_info(output()); + output()->cr(); + }