forked from qt-creator/qt-creator
Debugger: Funnel some LLDB message to the AppOutputPane
This could be extended to the other bridges, not done in this patch. Change-Id: I620290049b7c95f8e3fb7584d4ca99a42fd343d4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -32,7 +32,7 @@ import threading
|
||||
import time
|
||||
import lldb
|
||||
import utils
|
||||
from utils import DebuggerStartMode, BreakpointType, TypeCode
|
||||
from utils import DebuggerStartMode, BreakpointType, TypeCode, LogChannel
|
||||
|
||||
from contextlib import contextmanager
|
||||
|
||||
@@ -127,8 +127,16 @@ class Dumper(DumperBase):
|
||||
self.isInterrupting_ = False
|
||||
self.interpreterBreakpointResolvers = []
|
||||
|
||||
DumperBase.warn = Dumper.warn_impl
|
||||
self.report('lldbversion=\"%s\"' % lldb.SBDebugger.GetVersionString())
|
||||
|
||||
@staticmethod
|
||||
def warn_impl(message):
|
||||
if message[-1:] == '\n':
|
||||
message += '\n'
|
||||
print('@\nbridgemessage={msg="%s",channel="%s"}\n@'
|
||||
% (message.replace('"', '$'), LogChannel.AppError))
|
||||
|
||||
def fromNativeFrameValue(self, nativeValue):
|
||||
return self.fromNativeValue(nativeValue)
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ class BreakpointType():
|
||||
) = range(0, 14)
|
||||
|
||||
|
||||
# Internal codes for types keep in sync with cdbextensions pytype.cpp
|
||||
# Internal codes for types. Keep in sync with cdbextensions pytype.cpp
|
||||
class TypeCode():
|
||||
(
|
||||
Typedef,
|
||||
@@ -108,6 +108,26 @@ class TypeCode():
|
||||
) = range(0, 16)
|
||||
|
||||
|
||||
# Internal codes for logging channels. Keep in sync woth debuggerconstants.h
|
||||
class LogChannel():
|
||||
(
|
||||
LogInput, # Used for user input
|
||||
LogMiscInput, # Used for misc stuff in the input pane
|
||||
LogOutput,
|
||||
LogWarning,
|
||||
LogError,
|
||||
LogStatus, # Used for status changed messages
|
||||
LogTime, # Used for time stamp messages
|
||||
LogDebug,
|
||||
LogMisc,
|
||||
AppOutput, # stdout
|
||||
AppError, # stderr
|
||||
AppStuff, # (possibly) windows debug channel
|
||||
StatusBar, # LogStatus and also put to the status bar
|
||||
ConsoleOutput # Used to output to console
|
||||
) = range(0, 14)
|
||||
|
||||
|
||||
def isIntegralTypeName(name):
|
||||
return name in (
|
||||
"int",
|
||||
|
||||
@@ -407,6 +407,8 @@ void LldbEngine::handleResponse(const QString &response)
|
||||
notifyInferiorPid(item.toProcessHandle());
|
||||
else if (name == "breakpointmodified")
|
||||
handleInterpreterBreakpointModified(item);
|
||||
else if (name == "bridgemessage")
|
||||
showMessage(item["msg"].data(), item["channel"].toInt());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user