Commit d7b8b291 authored by hjk's avatar hjk
Browse files

Debugger: Handle tooltip data in LLDB backend



Task-number: QTCREATORBUG-10690
Change-Id: I5deecfed4c525fd6c3cd75f510e7662e469f99ea
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent ab388457
......@@ -979,18 +979,19 @@ class Dumper(DumperBase):
if not self.dummyValue is None:
for watcher in self.currentWatchers:
iname = watcher['iname']
index = iname[iname.find('.') + 1:]
# could be 'watch.0' or 'tooltip.deadbead'
(base, component) = iname.split('.')
exp = binascii.unhexlify(watcher['exp'])
if exp == "":
self.put('type="",value="",exp=""')
continue
value = self.dummyValue.CreateValueFromExpression(iname, exp)
self.currentIName = 'watch'
with SubItem(self, index):
self.currentIName = base
with SubItem(self, component):
self.put('exp="%s",' % exp)
self.put('wname="%s",' % binascii.hexlify(exp))
self.put('iname="%s",' % self.currentIName)
self.put('iname="%s",' % iname)
self.putItem(value)
self.put(']')
......
......@@ -120,29 +120,6 @@ void LldbEngine::runCommand(const Command &command)
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()
{
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
......@@ -664,6 +641,35 @@ static WatchData m_toolTip;
static QPoint m_toolTipPos;
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,
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &contextIn)
{
......@@ -814,8 +820,6 @@ void LldbEngine::doUpdateLocals(UpdateParameters params)
}
cmd.endList();
//cmd.arg("partial", ??)
//cmd.arg("tooltipOnly", ??)
//cmd.arg("resultvarname", m_resultVarName);
runCommand(cmd);
......@@ -912,6 +916,7 @@ void LldbEngine::refreshLocals(const GdbMi &vars)
//if (!partial) {
list.append(*handler->findData("local"));
list.append(*handler->findData("watch"));
list.append(*handler->findData("tooltip"));
list.append(*handler->findData("return"));
//}
......@@ -929,6 +934,8 @@ void LldbEngine::refreshLocals(const GdbMi &vars)
parseWatchData(handler->expandedINames(), dummy, child, &list);
}
handler->insertData(list);
showToolTip();
}
void LldbEngine::refreshStack(const GdbMi &stack)
......
......@@ -102,6 +102,7 @@ private:
void shutdownInferior();
void shutdownEngine();
void abortDebugger();
void resetLocation();
bool setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment