lldb-server compatibility

This commit is contained in:
Roy Qu 2024-03-11 20:34:02 +08:00
parent e2d5a18c3f
commit 3e0db148ae
2 changed files with 12 additions and 7 deletions

View File

@ -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 inferiors 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{

View File

@ -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,19 +975,23 @@ 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());
}
if (clientType()==DebuggerType::LLDB_MI) {
postCommand("-exec-run","");
} else
postCommand("-exec-continue","");
} else {
#ifdef Q_OS_WIN