summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2009-04-29 18:03:35 +0200
committerhjk <qtc-committer@nokia.com>2009-04-29 18:03:35 +0200
commitb72b4142dc201f6de07989628bcc23bd1f03a3e3 (patch)
tree097148e4a56c63ec751d212fe4350c7932785e38 /src
parent0ce788a42af778ed1fe524d872f9776e6066b899 (diff)
downloadqt-creator-b72b4142dc201f6de07989628bcc23bd1f03a3e3.tar.gz
debugger: code cosmetics
Diffstat (limited to 'src')
-rw-r--r--src/plugins/debugger/watchutils.cpp38
-rw-r--r--src/plugins/debugger/watchutils.h6
2 files changed, 24 insertions, 20 deletions
diff --git a/src/plugins/debugger/watchutils.cpp b/src/plugins/debugger/watchutils.cpp
index c77fc0a5b3..5be973677e 100644
--- a/src/plugins/debugger/watchutils.cpp
+++ b/src/plugins/debugger/watchutils.cpp
@@ -166,8 +166,10 @@ bool isPointerType(const QString &type)
bool isAccessSpecifier(const QString &str)
{
- static const QStringList items =
- QStringList() << QLatin1String("private") << QLatin1String("protected") << QLatin1String("public");
+ static const QStringList items = QStringList()
+ << QLatin1String("private")
+ << QLatin1String("protected")
+ << QLatin1String("public");
return items.contains(str);
}
@@ -326,28 +328,28 @@ static QString quoteUnprintableLatin1(const QByteArray &ba)
return res;
}
-QString decodeData(const QByteArray &baIn, int encoding)
+QString decodeData(const QByteArray &ba, int encoding)
{
switch (encoding) {
case 0: // unencoded 8 bit data
- return quoteUnprintableLatin1(baIn);
+ return quoteUnprintableLatin1(ba);
case 1: { // base64 encoded 8 bit data, used for QByteArray
const QChar doubleQuote(QLatin1Char('"'));
QString rc = doubleQuote;
- rc += quoteUnprintableLatin1(QByteArray::fromBase64(baIn));
+ rc += quoteUnprintableLatin1(QByteArray::fromBase64(ba));
rc += doubleQuote;
return rc;
}
case 2: { // base64 encoded 16 bit data, used for QString
const QChar doubleQuote(QLatin1Char('"'));
- const QByteArray ba = QByteArray::fromBase64(baIn);
+ const QByteArray ba = QByteArray::fromBase64(ba);
QString rc = doubleQuote;
rc += QString::fromUtf16(reinterpret_cast<const ushort *>(ba.data()), ba.size() / 2);
rc += doubleQuote;
return rc;
}
case 3: { // base64 encoded 32 bit data
- const QByteArray ba = QByteArray::fromBase64(baIn);
+ const QByteArray ba = QByteArray::fromBase64(ba);
const QChar doubleQuote(QLatin1Char('"'));
QString rc = doubleQuote;
rc += QString::fromUcs4(reinterpret_cast<const uint *>(ba.data()), ba.size() / 4);
@@ -355,7 +357,7 @@ QString decodeData(const QByteArray &baIn, int encoding)
return rc;
}
case 4: { // base64 encoded 16 bit data, without quotes (see 2)
- const QByteArray ba = QByteArray::fromBase64(baIn);
+ const QByteArray ba = QByteArray::fromBase64(ba);
return QString::fromUtf16(reinterpret_cast<const ushort *>(ba.data()), ba.size() / 2);
}
}
@@ -374,7 +376,6 @@ QtDumperResult::QtDumperResult() :
valuedisabled(false),
childCount(0),
internal(false)
-
{
}
@@ -598,7 +599,6 @@ QtDumperHelper::Type QtDumperHelper::specialType(QString s)
return UnknownType;
}
-
bool QtDumperHelper::needsExpressionSyntax(Type t)
{
switch (t) {
@@ -614,7 +614,7 @@ bool QtDumperHelper::needsExpressionSyntax(Type t)
return true;
default:
break;
- }
+ }
return false;
}
@@ -652,9 +652,8 @@ void QtDumperHelper::parseQueryTypes(const QStringList &l, Debugger debugger)
const Type t = specialType(l.at(i));
if (t != UnknownType) {
// Exclude types that require expression syntax for CDB
- if (debugger == GdbDebugger || !needsExpressionSyntax(t)) {
+ if (debugger == GdbDebugger || !needsExpressionSyntax(t))
m_nameTypeMap.insert(l.at(i), t);
- }
} else {
m_nameTypeMap.insert(l.at(i), SupportedType);
}
@@ -668,7 +667,8 @@ void QtDumperHelper::parseQueryTypes(const QStringList &l, Debugger debugger)
* value="dABoAHIAZQBlAA==",valueencoded="2"}]"
* Default implementation can be used for debugging purposes. */
-class DumperParser {
+class DumperParser
+{
public:
explicit DumperParser(const char *s) : m_s(s) {}
bool run();
@@ -1182,11 +1182,13 @@ void QtDumperHelper::evaluationParameters(const WatchData &data,
/* Parse value:
* "iname="local.sl",addr="0x0012BA84",value="<3 items>",valuedisabled="true",
- * numchild="3",childtype="QString",childnumchild="0",children=[{name="0",value="<binhex>",
- * valueencoded="2"},{name="1",value="dAB3AG8A",valueencoded="2"},{name="2",
- * value="dABoAHIAZQBlAA==",valueencoded="2"}]" */
+ * numchild="3",childtype="QString",childnumchild="0",
+ * children=[{name="0",value="<binhex>",valueencoded="2"},
+ * {name="1",value="dAB3AG8A",valueencoded="2"},
+ * {name="2",value="dABoAHIAZQBlAA==",valueencoded="2"}]" */
-class ValueDumperParser : public DumperParser {
+class ValueDumperParser : public DumperParser
+{
public:
explicit ValueDumperParser(const char *s);
diff --git a/src/plugins/debugger/watchutils.h b/src/plugins/debugger/watchutils.h
index e316973ca1..47f73a8bb7 100644
--- a/src/plugins/debugger/watchutils.h
+++ b/src/plugins/debugger/watchutils.h
@@ -114,7 +114,8 @@ QDebug operator<<(QDebug in, const QtDumperResult &d);
* 2) Evaluate symbol, taking address and some additional parameters
* depending on type. */
-class QtDumperHelper {
+class QtDumperHelper
+{
public:
enum Debugger {
GdbDebugger, // Can evalulate expressions in function calls
@@ -127,7 +128,7 @@ public:
// Below types require special handling
QObjectType, QWidgetType, QObjectSlotType, QObjectSignalType,
QVectorType, QMapType, QMultiMapType, QMapNodeType,
- StdVectorType, StdDequeType, StdSetType,StdMapType, StdStackType,
+ StdVectorType, StdDequeType, StdSetType, StdMapType, StdStackType,
StdStringType
};
@@ -203,6 +204,7 @@ private:
};
QDebug operator<<(QDebug in, const QtDumperHelper::TypeData &d);
+
} // namespace Internal
} // namespace Debugger