Commit 9ad447b8 authored by hjk's avatar hjk

debugger: make gdb-6.8-symbianelf work

parent 3023495c
......@@ -26,8 +26,12 @@ def qmin(n, m):
return n
return m
def isGoodGdb():
return gdb.VERSION.startswith("6.8.50.2009") \
and gdb.VERSION != "6.8.50.20090630-cvs"
def parseAndEvaluate(exp):
if gdb.VERSION.startswith("6.8.50.2009"):
if isGoodGdb():
return gdb.parse_and_eval(exp)
# Work around non-existing gdb.parse_and_eval as in released 7.0
gdb.execute("set logging redirect on")
......@@ -41,10 +45,10 @@ def listOfLocals():
frame = gdb.selected_frame()
#warn("FRAME %s: " % frame)
except RuntimeError:
return ""
return []
items = []
if gdb.VERSION.startswith("6.8.50.2009"):
if isGoodGdb():
# archer-tromey-python
block = frame.block()
while True:
......@@ -77,9 +81,11 @@ def listOfLocals():
block = block.superblock
else:
# Assuming gdb 7.0 release.
# Assuming gdb 7.0 release or 6.8-symbianelf.
file = tempfile.mkstemp(prefix="gdbpy_")
filename = file[1]
gdb.execute("set logging off")
gdb.execute("set logging redirect off")
gdb.execute("set logging file %s" % filename)
gdb.execute("set logging redirect on")
gdb.execute("set logging on")
......
......@@ -1244,11 +1244,16 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
// signal-meaning="Trace/breakpoint trap",thread-id="2",
// frame={addr="0x7c91120f",func="ntdll!DbgUiConnectToDbg",
// args=[],from="C:\\WINDOWS\\system32\\ntdll.dll"}
//if (reason == "signal-received"
// && data.findChild("signal-name").data() == "SIGTRAP") {
// continueInferiorInternal();
// return;
//}
// also seen on gdb 6.8-symbianelf without qXfer:libraries:read+;
// FIXME: remote.c parses "loaded" reply. It should be turning
// that into a TARGET_WAITKIND_LOADED. Does it?
// The bandaid here has the problem that it breaks for 'next' over a
// statement that indirectly loads shared libraries
if (reason == "signal-received"
&& data.findChild("signal-name").data() == "SIGTRAP") {
continueInferiorInternal();
return;
}
// jump over well-known frames
static int stepCounter = 0;
......
......@@ -253,6 +253,7 @@ private: ////////// Gdb Command Management //////////
CommandsDoneCallback m_commandsDoneCallback;
QList<GdbCommand> m_commandsToRunOnTemporaryBreak;
int gdbVersion() const { return m_gdbVersion; }
private: ////////// Gdb Output, State & Capability Handling //////////
......
This diff is collapsed.
......@@ -92,6 +92,7 @@ struct Snapshot
void insertMemory(const MemoryRange &range, const QByteArray &ba);
uint registers[RegisterCount];
bool registerValid;
typedef QMap<MemoryRange, QByteArray> Memory;
Memory memory;
......@@ -204,6 +205,8 @@ private:
void handleDeleteProcess(const TrkResult &result);
void handleDeleteProcess2(const TrkResult &result);
void handleAndReportCreateProcess(const TrkResult &result);
void handleAndReportReadRegisters(const TrkResult &result);
void handleAndReportReadRegister(const TrkResult &result);
void handleAndReportReadRegistersAfterStop(const TrkResult &result);
void reportRegisters();
QByteArray memoryReadLogMessage(uint addr, const QByteArray &ba) const;
......
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