public class Debugger extends Object
VMDebugManager
Manages debug sessions and handle debug related actions.Constructor and Description |
---|
Debugger(ProgramFile programFile) |
Modifier and Type | Method and Description |
---|---|
void |
addDebugPoints(List<BreakPointDTO> breakPointDTOS)
Method to add debug points.
|
void |
addWorkerContext(WorkerExecutionContext ctx)
Add
WorkerExecutionContext to current execution. |
LineNumberInfo |
getLineNumber(String packagePath,
int ip)
Helper method to get line number for given ip.
|
void |
init()
Method to initialize debug manager.
|
boolean |
isClientSessionActive()
Helper method to know whether debug session active or not.
|
boolean |
isDebugEnabled()
Method to check debug enabled or not.
|
void |
notifyDebugHit(WorkerExecutionContext ctx,
LineNumberInfo currentExecLine,
String workerId)
Send a message to the debug client when a breakpoint is hit.
|
void |
notifyExit()
Notify client when the debugger is exiting.
|
void |
pauseWorker(WorkerExecutionContext ctx)
Helper method to stop execution of current worker.
|
void |
resume(String workerId)
Method to resume current debug session.
|
protected void |
setClientHandler(DebugClientHandler clientHandler)
Method to set client handler.
|
void |
setDebugEnabled()
Method to set debug enabled or not.
|
protected void |
setupDebugger() |
void |
startDebug()
Method to start debugging.
|
void |
stepIn(String workerId)
Method to do "STEP_IN" command.
|
void |
stepOut(String workerId)
Method to do "STEP_OUT" command.
|
void |
stepOver(String workerId)
Method to do "STEP_OVER" command.
|
void |
stopDebugging()
Method to stop debugging process for all threads.
|
void |
waitTillDebuggeeResponds()
Helper method to wait till debuggee responds.
|
public Debugger(ProgramFile programFile)
public void init()
protected void setupDebugger()
public void waitTillDebuggeeResponds()
public void pauseWorker(WorkerExecutionContext ctx)
ctx
- of the current worker.public LineNumberInfo getLineNumber(String packagePath, int ip)
packagePath
- Executing package.ip
- Instruction pointer.public void addDebugPoints(List<BreakPointDTO> breakPointDTOS)
breakPointDTOS
- to be added.public void startDebug()
public void resume(String workerId)
workerId
- of the worker to be resumed.public void stepIn(String workerId)
workerId
- to be resumed.public void stepOver(String workerId)
workerId
- to be resumed.public void stepOut(String workerId)
workerId
- to be resumed.public void stopDebugging()
public void addWorkerContext(WorkerExecutionContext ctx)
WorkerExecutionContext
to current execution.ctx
- context to run.public boolean isClientSessionActive()
public void notifyDebugHit(WorkerExecutionContext ctx, LineNumberInfo currentExecLine, String workerId)
ctx
- Current context.currentExecLine
- Current execution line.workerId
- Current thread id.public void notifyExit()
public boolean isDebugEnabled()
public void setDebugEnabled()
protected void setClientHandler(DebugClientHandler clientHandler)
clientHandler
- instance.Copyright © 2018 WSO2. All rights reserved.