forked from qt-creator/qt-creator
Debugger: Handle application output in LLDB interface
Change-Id: Ie97c628ece272249c23aab6d5438555c051f5aa1 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -845,7 +845,6 @@ class Dumper:
|
||||
self.currentType = str(type)
|
||||
self.currentTypePriority = self.currentTypePriority + 1
|
||||
|
||||
|
||||
def readRawMemory(self, base, size):
|
||||
if size == 0:
|
||||
return ""
|
||||
@@ -1053,14 +1052,18 @@ class Dumper:
|
||||
% (self.process.GetExitStatus(), self.process.GetExitDescription()))
|
||||
self.report('state="inferiorexited"')
|
||||
if type == lldb.SBProcess.eBroadcastBitStateChanged:
|
||||
#if state == lldb.eStateStopped:
|
||||
self.reportData()
|
||||
elif type == lldb.SBProcess.eBroadcastBitInterrupt:
|
||||
pass
|
||||
elif type == lldb.SBProcess.eBroadcastBitSTDOUT:
|
||||
pass
|
||||
# FIXME: Size?
|
||||
msg = self.process.GetSTDOUT(1024)
|
||||
self.report('output={channel="stdout",data="%s"}'
|
||||
% binascii.hexlify(msg))
|
||||
elif type == lldb.SBProcess.eBroadcastBitSTDERR:
|
||||
pass
|
||||
msg = self.process.GetSTDERR(1024)
|
||||
self.report('output={channel="stdout",data="%s"}'
|
||||
% binascii.hexlify(msg))
|
||||
elif type == lldb.SBProcess.eBroadcastBitProfileData:
|
||||
pass
|
||||
|
||||
|
||||
@@ -249,6 +249,8 @@ void LldbEngine::handleResponse(const QByteArray &response)
|
||||
refreshSymbols(item);
|
||||
else if (name == "bkpts")
|
||||
refreshBreakpoints(item);
|
||||
else if (name == "output")
|
||||
refreshOutput(item);
|
||||
else if (name == "disassembly")
|
||||
refreshDisassembly(item);
|
||||
else if (name == "memory")
|
||||
@@ -483,6 +485,18 @@ void LldbEngine::refreshMemory(const GdbMi &data)
|
||||
}
|
||||
}
|
||||
|
||||
void LldbEngine::refreshOutput(const GdbMi &output)
|
||||
{
|
||||
QByteArray channel = output["channel"].data();
|
||||
QByteArray data = QByteArray::fromHex(output["data"].data());
|
||||
LogChannel ch = AppStuff;
|
||||
if (channel == "stdout")
|
||||
ch = AppOutput;
|
||||
else if (channel == "stderr")
|
||||
ch = AppError;
|
||||
showMessage(QString::fromUtf8(data), ch);
|
||||
}
|
||||
|
||||
void LldbEngine::refreshBreakpoints(const GdbMi &bkpts)
|
||||
{
|
||||
BreakHandler *handler = breakHandler();
|
||||
|
||||
@@ -156,13 +156,14 @@ private:
|
||||
void refreshAll(const GdbMi &all);
|
||||
void refreshThreads(const GdbMi &threads);
|
||||
void refreshStack(const GdbMi &stack);
|
||||
void refreshRegisters(const GdbMi &stack);
|
||||
void refreshRegisters(const GdbMi ®isters);
|
||||
void refreshLocals(const GdbMi &vars);
|
||||
void refreshTypeInfo(const GdbMi &typeInfo);
|
||||
void refreshState(const GdbMi &state);
|
||||
void refreshLocation(const GdbMi &location);
|
||||
void refreshModules(const GdbMi &modules);
|
||||
void refreshSymbols(const GdbMi &symbols);
|
||||
void refreshOutput(const GdbMi &output);
|
||||
void refreshBreakpoints(const GdbMi &bkpts);
|
||||
void runContinuation(const GdbMi &data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user