Commit ddfc1f8d authored by hjk's avatar hjk
Browse files

Disassembler: Force disassembler reload when switching output flavor



Change-Id: I8356cba5766a0afc519c66f120c24d1755c840e4
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 7e47a8a4
...@@ -169,6 +169,8 @@ public: ...@@ -169,6 +169,8 @@ public:
m_isStateDebugging(false) m_isStateDebugging(false)
{ {
connect(&m_locationTimer, SIGNAL(timeout()), SLOT(resetLocation())); connect(&m_locationTimer, SIGNAL(timeout()), SLOT(resetLocation()));
connect(debuggerCore()->action(IntelFlavor), SIGNAL(valueChanged(QVariant)),
SLOT(reloadDisassembly()));
} }
public slots: public slots:
...@@ -180,6 +182,11 @@ public slots: ...@@ -180,6 +182,11 @@ public slots:
void doInterruptInferior(); void doInterruptInferior();
void doFinishDebugger(); void doFinishDebugger();
void reloadDisassembly()
{
m_disassemblerAgent.reload();
}
void queueSetupEngine() void queueSetupEngine()
{ {
m_engine->setState(EngineSetupRequested); m_engine->setState(EngineSetupRequested);
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "disassembleragent.h" #include "disassembleragent.h"
#include "breakhandler.h" #include "breakhandler.h"
#include "debuggeractions.h"
#include "debuggercore.h" #include "debuggercore.h"
#include "debuggerengine.h" #include "debuggerengine.h"
#include "debuggerinternalconstants.h" #include "debuggerinternalconstants.h"
...@@ -214,6 +215,12 @@ bool DisassemblerAgent::isMixed() const ...@@ -214,6 +215,12 @@ bool DisassemblerAgent::isMixed() const
&& d->location.functionName() != _("??"); && d->location.functionName() != _("??");
} }
void DisassemblerAgent::reload()
{
d->cache.clear();
d->engine->fetchDisassembler(this);
}
void DisassemblerAgent::setLocation(const Location &loc) void DisassemblerAgent::setLocation(const Location &loc)
{ {
d->location = loc; d->location = loc;
......
...@@ -67,6 +67,9 @@ public: ...@@ -67,6 +67,9 @@ public:
void cleanup(); void cleanup();
bool isMixed() const; bool isMixed() const;
// Force reload, e.g. after changing the output flavour.
void reload();
private: private:
void setContentsToDocument(const DisassemblerLines &contents); void setContentsToDocument(const DisassemblerLines &contents);
int indexOf(const Location &loc) const; int indexOf(const Location &loc) const;
......
...@@ -236,8 +236,6 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters) ...@@ -236,8 +236,6 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters)
SLOT(reloadLocals())); SLOT(reloadLocals()));
connect(debuggerCore()->action(UseDynamicType), SIGNAL(valueChanged(QVariant)), connect(debuggerCore()->action(UseDynamicType), SIGNAL(valueChanged(QVariant)),
SLOT(reloadLocals())); SLOT(reloadLocals()));
connect(debuggerCore()->action(IntelFlavor), SIGNAL(valueChanged(QVariant)),
SLOT(reloadDisassembly()));
} }
GdbEngine::~GdbEngine() GdbEngine::~GdbEngine()
...@@ -3968,9 +3966,11 @@ public: ...@@ -3968,9 +3966,11 @@ public:
void GdbEngine::fetchDisassembler(DisassemblerAgent *agent) void GdbEngine::fetchDisassembler(DisassemblerAgent *agent)
{ {
// Doing that unconditionally seems to be the most robust if (debuggerCore()->boolSetting(IntelFlavor))
// solution given the richest output. Looks like GDB is postCommand("set disassembly-flavor intel");
// a command line tool after all... else
postCommand("set disassembly-flavor att");
fetchDisassemblerByCliPointMixed(agent); fetchDisassemblerByCliPointMixed(agent);
} }
...@@ -4078,12 +4078,6 @@ bool GdbEngine::handleCliDisassemblerResult(const QByteArray &output, Disassembl ...@@ -4078,12 +4078,6 @@ bool GdbEngine::handleCliDisassemblerResult(const QByteArray &output, Disassembl
return false; return false;
} }
void GdbEngine::reloadDisassembly()
{
setTokenBarrier();
updateLocals();
}
void GdbEngine::handleFetchDisassemblerByCliPointMixed(const GdbResponse &response) void GdbEngine::handleFetchDisassemblerByCliPointMixed(const GdbResponse &response)
{ {
DisassemblerAgentCookie ac = response.cookie.value<DisassemblerAgentCookie>(); DisassemblerAgentCookie ac = response.cookie.value<DisassemblerAgentCookie>();
...@@ -4475,11 +4469,7 @@ void GdbEngine::handleInferiorPrepared() ...@@ -4475,11 +4469,7 @@ void GdbEngine::handleInferiorPrepared()
} }
} }
if (debuggerCore()->boolSetting(IntelFlavor)) { //postCommand("set follow-exec-mode new");
//postCommand("set follow-exec-mode new");
postCommand("set disassembly-flavor intel");
}
if (sp.breakOnMain) { if (sp.breakOnMain) {
QByteArray cmd = "tbreak "; QByteArray cmd = "tbreak ";
cmd += sp.toolChainAbi.os() == Abi::WindowsOS ? "qMain" : "main"; cmd += sp.toolChainAbi.os() == Abi::WindowsOS ? "qMain" : "main";
......
...@@ -362,7 +362,6 @@ private: ////////// View & Data Stuff ////////// ...@@ -362,7 +362,6 @@ private: ////////// View & Data Stuff //////////
void handleFetchDisassemblerByCliRangeMixed(const GdbResponse &response); void handleFetchDisassemblerByCliRangeMixed(const GdbResponse &response);
void handleFetchDisassemblerByCliRangePlain(const GdbResponse &response); void handleFetchDisassemblerByCliRangePlain(const GdbResponse &response);
bool handleCliDisassemblerResult(const QByteArray &response, DisassemblerAgent *agent); bool handleCliDisassemblerResult(const QByteArray &response, DisassemblerAgent *agent);
Q_SLOT void reloadDisassembly();
void handleBreakOnQFatal(const GdbResponse &response); void handleBreakOnQFatal(const GdbResponse &response);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment