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:
hjk
2020-05-07 17:35:34 +02:00
parent b8cce1bd5b
commit c6007f5a2c
3 changed files with 32 additions and 2 deletions

View File

@@ -32,7 +32,7 @@ import threading
import time import time
import lldb import lldb
import utils import utils
from utils import DebuggerStartMode, BreakpointType, TypeCode from utils import DebuggerStartMode, BreakpointType, TypeCode, LogChannel
from contextlib import contextmanager from contextlib import contextmanager
@@ -127,8 +127,16 @@ class Dumper(DumperBase):
self.isInterrupting_ = False self.isInterrupting_ = False
self.interpreterBreakpointResolvers = [] self.interpreterBreakpointResolvers = []
DumperBase.warn = Dumper.warn_impl
self.report('lldbversion=\"%s\"' % lldb.SBDebugger.GetVersionString()) 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): def fromNativeFrameValue(self, nativeValue):
return self.fromNativeValue(nativeValue) return self.fromNativeValue(nativeValue)

View File

@@ -86,7 +86,7 @@ class BreakpointType():
) = range(0, 14) ) = 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(): class TypeCode():
( (
Typedef, Typedef,
@@ -108,6 +108,26 @@ class TypeCode():
) = range(0, 16) ) = 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): def isIntegralTypeName(name):
return name in ( return name in (
"int", "int",

View File

@@ -407,6 +407,8 @@ void LldbEngine::handleResponse(const QString &response)
notifyInferiorPid(item.toProcessHandle()); notifyInferiorPid(item.toProcessHandle());
else if (name == "breakpointmodified") else if (name == "breakpointmodified")
handleInterpreterBreakpointModified(item); handleInterpreterBreakpointModified(item);
else if (name == "bridgemessage")
showMessage(item["msg"].data(), item["channel"].toInt());
} }
} }