forked from qt-creator/qt-creator
Debugger: Make Watchers work with LLDB
Change-Id: Ie39a38c6646c3c19819e2c122d7f8be285eae09e Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -1185,15 +1185,11 @@ class Dumper(DumperBase):
|
|||||||
iname = watcher['iname']
|
iname = watcher['iname']
|
||||||
index = iname[iname.find('.') + 1:]
|
index = iname[iname.find('.') + 1:]
|
||||||
exp = binascii.unhexlify(watcher['exp'])
|
exp = binascii.unhexlify(watcher['exp'])
|
||||||
warn("EXP: %s" % exp)
|
|
||||||
warn("INDEX: %s" % index)
|
|
||||||
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)
|
||||||
#value = self.dummyValue
|
|
||||||
warn("VALUE: %s" % value)
|
|
||||||
self.currentIName = 'watch'
|
self.currentIName = 'watch'
|
||||||
with SubItem(self, index):
|
with SubItem(self, index):
|
||||||
self.put('exp="%s",' % exp)
|
self.put('exp="%s",' % exp)
|
||||||
@@ -1530,11 +1526,6 @@ class Dumper(DumperBase):
|
|||||||
error = str(result.GetError())
|
error = str(result.GetError())
|
||||||
self.report('success="%d",output="%s",error="%s"' % (success, output, error))
|
self.report('success="%d",output="%s",error="%s"' % (success, output, error))
|
||||||
|
|
||||||
def setWatchers(self, args):
|
|
||||||
#self.currentWatchers = args['watchers']
|
|
||||||
#warn("WATCHERS %s" % self.currentWatchers)
|
|
||||||
self.reportData()
|
|
||||||
|
|
||||||
def updateData(self, args):
|
def updateData(self, args):
|
||||||
if 'expanded' in args:
|
if 'expanded' in args:
|
||||||
self.expandedINames = set(args['expanded'].split(','))
|
self.expandedINames = set(args['expanded'].split(','))
|
||||||
@@ -1546,6 +1537,8 @@ class Dumper(DumperBase):
|
|||||||
self.useFancy = int(args['fancy'])
|
self.useFancy = int(args['fancy'])
|
||||||
if 'passexceptions' in args:
|
if 'passexceptions' in args:
|
||||||
self.passExceptions = int(args['passexceptions'])
|
self.passExceptions = int(args['passexceptions'])
|
||||||
|
if 'watchers' in args:
|
||||||
|
self.currentWatchers = args['watchers']
|
||||||
self.reportVariables(args)
|
self.reportVariables(args)
|
||||||
|
|
||||||
def disassemble(self, args):
|
def disassemble(self, args):
|
||||||
|
|||||||
@@ -187,7 +187,6 @@ void LldbEngine::setupInferior()
|
|||||||
? sp.remoteChannel : QString()));
|
? sp.remoteChannel : QString()));
|
||||||
cmd.arg("platform", sp.platform);
|
cmd.arg("platform", sp.platform);
|
||||||
runCommand(cmd);
|
runCommand(cmd);
|
||||||
requestUpdateWatchers();
|
|
||||||
updateLocals(); // update display options
|
updateLocals(); // update display options
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -730,8 +729,6 @@ void LldbEngine::updateLocals()
|
|||||||
{
|
{
|
||||||
WatchHandler *handler = watchHandler();
|
WatchHandler *handler = watchHandler();
|
||||||
|
|
||||||
//requestUpdateWatchers();
|
|
||||||
|
|
||||||
Command cmd("updateData");
|
Command cmd("updateData");
|
||||||
cmd.arg("expanded", handler->expansionRequests());
|
cmd.arg("expanded", handler->expansionRequests());
|
||||||
cmd.arg("typeformats", handler->typeFormatRequests());
|
cmd.arg("typeformats", handler->typeFormatRequests());
|
||||||
@@ -776,6 +773,18 @@ void LldbEngine::updateLocals()
|
|||||||
cmd.arg("fancy", debuggerCore()->boolSetting(UseDebuggingHelpers));
|
cmd.arg("fancy", debuggerCore()->boolSetting(UseDebuggingHelpers));
|
||||||
cmd.arg("autoderef", debuggerCore()->boolSetting(AutoDerefPointers));
|
cmd.arg("autoderef", debuggerCore()->boolSetting(AutoDerefPointers));
|
||||||
cmd.arg("dyntype", debuggerCore()->boolSetting(UseDynamicType));
|
cmd.arg("dyntype", debuggerCore()->boolSetting(UseDynamicType));
|
||||||
|
|
||||||
|
cmd.beginList("watchers");
|
||||||
|
QHashIterator<QByteArray, int> it(WatchHandler::watcherNames());
|
||||||
|
while (it.hasNext()) {
|
||||||
|
it.next();
|
||||||
|
cmd.beginGroup()
|
||||||
|
.arg("iname", "watch." + QByteArray::number(it.value()))
|
||||||
|
.arg("exp", it.key().toHex())
|
||||||
|
.endGroup();
|
||||||
|
}
|
||||||
|
cmd.endList();
|
||||||
|
|
||||||
//cmd.arg("partial", ??)
|
//cmd.arg("partial", ??)
|
||||||
//cmd.arg("tooltipOnly", ??)
|
//cmd.arg("tooltipOnly", ??)
|
||||||
//cmd.arg("resultvarname", m_resultVarName);
|
//cmd.arg("resultvarname", m_resultVarName);
|
||||||
@@ -862,22 +871,6 @@ void LldbEngine::readLldbStandardOutput()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LldbEngine::requestUpdateWatchers()
|
|
||||||
{
|
|
||||||
QHashIterator<QByteArray, int> it(WatchHandler::watcherNames());
|
|
||||||
QList<QByteArray> watcherData;
|
|
||||||
while (it.hasNext()) {
|
|
||||||
it.next();
|
|
||||||
QHash<QByteArray, QByteArray> hash;
|
|
||||||
hash["iname"] = "\"watch." + QByteArray::number(it.value()) + '"';
|
|
||||||
hash["exp"] = '"' + it.key().toHex() + '"';
|
|
||||||
watcherData.append(Command::toData(hash));
|
|
||||||
}
|
|
||||||
Command cmd("setWatchers");
|
|
||||||
cmd.args.append("\"watchers\":" + Command::toData(watcherData) + ',');
|
|
||||||
runCommand(cmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LldbEngine::refreshLocals(const GdbMi &vars)
|
void LldbEngine::refreshLocals(const GdbMi &vars)
|
||||||
{
|
{
|
||||||
//const bool partial = response.cookie.toBool();
|
//const bool partial = response.cookie.toBool();
|
||||||
|
|||||||
@@ -135,7 +135,6 @@ private:
|
|||||||
bool supportsThreads() const { return true; }
|
bool supportsThreads() const { return true; }
|
||||||
bool isSynchronous() const { return true; }
|
bool isSynchronous() const { return true; }
|
||||||
void updateWatchData(const WatchData &data, const WatchUpdateFlags &flags);
|
void updateWatchData(const WatchData &data, const WatchUpdateFlags &flags);
|
||||||
void requestUpdateWatchers();
|
|
||||||
void setRegisterValue(int regnr, const QString &value);
|
void setRegisterValue(int regnr, const QString &value);
|
||||||
|
|
||||||
void fetchMemory(Internal::MemoryAgent *, QObject *, quint64 addr, quint64 length);
|
void fetchMemory(Internal::MemoryAgent *, QObject *, quint64 addr, quint64 length);
|
||||||
|
|||||||
Reference in New Issue
Block a user