Commit 8d022d61 authored by hjk's avatar hjk
Browse files

Debugger: Re-enable target arch parsing of manual debuggers



Change-Id: I1c3790447aa863b532133c0280349aa07a920b8a
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent 22b526ff
......@@ -67,15 +67,22 @@ void DebuggerItem::reinitializeFromFile()
QByteArray ba = proc.readAll();
if (ba.contains("gdb")) {
m_engineType = GdbEngineType;
// const char needle[] = "This GDB was configured as \"";
// int pos1 = ba.indexOf(needle);
// if (pos1 != -1) {
// pos1 += sizeof(needle);
// int pos2 = ba.indexOf('"', pos1 + 1);
// QByteArray target = ba.mid(pos1, pos2 - pos1);
// abis.append(Abi::abiFromTargetTriplet(target)); // FIXME: Doesn't exist yet.
// }
m_abis = Abi::abisOfBinary(m_command); // FIXME: Wrong.
const char needle[] = "This GDB was configured as \"";
// E.g. "--host=i686-pc-linux-gnu --target=arm-unknown-nto-qnx6.5.0".
// or "i686-linux-gnu"
int pos1 = ba.indexOf(needle);
if (pos1 != -1) {
pos1 += int(sizeof(needle));
int pos2 = ba.indexOf('"', pos1 + 1);
QByteArray target = ba.mid(pos1, pos2 - pos1);
int pos3 = target.indexOf("--target=");
if (pos3 >= 0)
target = target.mid(pos3 + 9);
m_abis.append(Abi::abiFromTargetTriplet(QString::fromLatin1(target)));
} else {
// Fallback.
m_abis = Abi::abisOfBinary(m_command); // FIXME: Wrong.
}
return;
}
if (ba.contains("lldb") || ba.startsWith("LLDB")) {
......
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