summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/disassemblerlines.cpp
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2011-02-10 13:43:02 +0100
committerhjk <qtc-committer@nokia.com>2011-02-10 13:44:40 +0100
commit37686e6a15993406c6e87553524501d61c2b556b (patch)
treed6a48269bcf5cc35101720ffcb2e47139521659e /src/plugins/debugger/disassemblerlines.cpp
parentd8763dca59192ad550a60de468f369ed2ed7cbd8 (diff)
downloadqt-creator-37686e6a15993406c6e87553524501d61c2b556b.tar.gz
debugger: rework logic for chain of disassembler fallbacks.
Old logic was too fragile to maintain. Now it's PointMixed -> PointPlain -> RangeMixed -> RangePlain.
Diffstat (limited to 'src/plugins/debugger/disassemblerlines.cpp')
-rw-r--r--src/plugins/debugger/disassemblerlines.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/plugins/debugger/disassemblerlines.cpp b/src/plugins/debugger/disassemblerlines.cpp
index 73671b6c3a..db1e2f421c 100644
--- a/src/plugins/debugger/disassemblerlines.cpp
+++ b/src/plugins/debugger/disassemblerlines.cpp
@@ -33,19 +33,28 @@
#include "disassemblerlines.h"
+#include <QtCore/QDebug>
+#include <QtCore/QRegExp>
+
namespace Debugger {
namespace Internal {
DisassemblerLine::DisassemblerLine(const QString &unparsed)
{
+ int pos = -1;
+ for (int i = 0; i != unparsed.size(); ++i) {
+ uint c = unparsed.at(i).unicode();
+ if (c == ' ' || c == ':' || c == '\t') {
+ pos = i;
+ break;
+ }
+ }
+
// 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(unparsed.indexOf(QLatin1Char(' ')), 19);
- if (pos < 0) {
- address = 0;
- data = unparsed;
- return;
- }
+ if (pos > 19 && unparsed.mid(3, 16).toULongLong())
+ pos = 19;
+
QString addr = unparsed.left(pos);
// MSVC 64bit: Remove 64bit separator 00000000`00a45000'.
if (addr.size() >= 9 && addr.at(8) == QLatin1Char('`'))
@@ -55,8 +64,7 @@ DisassemblerLine::DisassemblerLine(const QString &unparsed)
addr.chop(1);
if (addr.startsWith(QLatin1String("0x")))
addr.remove(0, 2);
- bool ok;
- address = addr.toULongLong(&ok, 16);
+ address = addr.toULongLong(0, 16);
if (address)
data = unparsed.mid(pos + 1);
else