forked from qt-creator/qt-creator
Debugger: Let LldbEngine pass current token to dumper
Change-Id: Ifea751354f637f67e640d36ba1baa95678c86ee9 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -633,6 +633,7 @@ class Dumper(DumperBase):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def setupInferior(self, args):
|
def setupInferior(self, args):
|
||||||
|
self.reportToken(args)
|
||||||
error = lldb.SBError()
|
error = lldb.SBError()
|
||||||
|
|
||||||
self.executable_ = args['executable']
|
self.executable_ = args['executable']
|
||||||
@@ -686,6 +687,7 @@ class Dumper(DumperBase):
|
|||||||
s.start()
|
s.start()
|
||||||
|
|
||||||
def prepare(self, args):
|
def prepare(self, args):
|
||||||
|
self.reportToken(args)
|
||||||
error = lldb.SBError()
|
error = lldb.SBError()
|
||||||
listener = self.debugger.GetListener()
|
listener = self.debugger.GetListener()
|
||||||
|
|
||||||
@@ -821,6 +823,7 @@ class Dumper(DumperBase):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def reportStack(self, args):
|
def reportStack(self, args):
|
||||||
|
self.reportToken(args)
|
||||||
if not self.process:
|
if not self.process:
|
||||||
self.report('msg="No process"')
|
self.report('msg="No process"')
|
||||||
return
|
return
|
||||||
@@ -891,6 +894,12 @@ class Dumper(DumperBase):
|
|||||||
self.report(result)
|
self.report(result)
|
||||||
self.reportContinuation(args)
|
self.reportContinuation(args)
|
||||||
|
|
||||||
|
def reportToken(self, args):
|
||||||
|
if "token" in args:
|
||||||
|
# Unusual syntax intended, to support the double-click in left
|
||||||
|
# logview pane feature.
|
||||||
|
self.report('token(\"%s\")' % args["token"])
|
||||||
|
|
||||||
def reportContinuation(self, args):
|
def reportContinuation(self, args):
|
||||||
if "continuation" in args:
|
if "continuation" in args:
|
||||||
self.report('continuation=\"%s\"' % args["continuation"])
|
self.report('continuation=\"%s\"' % args["continuation"])
|
||||||
@@ -1529,17 +1538,21 @@ class Dumper(DumperBase):
|
|||||||
self.process.Kill()
|
self.process.Kill()
|
||||||
self.reportState("inferiorshutdownok")
|
self.reportState("inferiorshutdownok")
|
||||||
|
|
||||||
def quit(self, _ = None):
|
def quit(self, args = {}):
|
||||||
|
self.reportToken(args)
|
||||||
self.reportState("engineshutdownok")
|
self.reportState("engineshutdownok")
|
||||||
self.process.Kill()
|
self.process.Kill()
|
||||||
|
|
||||||
def executeStepI(self, _ = None):
|
def executeStepI(self, args = {}):
|
||||||
|
self.reportToken(args)
|
||||||
self.currentThread().StepInstruction(lldb.eOnlyThisThread)
|
self.currentThread().StepInstruction(lldb.eOnlyThisThread)
|
||||||
|
|
||||||
def executeStepOut(self, _ = None):
|
def executeStepOut(self, args = {}):
|
||||||
|
self.reportToken(args)
|
||||||
self.currentThread().StepOut()
|
self.currentThread().StepOut()
|
||||||
|
|
||||||
def executeRunToLocation(self, args):
|
def executeRunToLocation(self, args):
|
||||||
|
self.reportToken(args)
|
||||||
addr = args.get('address', 0)
|
addr = args.get('address', 0)
|
||||||
if addr:
|
if addr:
|
||||||
error = self.currentThread().RunToAddress(addr)
|
error = self.currentThread().RunToAddress(addr)
|
||||||
@@ -1556,6 +1569,7 @@ class Dumper(DumperBase):
|
|||||||
self.reportData()
|
self.reportData()
|
||||||
|
|
||||||
def executeJumpToLocation(self, args):
|
def executeJumpToLocation(self, args):
|
||||||
|
self.reportToken(args)
|
||||||
frame = self.currentFrame()
|
frame = self.currentFrame()
|
||||||
if not frame:
|
if not frame:
|
||||||
self.reportStatus("No frame available.")
|
self.reportStatus("No frame available.")
|
||||||
@@ -1612,6 +1626,7 @@ class Dumper(DumperBase):
|
|||||||
self.report('success="%d",output="%s",error="%s"' % (success, output, error))
|
self.report('success="%d",output="%s",error="%s"' % (success, output, error))
|
||||||
|
|
||||||
def updateData(self, args):
|
def updateData(self, args):
|
||||||
|
self.reportToken(args)
|
||||||
self.expandedINames = set(args.get('expanded', []))
|
self.expandedINames = set(args.get('expanded', []))
|
||||||
self.autoDerefPointers = int(args.get('autoderef', '0'))
|
self.autoDerefPointers = int(args.get('autoderef', '0'))
|
||||||
self.useDynamicType = int(args.get('dyntype', '0'))
|
self.useDynamicType = int(args.get('dyntype', '0'))
|
||||||
@@ -1655,7 +1670,8 @@ class Dumper(DumperBase):
|
|||||||
result += ',offset="%s"},' % (addr - base)
|
result += ',offset="%s"},' % (addr - base)
|
||||||
self.report(result + ']')
|
self.report(result + ']')
|
||||||
|
|
||||||
def loadDumperFiles(self, _ = None):
|
def loadDumperFiles(self, args):
|
||||||
|
self.reportToken(args)
|
||||||
result = self.setupDumper()
|
result = self.setupDumper()
|
||||||
self.report(result)
|
self.report(result)
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,12 @@ using namespace Utils;
|
|||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
static int ¤tToken()
|
||||||
|
{
|
||||||
|
static int token = 0;
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// LldbEngine
|
// LldbEngine
|
||||||
@@ -85,7 +91,6 @@ LldbEngine::LldbEngine(const DebuggerStartParameters &startParameters)
|
|||||||
: DebuggerEngine(startParameters), m_continueAtNextSpontaneousStop(false)
|
: DebuggerEngine(startParameters), m_continueAtNextSpontaneousStop(false)
|
||||||
{
|
{
|
||||||
m_lastAgentId = 0;
|
m_lastAgentId = 0;
|
||||||
m_lastToken = 0;
|
|
||||||
setObjectName(QLatin1String("LldbEngine"));
|
setObjectName(QLatin1String("LldbEngine"));
|
||||||
|
|
||||||
if (startParameters.useTerminal) {
|
if (startParameters.useTerminal) {
|
||||||
@@ -126,11 +131,13 @@ void LldbEngine::executeDebuggerCommand(const QString &command, DebuggerLanguage
|
|||||||
runCommand(cmd);
|
runCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LldbEngine::runCommand(const DebuggerCommand &command)
|
void LldbEngine::runCommand(const DebuggerCommand &command_)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_lldbProc.state() == QProcess::Running, notifyEngineIll());
|
QTC_ASSERT(m_lldbProc.state() == QProcess::Running, notifyEngineIll());
|
||||||
++m_lastToken;
|
const int tok = ++currentToken();
|
||||||
QByteArray token = QByteArray::number(m_lastToken);
|
DebuggerCommand command = command_;
|
||||||
|
command.arg("token", tok);
|
||||||
|
QByteArray token = QByteArray::number(tok);
|
||||||
QByteArray cmd = command.function + "({" + command.args + "})";
|
QByteArray cmd = command.function + "({" + command.args + "})";
|
||||||
showMessage(_(token + cmd + '\n'), LogInput);
|
showMessage(_(token + cmd + '\n'), LogInput);
|
||||||
m_lldbProc.write("script theDumper." + cmd + "\n");
|
m_lldbProc.write("script theDumper." + cmd + "\n");
|
||||||
|
|||||||
@@ -187,7 +187,6 @@ private:
|
|||||||
|
|
||||||
// FIXME: Make generic.
|
// FIXME: Make generic.
|
||||||
int m_lastAgentId;
|
int m_lastAgentId;
|
||||||
int m_lastToken;
|
|
||||||
int m_continueAtNextSpontaneousStop;
|
int m_continueAtNextSpontaneousStop;
|
||||||
QMap<QPointer<DisassemblerAgent>, int> m_disassemblerAgents;
|
QMap<QPointer<DisassemblerAgent>, int> m_disassemblerAgents;
|
||||||
QMap<QPointer<MemoryAgent>, int> m_memoryAgents;
|
QMap<QPointer<MemoryAgent>, int> m_memoryAgents;
|
||||||
|
|||||||
Reference in New Issue
Block a user