Commit 0982e077 authored by hjk's avatar hjk

debugger: extend possible "modules symbols loaded" states a bit

parent 2f425447
......@@ -2639,7 +2639,8 @@ void GdbEngine::handleModulesList(const GdbResponse &response)
if (line.startsWith(__("0x"))) {
ts >> module.startAddress >> module.endAddress >> symbolsRead;
module.moduleName = ts.readLine().trimmed();
module.symbolsRead = (symbolsRead == __("Yes"));
module.symbolsRead =
(symbolsRead == __("Yes") ? Module::ReadOk : Module::ReadFailed);
modules.append(module);
} else if (line.trimmed().startsWith(__("No"))) {
// gdb 6.4 symbianelf
......@@ -2658,7 +2659,8 @@ void GdbEngine::handleModulesList(const GdbResponse &response)
foreach (const GdbMi &item, response.data.children()) {
Module module;
module.moduleName = QString::fromLocal8Bit(item.findChild("path").data());
module.symbolsRead = (item.findChild("state").data() == "Y");
module.symbolsRead = (item.findChild("state").data() == "Y")
? Module::ReadOk : Module::ReadFailed;
module.startAddress = _(item.findChild("loaded_addr").data());
//: End address of loaded module
module.endAddress = tr("<unknown>", "address");
......
......@@ -80,14 +80,11 @@ private:
int indexOfModule(const QString &name) const;
DebuggerEngine *m_engine;
const QVariant m_yes;
const QVariant m_no;
Modules m_modules;
};
ModulesModel::ModulesModel(ModulesHandler *parent, DebuggerEngine *engine)
: QAbstractItemModel(parent),
m_engine(engine), m_yes(tr("yes")), m_no(tr("no"))
: QAbstractItemModel(parent), m_engine(engine)
{}
QVariant ModulesModel::headerData(int section,
......@@ -98,6 +95,7 @@ QVariant ModulesModel::headerData(int section,
tr("Module name") + " ",
tr("Module path") + " ",
tr("Symbols read") + " ",
tr("Symbols type") + " ",
tr("Start address") + " ",
tr("End address") + " "
};
......@@ -134,13 +132,25 @@ QVariant ModulesModel::data(const QModelIndex &index, int role) const
break;
case 2:
if (role == Qt::DisplayRole)
return module.symbolsRead ? m_yes : m_no;
switch (module.symbolsRead) {
case Module::UnknownReadState: return tr("unknown");
case Module::ReadFailed: return tr("no");
case Module::ReadOk: return tr("yes");
}
break;
case 3:
if (role == Qt::DisplayRole)
return module.startAddress;
switch (module.symbolsType) {
case Module::UnknownType: return tr("unknown");
case Module::PlainSymbols: return tr("plain");
case Module::FastSymbols: return tr("fast");
}
break;
case 4:
if (role == Qt::DisplayRole)
return module.startAddress;
break;
case 5:
if (role == Qt::DisplayRole)
return module.endAddress;
break;
......
......@@ -70,12 +70,23 @@ typedef QList<Symbol> Symbols;
class Module
{
public:
Module() : symbolsRead(false) {}
Module() : symbolsRead(UnknownReadState), symbolsType(UnknownType) {}
public:
enum SymbolReadState {
UnknownReadState, // Not tried.
ReadFailed, // Tried to read, but failed.
ReadOk, // Dwarf index available.
};
enum SymbolType {
UnknownType, // Unknown.
PlainSymbols, // Ordinary symbols available.
FastSymbols, // Dwarf index available.
};
QString moduleName;
QString modulePath;
bool symbolsRead;
SymbolReadState symbolsRead;
SymbolType symbolsType;
QString startAddress;
QString endAddress;
};
......
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