gdb support, continuing

This commit is contained in:
Vadim Lopatin 2015-12-12 19:19:00 +03:00
parent 3b94eda9c1
commit e0a406578c
2 changed files with 59 additions and 0 deletions

View File

@ -33,6 +33,16 @@ interface Debugger : ProgramExecution {
void execStart();
/// continue execution
void execContinue();
/// stop program execution
void execStop();
/// interrupt execution
void execPause();
/// step over
void execStepOver();
/// step in
void execStepIn();
/// step out
void execStepOut();
}
enum ResponseCode : int {
@ -143,6 +153,26 @@ class DebuggerProxy : Debugger, DebuggerCallback {
void execContinue() {
_debugger.postRequest(delegate() { _debugger.execContinue(); });
}
/// stop program execution
void execStop() {
_debugger.postRequest(delegate() { _debugger.execStop(); });
}
/// interrupt execution
void execPause() {
_debugger.postRequest(delegate() { _debugger.execPause(); });
}
/// step over
void execStepOver() {
_debugger.postRequest(delegate() { _debugger.execStepOver(); });
}
/// step in
void execStepIn() {
_debugger.postRequest(delegate() { _debugger.execStepIn(); });
}
/// step out
void execStepOut() {
_debugger.postRequest(delegate() { _debugger.execStepOut(); });
}
}
abstract class DebuggerBase : Thread, Debugger {

View File

@ -229,6 +229,9 @@ class GDBInterface : ConsoleDebuggerInterface {
if (_stopRequested)
return;
Log.d("GDBInterface.stop()");
postRequest(delegate() {
execStop();
});
_stopRequested = true;
postRequest(delegate() {
});
@ -251,6 +254,32 @@ class GDBInterface : ConsoleDebuggerInterface {
_continueRequestId = sendCommand("-exec-continue");
}
/// stop program execution
int _stopRequestId;
void execStop() {
_continueRequestId = sendCommand("-gdb-exit");
}
/// interrupt execution
int _pauseRequestId;
void execPause() {
_pauseRequestId = sendCommand("-exec-interrupt");
}
/// step over
int _stepOverRequestId;
void execStepOver() {
_stepOverRequestId = sendCommand("-exec-next");
}
/// step in
int _stepInRequestId;
void execStepIn() {
_stepInRequestId = sendCommand("-exec-step");
}
/// step out
int _stepOutRequestId;
void execStepOut() {
_stepOutRequestId = sendCommand("-exec-finish");
}
// ~message
void handleStreamLineCLI(string s) {
Log.d("GDB CLI: ", s);