debugger: small rework of the modules handler

Use new elfreader, also slimmer interface.

Change-Id: Ie6387ff14bdefd109768d1ce4c395a17211da77d
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2012-06-01 19:01:37 +02:00
committed by hjk
parent 278d909208
commit e6d4904a62
3 changed files with 67 additions and 90 deletions

View File

@@ -3505,24 +3505,18 @@ void GdbEngine::handleModulesList(const GdbResponse &response)
modulesHandler()->setModules(modules);
}
void GdbEngine::examineModules()
{
foreach (Module module, modulesHandler()->modules()) {
ModulesHandler *handler = modulesHandler();
foreach (Module module, handler->modules()) {
if (module.symbolsType == Module::UnknownType) {
QProcess proc;
qDebug() << _("objdump -h \"%1\"").arg(module.modulePath);
proc.start(_("objdump -h \"%1\"").arg(module.modulePath));
if (!proc.waitForStarted())
continue;
if (!proc.waitForFinished())
continue;
QByteArray ba = proc.readAllStandardOutput();
if (ba.contains(".gdb_index"))
Utils::ElfReader reader(module.modulePath);
QList<QByteArray> names = reader.sectionNames();
if (names.contains(".gdb_index"))
module.symbolsType = Module::FastSymbols;
else
module.symbolsType = Module::PlainSymbols;
modulesHandler()->updateModule(module.modulePath, module);
handler->updateModule(module);
}
}
}