Debugger: Merge watcher request creation

... of {Gdb,Lldb,Pdb}Engine. Code is the same nowadays.

Change-Id: I874b1ddfd813c15cc16c9b91bd894c7c42b56e93
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
hjk
2015-09-14 12:53:35 +02:00
parent 1cb811ebe6
commit 7ac99044e8
5 changed files with 29 additions and 68 deletions

View File

@@ -37,6 +37,7 @@
#include "debuggerengine.h"
#include "debuggerinternalconstants.h"
#include "debuggerprotocol.h"
#include "debuggertooltipmanager.h"
#include "simplifytype.h"
#include "imageviewer.h"
#include "watchutils.h"
@@ -1621,6 +1622,28 @@ void WatchHandler::appendFormatRequests(DebuggerCommand *cmd)
cmd->endGroup();
}
void WatchHandler::appendWatchersAndTooltipRequests(DebuggerCommand *cmd)
{
cmd->beginList("watchers");
DebuggerToolTipContexts toolTips = DebuggerToolTipManager::pendingTooltips(m_model->m_engine);
foreach (const DebuggerToolTipContext &p, toolTips) {
cmd->beginGroup();
cmd->arg("iname", p.iname);
cmd->arg("exp", p.expression.toLatin1().toHex());
cmd->endGroup();
}
QHashIterator<QByteArray, int> it(WatchHandler::watcherNames());
while (it.hasNext()) {
it.next();
cmd->beginGroup();
cmd->arg("iname", "watch." + QByteArray::number(it.value()));
cmd->arg("exp", it.key().toHex());
cmd->endGroup();
}
cmd->endList();
}
void WatchHandler::addDumpers(const GdbMi &dumpers)
{
foreach (const GdbMi &dumper, dumpers.children()) {