diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 9763e064e7f..1eec639b814 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -169,6 +169,8 @@ public: m_isStateDebugging(false) { connect(&m_locationTimer, SIGNAL(timeout()), SLOT(resetLocation())); + connect(debuggerCore()->action(IntelFlavor), SIGNAL(valueChanged(QVariant)), + SLOT(reloadDisassembly())); } public slots: @@ -180,6 +182,11 @@ public slots: void doInterruptInferior(); void doFinishDebugger(); + void reloadDisassembly() + { + m_disassemblerAgent.reload(); + } + void queueSetupEngine() { m_engine->setState(EngineSetupRequested); diff --git a/src/plugins/debugger/disassembleragent.cpp b/src/plugins/debugger/disassembleragent.cpp index da900611c76..c400d92a65f 100644 --- a/src/plugins/debugger/disassembleragent.cpp +++ b/src/plugins/debugger/disassembleragent.cpp @@ -30,6 +30,7 @@ #include "disassembleragent.h" #include "breakhandler.h" +#include "debuggeractions.h" #include "debuggercore.h" #include "debuggerengine.h" #include "debuggerinternalconstants.h" @@ -214,6 +215,12 @@ bool DisassemblerAgent::isMixed() const && d->location.functionName() != _("??"); } +void DisassemblerAgent::reload() +{ + d->cache.clear(); + d->engine->fetchDisassembler(this); +} + void DisassemblerAgent::setLocation(const Location &loc) { d->location = loc; diff --git a/src/plugins/debugger/disassembleragent.h b/src/plugins/debugger/disassembleragent.h index 98e7b882767..414de5941fe 100644 --- a/src/plugins/debugger/disassembleragent.h +++ b/src/plugins/debugger/disassembleragent.h @@ -67,6 +67,9 @@ public: void cleanup(); bool isMixed() const; + // Force reload, e.g. after changing the output flavour. + void reload(); + private: void setContentsToDocument(const DisassemblerLines &contents); int indexOf(const Location &loc) const; diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 7aa202bfec8..cbb8d7830e7 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -236,8 +236,6 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters) SLOT(reloadLocals())); connect(debuggerCore()->action(UseDynamicType), SIGNAL(valueChanged(QVariant)), SLOT(reloadLocals())); - connect(debuggerCore()->action(IntelFlavor), SIGNAL(valueChanged(QVariant)), - SLOT(reloadDisassembly())); } GdbEngine::~GdbEngine() @@ -3968,9 +3966,11 @@ public: void GdbEngine::fetchDisassembler(DisassemblerAgent *agent) { - // Doing that unconditionally seems to be the most robust - // solution given the richest output. Looks like GDB is - // a command line tool after all... + if (debuggerCore()->boolSetting(IntelFlavor)) + postCommand("set disassembly-flavor intel"); + else + postCommand("set disassembly-flavor att"); + fetchDisassemblerByCliPointMixed(agent); } @@ -4078,12 +4078,6 @@ bool GdbEngine::handleCliDisassemblerResult(const QByteArray &output, Disassembl return false; } -void GdbEngine::reloadDisassembly() -{ - setTokenBarrier(); - updateLocals(); -} - void GdbEngine::handleFetchDisassemblerByCliPointMixed(const GdbResponse &response) { DisassemblerAgentCookie ac = response.cookie.value(); @@ -4475,11 +4469,7 @@ void GdbEngine::handleInferiorPrepared() } } - if (debuggerCore()->boolSetting(IntelFlavor)) { - //postCommand("set follow-exec-mode new"); - postCommand("set disassembly-flavor intel"); - } - + //postCommand("set follow-exec-mode new"); if (sp.breakOnMain) { QByteArray cmd = "tbreak "; cmd += sp.toolChainAbi.os() == Abi::WindowsOS ? "qMain" : "main"; diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 2defded0897..28a793869ba 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -362,7 +362,6 @@ private: ////////// View & Data Stuff ////////// void handleFetchDisassemblerByCliRangeMixed(const GdbResponse &response); void handleFetchDisassemblerByCliRangePlain(const GdbResponse &response); bool handleCliDisassemblerResult(const QByteArray &response, DisassemblerAgent *agent); - Q_SLOT void reloadDisassembly(); void handleBreakOnQFatal(const GdbResponse &response);