forked from qt-creator/qt-creator
Debugger: Handle tooltip data in LLDB backend
Task-number: QTCREATORBUG-10690 Change-Id: I5deecfed4c525fd6c3cd75f510e7662e469f99ea Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -979,18 +979,19 @@ class Dumper(DumperBase):
|
|||||||
if not self.dummyValue is None:
|
if not self.dummyValue is None:
|
||||||
for watcher in self.currentWatchers:
|
for watcher in self.currentWatchers:
|
||||||
iname = watcher['iname']
|
iname = watcher['iname']
|
||||||
index = iname[iname.find('.') + 1:]
|
# could be 'watch.0' or 'tooltip.deadbead'
|
||||||
|
(base, component) = iname.split('.')
|
||||||
exp = binascii.unhexlify(watcher['exp'])
|
exp = binascii.unhexlify(watcher['exp'])
|
||||||
if exp == "":
|
if exp == "":
|
||||||
self.put('type="",value="",exp=""')
|
self.put('type="",value="",exp=""')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
value = self.dummyValue.CreateValueFromExpression(iname, exp)
|
value = self.dummyValue.CreateValueFromExpression(iname, exp)
|
||||||
self.currentIName = 'watch'
|
self.currentIName = base
|
||||||
with SubItem(self, index):
|
with SubItem(self, component):
|
||||||
self.put('exp="%s",' % exp)
|
self.put('exp="%s",' % exp)
|
||||||
self.put('wname="%s",' % binascii.hexlify(exp))
|
self.put('wname="%s",' % binascii.hexlify(exp))
|
||||||
self.put('iname="%s",' % self.currentIName)
|
self.put('iname="%s",' % iname)
|
||||||
self.putItem(value)
|
self.putItem(value)
|
||||||
|
|
||||||
self.put(']')
|
self.put(']')
|
||||||
|
|||||||
@@ -120,29 +120,6 @@ void LldbEngine::runCommand(const Command &command)
|
|||||||
m_lldbProc.write(cmd);
|
m_lldbProc.write(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LldbEngine::showToolTip()
|
|
||||||
{
|
|
||||||
if (m_toolTipContext.isNull())
|
|
||||||
return;
|
|
||||||
const QString expression = m_toolTipContext->expression;
|
|
||||||
if (DebuggerToolTipManager::debug())
|
|
||||||
qDebug() << "GdbEngine::showToolTip " << expression << m_toolTipContext->iname << (*m_toolTipContext);
|
|
||||||
|
|
||||||
if (m_toolTipContext->iname.startsWith("tooltip")
|
|
||||||
&& (!debuggerCore()->boolSetting(UseToolTipsInMainEditor)
|
|
||||||
|| !watchHandler()->isValidToolTip(m_toolTipContext->iname))) {
|
|
||||||
watchHandler()->removeData(m_toolTipContext->iname);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
DebuggerToolTipWidget *tw = new DebuggerToolTipWidget;
|
|
||||||
tw->setContext(*m_toolTipContext);
|
|
||||||
tw->acquireEngine(this);
|
|
||||||
DebuggerToolTipManager::showToolTip(m_toolTipContext->mousePosition, tw);
|
|
||||||
// Prevent tooltip from re-occurring (classic GDB, QTCREATORBUG-4711).
|
|
||||||
m_toolTipContext.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LldbEngine::shutdownInferior()
|
void LldbEngine::shutdownInferior()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
|
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
|
||||||
@@ -664,6 +641,35 @@ static WatchData m_toolTip;
|
|||||||
static QPoint m_toolTipPos;
|
static QPoint m_toolTipPos;
|
||||||
static QHash<QString, WatchData> m_toolTipCache;
|
static QHash<QString, WatchData> m_toolTipCache;
|
||||||
|
|
||||||
|
void LldbEngine::showToolTip()
|
||||||
|
{
|
||||||
|
if (m_toolTipContext.isNull())
|
||||||
|
return;
|
||||||
|
const QString expression = m_toolTipContext->expression;
|
||||||
|
if (DebuggerToolTipManager::debug())
|
||||||
|
qDebug() << "LldbEngine::showToolTip " << expression << m_toolTipContext->iname << (*m_toolTipContext);
|
||||||
|
|
||||||
|
if (m_toolTipContext->iname.startsWith("tooltip")
|
||||||
|
&& (!debuggerCore()->boolSetting(UseToolTipsInMainEditor)
|
||||||
|
|| !watchHandler()->isValidToolTip(m_toolTipContext->iname))) {
|
||||||
|
watchHandler()->removeData(m_toolTipContext->iname);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DebuggerToolTipWidget *tw = new DebuggerToolTipWidget;
|
||||||
|
tw->setContext(*m_toolTipContext);
|
||||||
|
tw->acquireEngine(this);
|
||||||
|
DebuggerToolTipManager::showToolTip(m_toolTipContext->mousePosition, tw);
|
||||||
|
// Prevent tooltip from re-occurring (classic GDB, QTCREATORBUG-4711).
|
||||||
|
m_toolTipContext.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LldbEngine::resetLocation()
|
||||||
|
{
|
||||||
|
m_toolTipContext.reset();
|
||||||
|
DebuggerEngine::resetLocation();
|
||||||
|
}
|
||||||
|
|
||||||
bool LldbEngine::setToolTipExpression(const QPoint &mousePos,
|
bool LldbEngine::setToolTipExpression(const QPoint &mousePos,
|
||||||
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &contextIn)
|
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &contextIn)
|
||||||
{
|
{
|
||||||
@@ -814,8 +820,6 @@ void LldbEngine::doUpdateLocals(UpdateParameters params)
|
|||||||
}
|
}
|
||||||
cmd.endList();
|
cmd.endList();
|
||||||
|
|
||||||
//cmd.arg("partial", ??)
|
|
||||||
//cmd.arg("tooltipOnly", ??)
|
|
||||||
//cmd.arg("resultvarname", m_resultVarName);
|
//cmd.arg("resultvarname", m_resultVarName);
|
||||||
|
|
||||||
runCommand(cmd);
|
runCommand(cmd);
|
||||||
@@ -912,6 +916,7 @@ void LldbEngine::refreshLocals(const GdbMi &vars)
|
|||||||
//if (!partial) {
|
//if (!partial) {
|
||||||
list.append(*handler->findData("local"));
|
list.append(*handler->findData("local"));
|
||||||
list.append(*handler->findData("watch"));
|
list.append(*handler->findData("watch"));
|
||||||
|
list.append(*handler->findData("tooltip"));
|
||||||
list.append(*handler->findData("return"));
|
list.append(*handler->findData("return"));
|
||||||
//}
|
//}
|
||||||
|
|
||||||
@@ -929,6 +934,8 @@ void LldbEngine::refreshLocals(const GdbMi &vars)
|
|||||||
parseWatchData(handler->expandedINames(), dummy, child, &list);
|
parseWatchData(handler->expandedINames(), dummy, child, &list);
|
||||||
}
|
}
|
||||||
handler->insertData(list);
|
handler->insertData(list);
|
||||||
|
|
||||||
|
showToolTip();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LldbEngine::refreshStack(const GdbMi &stack)
|
void LldbEngine::refreshStack(const GdbMi &stack)
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ private:
|
|||||||
void shutdownInferior();
|
void shutdownInferior();
|
||||||
void shutdownEngine();
|
void shutdownEngine();
|
||||||
void abortDebugger();
|
void abortDebugger();
|
||||||
|
void resetLocation();
|
||||||
|
|
||||||
bool setToolTipExpression(const QPoint &mousePos,
|
bool setToolTipExpression(const QPoint &mousePos,
|
||||||
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
|
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
|
||||||
|
|||||||
Reference in New Issue
Block a user