Package ghidra.app.decompiler
Class DecompileProcess
- java.lang.Object
- 
- ghidra.app.decompiler.DecompileProcess
 
- 
 public class DecompileProcess extends java.lang.ObjectClass for communicating with a single decompiler process. The process controls decompilation for a single Program. The process is initiated by the registerProgram method. If the process is ready, the statusGood flag will be set to true. This flag must be checked via the isReady method prior to invoking any of the public methods. If the process isn't ready, the only way to recover is by reissuing the registerProgram call and making any other necessary initialization calls.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classDecompileProcess.DisposeState
 - 
Constructor SummaryConstructors Constructor Description DecompileProcess(java.lang.String path)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intderegisterProgram()Free decompiler resourcesvoiddispose()DecompileProcess.DisposeStategetDisposeState()booleanisReady()voidregisterProgram(DecompileCallback cback, java.lang.String pspecxml, java.lang.String cspecxml, java.lang.String tspecxml, java.lang.String coretypesxml)Initialize decompiler for a particular platformLimitedByteBuffersendCommand(java.lang.String command)Send a single command to the decompiler with no parameters and return responseLimitedByteBuffersendCommand1Param(java.lang.String command, java.lang.String param1)Send a command to the decompiler with one parameter and return the resultLimitedByteBuffersendCommand1ParamTimeout(java.lang.String command, java.lang.String param, int timeoutSecs)LimitedByteBuffersendCommand2Params(java.lang.String command, java.lang.String param1, java.lang.String param2)Send a command with 2 parameters to the decompiler and read the resultvoidsetMaxResultSize(int maxResultSizeMBytes)
 
- 
- 
- 
Method Detail- 
disposepublic void dispose() 
 - 
getDisposeStatepublic DecompileProcess.DisposeState getDisposeState() 
 - 
registerProgrampublic void registerProgram(DecompileCallback cback, java.lang.String pspecxml, java.lang.String cspecxml, java.lang.String tspecxml, java.lang.String coretypesxml) throws java.io.IOException, DecompileException Initialize decompiler for a particular platform- Parameters:
- cback- = callback object for decompiler
- pspecxml- = string containing .pspec xml
- cspecxml- = string containing .cspec xml
- tspecxml- = XML string containing translator spec
- coretypesxml- = XML description of core data-types
- Throws:
- java.io.IOException- for problems with the pipe to the decompiler process
- DecompileException- for problems executing the command
 
 - 
deregisterProgrampublic int deregisterProgram() throws java.io.IOException, DecompileExceptionFree decompiler resources- Returns:
- 1 if a program was actively deregistered, 0 otherwise
- Throws:
- java.io.IOException- for problems with the pipe to the decompiler
- DecompileException- for problems executing the command
 
 - 
sendCommandpublic LimitedByteBuffer sendCommand(java.lang.String command) throws java.io.IOException, DecompileException Send a single command to the decompiler with no parameters and return response- Parameters:
- command- is the name of the command to execute
- Returns:
- the response String
- Throws:
- java.io.IOException- for any problems with the pipe to the decompiler process
- DecompileException- for any problems executing the command
 
 - 
isReadypublic boolean isReady() 
 - 
sendCommand1ParamTimeoutpublic LimitedByteBuffer sendCommand1ParamTimeout(java.lang.String command, java.lang.String param, int timeoutSecs) throws java.io.IOException, DecompileException - Parameters:
- command- the decompiler should execute
- param- an additional parameter for the command
- timeoutSecs- the number of seconds to run before timing out
- Returns:
- the response string
- Throws:
- java.io.IOException- for any problems with the pipe to the decompiler process
- DecompileException- for any problems while executing the command
 
 - 
sendCommand2Paramspublic LimitedByteBuffer sendCommand2Params(java.lang.String command, java.lang.String param1, java.lang.String param2) throws java.io.IOException, DecompileException Send a command with 2 parameters to the decompiler and read the result- Parameters:
- command- string to send
- param1- is the first parameter string
- param2- is the second parameter string
- Returns:
- the result string
- Throws:
- java.io.IOException- for any problems with the pipe to the decompiler process
- DecompileException- for problems executing the command
 
 - 
setMaxResultSizepublic void setMaxResultSize(int maxResultSizeMBytes) 
 - 
sendCommand1Parampublic LimitedByteBuffer sendCommand1Param(java.lang.String command, java.lang.String param1) throws java.io.IOException, DecompileException Send a command to the decompiler with one parameter and return the result- Parameters:
- command- is the command string
- param1- is the parameter as a string
- Returns:
- the result string
- Throws:
- java.io.IOException- for problems with the pipe to the decompiler process
- DecompileException- for problems executing the command
 
 
- 
 
-