showMessage(msg, AppOutput);
}
+static bool isNameChar(char c)
+{
+ // could be 'stopped' or 'shlibs-added'
+ return (c >= 'a' && c <= 'z') || c == '-';
+}
+
void GdbEngine::handleResponse(const QByteArray &buff)
{
showMessage(QString::fromLocal8Bit(buff, buff.length()), LogOutput);
namespace Debugger {
namespace Internal {
-enum GuessChildrenResult
-{
- HasChildren,
- HasNoChildren,
- HasPossiblyChildren
-};
-
static QString htmlEscape(const QString &plain)
{
QString rich;
return isIntType(type) || isFloatType(type);
}
-GuessChildrenResult guessChildren(const QByteArray &type)
-{
- if (isIntOrFloatType(type))
- return HasNoChildren;
- if (isCharPointerType(type))
- return HasNoChildren;
- if (isPointerType(type))
- return HasChildren;
- if (type.endsWith("QString"))
- return HasNoChildren;
- return HasPossiblyChildren;
-}
-
WatchData::WatchData() :
id(0),
state(InitialState),
valuetooltip = tooltip;
}
+enum GuessChildrenResult { HasChildren, HasNoChildren, HasPossiblyChildren };
+
+static GuessChildrenResult guessChildren(const QByteArray &type)
+{
+ if (isIntOrFloatType(type))
+ return HasNoChildren;
+ if (isCharPointerType(type))
+ return HasNoChildren;
+ if (isPointerType(type))
+ return HasChildren;
+ if (type.endsWith("QString"))
+ return HasNoChildren;
+ return HasPossiblyChildren;
+}
+
void WatchData::setType(const QByteArray &str, bool guessChildrenFromType)
{
type = str.trimmed();
return result;
}
-QString extractTypeFromPTypeOutput(const QString &str)
-{
- int pos0 = str.indexOf(QLatin1Char('='));
- int pos1 = str.indexOf(QLatin1Char('{'));
- int pos2 = str.lastIndexOf(QLatin1Char('}'));
- QString res = str;
- if (pos0 != -1 && pos1 != -1 && pos2 != -1)
- res = str.mid(pos0 + 2, pos1 - 1 - pos0)
- + QLatin1String(" ... ") + str.right(str.size() - pos2);
- return res.simplified();
-}
-
bool isSymbianIntType(const QByteArray &type)
{
return type == "TInt" || type == "TBool";
data.valueEnabled = false;
}
-void setWatchDataValueEditable(WatchData &data, const GdbMi &mi)
+static void setWatchDataValueEditable(WatchData &data, const GdbMi &mi)
{
if (mi.data() == "true")
data.valueEditable = true;
data.valueEditable = false;
}
-void setWatchDataExpression(WatchData &data, const GdbMi &mi)
+static void setWatchDataExpression(WatchData &data, const GdbMi &mi)
{
if (mi.isValid())
data.exp = mi.data();
}
+static void setWatchDataAddressHelper(WatchData &data, const QByteArray &addr)
+{
+ if (addr.startsWith("0x")) { // Item model dumpers pull tricks
+ data.setHexAddress(addr);
+ } else {
+ data.dumperFlags = addr;
+ }
+ if (data.exp.isEmpty() && !data.dumperFlags.startsWith('$'))
+ data.exp = "*(" + gdbQuoteTypes(data.type) + "*)" +data.hexAddress();
+}
+
void setWatchDataAddress(WatchData &data, const GdbMi &mi)
{
if (mi.isValid())
setWatchDataAddressHelper(data, mi.data());
}
-void setWatchDataOrigAddress(WatchData &data, const GdbMi &mi)
+static void setWatchDataOrigAddress(WatchData &data, const GdbMi &mi)
{
data.origAddress = mi.data().toULongLong(0, 16);
}
-void setWatchDataSize(WatchData &data, const GdbMi &mi)
+static void setWatchDataSize(WatchData &data, const GdbMi &mi)
{
if (mi.isValid()) {
bool ok = false;
}
}
-void setWatchDataAddressHelper(WatchData &data, const QByteArray &addr)
-{
- if (addr.startsWith("0x")) { // Item model dumpers pull tricks
- data.setHexAddress(addr);
- } else {
- data.dumperFlags = addr;
- }
- if (data.exp.isEmpty() && !data.dumperFlags.startsWith('$'))
- data.exp = "*(" + gdbQuoteTypes(data.type) + "*)" +data.hexAddress();
-}
-
// Find the "type" and "displayedtype" children of root and set up type.
void setWatchDataType(WatchData &data, const GdbMi &item)
{
#include <QtCore/QSet>
#include <QtCore/QString>
-#include <QtCore/QMap>
-
-QT_BEGIN_NAMESPACE
-class QDebug;
-QT_END_NAMESPACE
namespace TextEditor {
class ITextEditor;
bool isSkippableFunction(const QString &funcName, const QString &fileName);
bool isLeavableFunction(const QString &funcName, const QString &fileName);
-inline bool isNameChar(char c)
-{
- // could be 'stopped' or 'shlibs-added'
- return (c >= 'a' && c <= 'z') || c == '-';
-}
-
bool hasLetterOrNumber(const QString &exp);
bool hasSideEffects(const QString &exp);
bool isKeyWord(const QString &exp);
bool startsWithDigit(const QString &str);
QByteArray stripPointerType(QByteArray type);
QByteArray gdbQuoteTypes(const QByteArray &type);
-QString extractTypeFromPTypeOutput(const QString &str);
bool isFloatType(const QByteArray &type);
bool isIntOrFloatType(const QByteArray &type);
bool isIntType(const QByteArray &type);
bool isSymbianIntType(const QByteArray &type);
-enum GuessChildrenResult { HasChildren, HasNoChildren, HasPossiblyChildren };
-GuessChildrenResult guessChildren(const QByteArray &type);
-
QString quoteUnprintableLatin1(const QByteArray &ba);
// Editor tooltip support
const QString &function, const QString &file, int line,
QStringList *uninitializedVariables);
-// remove the default template argument in std:: containers
-QString removeDefaultTemplateArguments(QString type);
-
//
// GdbMi interaction
int encoding);
void setWatchDataChildCount(WatchData &data, const GdbMi &mi);
void setWatchDataValueEnabled(WatchData &data, const GdbMi &mi);
-void setWatchDataValueEditable(WatchData &data, const GdbMi &mi);
-void setWatchDataExpression(WatchData &data, const GdbMi &mi);
void setWatchDataAddress(WatchData &data, const GdbMi &mi);
-void setWatchDataAddressHelper(WatchData &data, const QByteArray &addr);
void setWatchDataType(WatchData &data, const GdbMi &mi);
void setWatchDataDisplayedType(WatchData &data, const GdbMi &mi);