mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[memory-agent] Add ability to enable logging for memory agent
This commit is contained in:
@@ -27,7 +27,6 @@ public class MemoryAgentUtil {
|
||||
|
||||
public static void addMemoryAgent(JavaParameters parameters) {
|
||||
if (!Registry.is("debugger.enable.memory.agent")) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -56,7 +55,12 @@ public class MemoryAgentUtil {
|
||||
}
|
||||
|
||||
LOG.info("Memory agent extracting took " + (System.currentTimeMillis() - start) + " ms");
|
||||
String path = JavaExecutionUtil.handleSpacesInAgentPath(extractedAgent.getAbsolutePath(), "debugger-memory-agent", null);
|
||||
String path = JavaExecutionUtil.handleSpacesInAgentPath(agentFile.getAbsolutePath(), "debugger-memory-agent", null);
|
||||
String args = "";
|
||||
if (Registry.is("debugger.memory.agent.debug")) {
|
||||
args = "5";// Enable debug messages
|
||||
}
|
||||
path += "=" + args;
|
||||
parametersList.add("-agentpath:" + path);
|
||||
}
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ public class OutputChecker {
|
||||
result = StringUtil.replace(result, "Process finished with exit code 255", "Process finished with exit code -1");
|
||||
|
||||
result = result.replaceAll(" -javaagent:.*debugger-agent\\.jar", "");
|
||||
result = result.replaceAll(" -agentpath:.*memory_agent\\.\\w*", "");
|
||||
result = result.replaceAll(" -agentpath:.*memory_agent\\.\\w*=", "");
|
||||
result = result.replaceAll("!HOST_NAME!:\\d*", "!HOST_NAME!:!HOST_PORT!");
|
||||
result = result.replaceAll("at '.*?'", "at '!HOST_NAME!:PORT_NAME!'");
|
||||
result = result.replaceAll("address: '.*?'", "address: '!HOST_NAME!:PORT_NAME!'");
|
||||
|
||||
@@ -354,6 +354,8 @@ debugger.enable.memory.view=true
|
||||
debugger.enable.overhead.monitor=true
|
||||
debugger.enable.memory.agent=false
|
||||
debugger.enable.memory.agent.description=Allow to start java debug sessions with attached debugger memory agent
|
||||
debugger.memory.agent.debug=false
|
||||
debugger.memory.agent.debug.description=Enable debug logging to stdout from memory agent
|
||||
debugger.tree.states.depth=100
|
||||
debugger.new.threads.view=false
|
||||
debugger.breakpoints.caller.filter=true
|
||||
|
||||
Reference in New Issue
Block a user