From 1c73e3f19b9fa0717d959204e269d67db46bef58 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint <Friedemann.Kleint@nokia.com> Date: Wed, 27 Oct 2010 15:39:42 +0200 Subject: [PATCH] Debugger[gdb/Mac]: Show location marker in Mac OS disassembly. Account for "0x0000000100002682sub $0x68,%rsp", convert hex address correctly to match the location. Reviewed-by: hjk --- src/plugins/debugger/debuggeragents.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/debuggeragents.cpp b/src/plugins/debugger/debuggeragents.cpp index d18e72c2aa2..dc165640623 100644 --- a/src/plugins/debugger/debuggeragents.cpp +++ b/src/plugins/debugger/debuggeragents.cpp @@ -410,7 +410,9 @@ quint64 DisassemblerViewAgent::address() const // Return address of an assembly line "0x0dfd bla" quint64 DisassemblerViewAgent::addressFromDisassemblyLine(const QString &line) { - const int pos = line.indexOf(QLatin1Char(' ')); + // Mac gdb has an overflow reporting 64bit addresses causing the instruction + // to follow the last digit "0x000000013fff4810mov 1,1". Truncate here. + const int pos = qMin(line.indexOf(QLatin1Char(' ')), 19); if (pos < 0) return 0; QString addressS = line.left(pos); -- GitLab