diff --git a/RedPandaIDE/debugger/debugger.cpp b/RedPandaIDE/debugger/debugger.cpp index 6d1c6590..166dc43d 100644 --- a/RedPandaIDE/debugger/debugger.cpp +++ b/RedPandaIDE/debugger/debugger.cpp @@ -98,7 +98,7 @@ bool Debugger::startClient(int compilerSetIndex, else setDebuggerType(DebuggerType::GDB); // force to lldb-server if using lldb-mi, which creates new console but does not bind inferior’s stdio to the new console on Windows. - setUseDebugServer(pSettings->debugger().useGDBServer()); + setUseDebugServer(pSettings->debugger().useGDBServer() || mDebuggerType == DebuggerType::LLDB_MI); mExecuting = true; QString debuggerPath = compilerSet->debugger(); //QFile debuggerProgram(debuggerPath); @@ -2335,7 +2335,7 @@ void DebugTarget::run() mGDBServer, "gdbserver", QString("localhost:%1").arg(mPort), - mInferior, + //mInferior, } + mArguments; else execArgs = QStringList{ diff --git a/RedPandaIDE/debugger/gdbmidebugger.cpp b/RedPandaIDE/debugger/gdbmidebugger.cpp index 17634c3b..7493a3e5 100644 --- a/RedPandaIDE/debugger/gdbmidebugger.cpp +++ b/RedPandaIDE/debugger/gdbmidebugger.cpp @@ -165,7 +165,7 @@ void GDBMIDebuggerClient::runNextCmd() if (mCmdQueue.isEmpty()) { if (debugger()->useDebugServer() && mInferiorRunning && !mAsyncUpdated) { mAsyncUpdated = true; - QTimer::singleShot(50,this,&GDBMIDebuggerClient::asyncUpdate); + QTimer::singleShot(5000,this,&GDBMIDebuggerClient::asyncUpdate); } return; } @@ -945,7 +945,8 @@ void GDBMIDebuggerClient::asyncUpdate() { QMutexLocker locker(&mCmdQueueMutex); if (mCmdQueue.isEmpty()) { - postCommand("-var-update"," --all-values *",DebugCommandSource::HeartBeat); + //postCommand("-var-update"," --all-values *",DebugCommandSource::HeartBeat); + postCommand("-stack-info-frame","",DebugCommandSource::HeartBeat); } mAsyncUpdated = false; } @@ -974,20 +975,24 @@ void GDBMIDebuggerClient::initialize(const QString& inferior, bool hasSymbols) } else { postCommand("-file-exec-file", '"' + inferior + '"'); } - + if (debugger()->useDebugServer()) { + postCommand("-target-select",QString("remote localhost:%1").arg(pSettings->debugger().GDBServerPort())); + } } void GDBMIDebuggerClient::runInferior(bool hasBreakpoints) { if (debugger()->useDebugServer()) { - postCommand("-target-select",QString("remote localhost:%1").arg(pSettings->debugger().GDBServerPort())); if (!hasBreakpoints) { postCommand("-break-insert","-t main"); } if (pSettings->executor().useParams()) { postCommand("-exec-arguments", pSettings->executor().params()); } - postCommand("-exec-continue",""); + if (clientType()==DebuggerType::LLDB_MI) { + postCommand("-exec-run",""); + } else + postCommand("-exec-continue",""); } else { #ifdef Q_OS_WIN postCommand("-gdb-set", "new-console on");