From 95fff8bea72f41a0acbb74255ceba1147e4e4152 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Mon, 1 Apr 2024 16:59:19 +0800 Subject: [PATCH] Hide blend mode button when debug with lldb-mi fix: Can't auto jump to the current line in the cpu info dialog when debug with lldb-mi --- RedPandaIDE/debugger/debugger.cpp | 5 +++++ RedPandaIDE/debugger/debugger.h | 2 +- RedPandaIDE/debugger/gdbmidebugger.cpp | 4 ++-- RedPandaIDE/widgets/cpudialog.cpp | 5 +++-- RedPandaIDE/widgets/cpudialog.ui | 30 ++++++++++++-------------- 5 files changed, 25 insertions(+), 21 deletions(-) diff --git a/RedPandaIDE/debugger/debugger.cpp b/RedPandaIDE/debugger/debugger.cpp index 3c52c0f7..a10b5c8e 100644 --- a/RedPandaIDE/debugger/debugger.cpp +++ b/RedPandaIDE/debugger/debugger.cpp @@ -641,6 +641,11 @@ void Debugger::setUseDebugServer(bool newUseDebugServer) mUseDebugServer = newUseDebugServer; } +bool Debugger::supportDisassemlyBlendMode() +{ + return mDebuggerType == DebuggerType::GDB; +} + bool Debugger::debugInfosUsingUTF8() const { return mDebugInfosUsingUTF8; diff --git a/RedPandaIDE/debugger/debugger.h b/RedPandaIDE/debugger/debugger.h index bc748f4b..d084fe70 100644 --- a/RedPandaIDE/debugger/debugger.h +++ b/RedPandaIDE/debugger/debugger.h @@ -396,7 +396,7 @@ public: bool useDebugServer() const; void setUseDebugServer(bool newUseDebugServer); - + bool supportDisassemlyBlendMode(); signals: void evalValueReady(const QString& s); void memoryExamineReady(const QStringList& s); diff --git a/RedPandaIDE/debugger/gdbmidebugger.cpp b/RedPandaIDE/debugger/gdbmidebugger.cpp index 83861734..35bd34ec 100644 --- a/RedPandaIDE/debugger/gdbmidebugger.cpp +++ b/RedPandaIDE/debugger/gdbmidebugger.cpp @@ -567,9 +567,9 @@ void GDBMIDebuggerClient::handleDisassembly(const QList")) { + if (line.startsWith("=>") || line.startsWith("->")) { activeLine = i; } } @@ -159,7 +159,7 @@ void CPUDialog::sendSyntaxCommand() void CPUDialog::updateSyntaxer() { - if (pSettings->debugger().blendMode()) { + if (pSettings->debugger().blendMode() && pMainWindow->debugger()->supportDisassemlyBlendMode()) { if (pSettings->debugger().useIntelStyle()) ui->txtCode->setSyntaxer(syntaxerManager.getSyntaxer(QSynedit::ProgrammingLanguage::MixedAssembly)); else @@ -240,6 +240,7 @@ void CPUDialog::showEvent(QShowEvent *event) sizes[1] = std::max(0,totalSize - sizes[0]); ui->splitter->setSizes(sizes); } + ui->chkBlendMode->setVisible(pMainWindow->debugger()->supportDisassemlyBlendMode()); } diff --git a/RedPandaIDE/widgets/cpudialog.ui b/RedPandaIDE/widgets/cpudialog.ui index c960ea08..180fd674 100644 --- a/RedPandaIDE/widgets/cpudialog.ui +++ b/RedPandaIDE/widgets/cpudialog.ui @@ -143,19 +143,6 @@ 0 - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -183,6 +170,19 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -238,9 +238,7 @@ 1 - - - +