From cb4f04f416f8041005062974c92abde1ac990d04 Mon Sep 17 00:00:00 2001 From: hjk <hjk121@nokiamail.com> Date: Fri, 26 Sep 2014 23:43:46 +0200 Subject: [PATCH] Debugger: Remove unused fix cdb integer functions Change-Id: I60e379fdc36f67fdd8fc2d0d440ed41a82374f97 Reviewed-by: David Schulz <david.schulz@digia.com> --- src/plugins/debugger/cdb/cdbparsehelpers.cpp | 40 -------------------- src/plugins/debugger/cdb/cdbparsehelpers.h | 4 -- 2 files changed, 44 deletions(-) diff --git a/src/plugins/debugger/cdb/cdbparsehelpers.cpp b/src/plugins/debugger/cdb/cdbparsehelpers.cpp index 291b0dc897..9603fa6930 100644 --- a/src/plugins/debugger/cdb/cdbparsehelpers.cpp +++ b/src/plugins/debugger/cdb/cdbparsehelpers.cpp @@ -254,46 +254,6 @@ QByteArray cdbClearBreakpointCommand(const BreakpointModelId &id) return "bc " + QByteArray::number(firstBreakPoint) + '-' + QByteArray::number(lastBreakPoint); } -// Fix a CDB integer value: '00000000`0012a290' -> '12a290', '0n10' ->'10' -QByteArray fixCdbIntegerValue(QByteArray t, bool stripLeadingZeros, int *basePtr /* = 0 */) -{ - if (t.isEmpty()) - return t; - int base = 16; - // Prefixes - if (t.startsWith("0x")) { - t.remove(0, 2); - } else if (t.startsWith("0n")) { - base = 10; - t.remove(0, 2); - } - if (base == 16 && t.size() >= 9 && t.at(8) == '`') - t.remove(8, 1); - if (stripLeadingZeros) { // Strip all but last '0' - const int last = t.size() - 1; - int pos = 0; - for ( ; pos < last && t.at(pos) == '0'; pos++) ; - if (pos) - t.remove(0, pos); - } - if (basePtr) - *basePtr = base; - return t; -} - -// Convert a CDB integer value: '00000000`0012a290' -> '12a290', '0n10' ->'10' -QVariant cdbIntegerValue(const QByteArray &t) -{ - int base; - const QByteArray fixed = fixCdbIntegerValue(t, false, &base); - bool ok; - const QVariant converted = base == 16 ? - fixed.toULongLong(&ok, base) : - fixed.toLongLong(&ok, base); - QTC_ASSERT(ok, return QVariant()); - return converted; -} - // Helper to retrieve an int child from GDBMI static inline bool gdbmiChildToInt(const GdbMi &parent, const char *childName, int *target) { diff --git a/src/plugins/debugger/cdb/cdbparsehelpers.h b/src/plugins/debugger/cdb/cdbparsehelpers.h index 75ab6c6438..fc93295580 100644 --- a/src/plugins/debugger/cdb/cdbparsehelpers.h +++ b/src/plugins/debugger/cdb/cdbparsehelpers.h @@ -75,10 +75,6 @@ QByteArray cdbClearBreakpointCommand(const BreakpointModelId &id); // in the expression (that is in addition deleted on resolving for a bp-type breakpoint). void parseBreakPoint(const GdbMi &gdbmi, BreakpointResponse *r, QString *expression = 0); -// Convert a CDB integer value: '00000000`0012a290' -> '12a290', '0n10' ->'10' -QByteArray fixCdbIntegerValue(QByteArray t, bool stripLeadingZeros = false, int *basePtr = 0); -// Convert a CDB integer value into quint64 or int64 -QVariant cdbIntegerValue(const QByteArray &t); // Write memory (f ...). QByteArray cdbWriteMemoryCommand(quint64 addr, const QByteArray &data); -- GitLab