Commit 3407aab9 authored by hjk's avatar hjk
Browse files

debugger: keep track of library loads as reported by trk

parent 85378643
......@@ -724,6 +724,17 @@ void TrkGdbAdapter::handleGdbServerCommand(const QByteArray &cmd)
sendGdbServerMessage("l<target><architecture>symbianelf</architecture></target>");
}
else if (cmd.startsWith("qXfer:libraries:read")) {
sendGdbServerAck();
/*
<library-list>
<library name="/lib/libc.so.6">
<segment address="0x10000000"/>
</library>
</library-list>
i */
}
else if (cmd == "QStartNoAckMode") {
//$qSupported#37
//logMessage("Handling 'QStartNoAckMode'");
......@@ -952,9 +963,14 @@ void TrkGdbAdapter::handleTrkResult(const TrkResult &result)
str << " CODE: " << hexxNumber(codeseg);
str << " DATA: " << hexxNumber(dataseg);
str << " NAME: '" << name << '\'';
Library lib;
lib.name = name;
lib.codeseg = codeseg;
lib.dataseg = dataseg;
m_session.libraries.append(lib);
logMessage(logMsg);
// This lets gdb trigger a register update etc
//sendGdbServerMessage("T05library:r;");
sendGdbServerMessage("T05library:;");
sendTrkMessage(0x18, TrkCallback(), trkContinueMessage(), "CONTINUE");
break;
}
......
......@@ -114,9 +114,20 @@ enum TargetConstants
MemoryChunkSize = 256
};
struct Library
{
Library() {}
QString name;
uint codeseg;
uint dataseg;
};
struct Session
{
Session() {
Session() { reset(); }
void reset() {
cpuMajor = 0;
cpuMinor = 0;
bigEndian = 0;
......@@ -130,6 +141,7 @@ struct Session
dataseg = 0;
currentThread = 0;
libraries.clear();
}
// Trk feedback
......@@ -146,6 +158,9 @@ struct Session
uint dataseg;
QHash<uint, uint> addressToBP;
typedef QList<Library> Libraries;
Libraries libraries;
// Gdb request
uint currentThread;
QStringList modules;
......@@ -160,6 +175,7 @@ struct Snapshot
Memory memory;
};
struct Breakpoint
{
Breakpoint(uint offset_ = 0)
......
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