forked from qt-creator/qt-creator
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
This commit is contained in:
@@ -52,7 +52,13 @@
|
|||||||
|
|
||||||
int qtGhVersion = QT_VERSION;
|
int qtGhVersion = QT_VERSION;
|
||||||
|
|
||||||
#ifdef QT_GUI_LIB
|
#ifndef USE_QT_GUI
|
||||||
|
# ifdef QT_GUI_LIB
|
||||||
|
# define USE_QT_GUI 1
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if USE_QT_GUI
|
||||||
# include <QtGui/QWidget>
|
# include <QtGui/QWidget>
|
||||||
# include <QtGui/QPixmap>
|
# include <QtGui/QPixmap>
|
||||||
# include <QtGui/QImage>
|
# include <QtGui/QImage>
|
||||||
@@ -1296,9 +1302,9 @@ static void qDumpQHashNode(QDumper &d)
|
|||||||
d.disarm();
|
d.disarm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if USE_QT_GUI
|
||||||
static void qDumpQImage(QDumper &d)
|
static void qDumpQImage(QDumper &d)
|
||||||
{
|
{
|
||||||
#ifdef QT_GUI_LIB
|
|
||||||
const QImage &im = *reinterpret_cast<const QImage *>(d.data);
|
const QImage &im = *reinterpret_cast<const QImage *>(d.data);
|
||||||
P(d, "value", "(" << im.width() << "x" << im.height() << ")");
|
P(d, "value", "(" << im.width() << "x" << im.height() << ")");
|
||||||
P(d, "type", NS"QImage");
|
P(d, "type", NS"QImage");
|
||||||
@@ -1312,14 +1318,12 @@ static void qDumpQImage(QDumper &d)
|
|||||||
d.endHash();
|
d.endHash();
|
||||||
}
|
}
|
||||||
d.disarm();
|
d.disarm();
|
||||||
#else
|
|
||||||
Q_UNUSED(d);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if USE_QT_GUI
|
||||||
static void qDumpQImageData(QDumper &d)
|
static void qDumpQImageData(QDumper &d)
|
||||||
{
|
{
|
||||||
#ifdef QT_GUI_LIB
|
|
||||||
const QImage &im = *reinterpret_cast<const QImage *>(d.data);
|
const QImage &im = *reinterpret_cast<const QImage *>(d.data);
|
||||||
const QByteArray ba(QByteArray::fromRawData((const char*)im.bits(), im.numBytes()));
|
const QByteArray ba(QByteArray::fromRawData((const char*)im.bits(), im.numBytes()));
|
||||||
P(d, "type", NS"QImageData");
|
P(d, "type", NS"QImageData");
|
||||||
@@ -1334,10 +1338,8 @@ static void qDumpQImageData(QDumper &d)
|
|||||||
P(d, "value", ba);
|
P(d, "value", ba);
|
||||||
#endif
|
#endif
|
||||||
d.disarm();
|
d.disarm();
|
||||||
#else
|
|
||||||
Q_UNUSED(d);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void qDumpQList(QDumper &d)
|
static void qDumpQList(QDumper &d)
|
||||||
{
|
{
|
||||||
@@ -2020,18 +2022,16 @@ static void qDumpQObjectSlotList(QDumper &d)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if USE_QT_GUI
|
||||||
static void qDumpQPixmap(QDumper &d)
|
static void qDumpQPixmap(QDumper &d)
|
||||||
{
|
{
|
||||||
#ifdef QT_GUI_LIB
|
|
||||||
const QPixmap &im = *reinterpret_cast<const QPixmap *>(d.data);
|
const QPixmap &im = *reinterpret_cast<const QPixmap *>(d.data);
|
||||||
P(d, "value", "(" << im.width() << "x" << im.height() << ")");
|
P(d, "value", "(" << im.width() << "x" << im.height() << ")");
|
||||||
P(d, "type", NS"QPixmap");
|
P(d, "type", NS"QPixmap");
|
||||||
P(d, "numchild", "0");
|
P(d, "numchild", "0");
|
||||||
d.disarm();
|
d.disarm();
|
||||||
#else
|
|
||||||
Q_UNUSED(d);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void qDumpQSet(QDumper &d)
|
static void qDumpQSet(QDumper &d)
|
||||||
{
|
{
|
||||||
@@ -2691,10 +2691,12 @@ static void handleProtocolVersion2and3(QDumper & d)
|
|||||||
qDumpStdList(d);
|
qDumpStdList(d);
|
||||||
break;
|
break;
|
||||||
case 'I':
|
case 'I':
|
||||||
|
#if USE_QT_GUI
|
||||||
if (isEqual(type, "QImage"))
|
if (isEqual(type, "QImage"))
|
||||||
qDumpQImage(d);
|
qDumpQImage(d);
|
||||||
else if (isEqual(type, "QImageData"))
|
else if (isEqual(type, "QImageData"))
|
||||||
qDumpQImageData(d);
|
qDumpQImageData(d);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 'L':
|
case 'L':
|
||||||
if (isEqual(type, "QList"))
|
if (isEqual(type, "QList"))
|
||||||
@@ -2731,8 +2733,10 @@ static void handleProtocolVersion2and3(QDumper & d)
|
|||||||
qDumpQObjectSlotList(d);
|
qDumpQObjectSlotList(d);
|
||||||
break;
|
break;
|
||||||
case 'P':
|
case 'P':
|
||||||
|
#if USE_QT_GUI
|
||||||
if (isEqual(type, "QPixmap"))
|
if (isEqual(type, "QPixmap"))
|
||||||
qDumpQPixmap(d);
|
qDumpQPixmap(d);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
if (isEqual(type, "QSet"))
|
if (isEqual(type, "QSet"))
|
||||||
@@ -2854,7 +2858,9 @@ void *qDumpObjectData440(
|
|||||||
"\""NS"QVariant\","
|
"\""NS"QVariant\","
|
||||||
"\""NS"QVector\","
|
"\""NS"QVector\","
|
||||||
"\""NS"QWeakPointer\","
|
"\""NS"QWeakPointer\","
|
||||||
|
#if USE_QT_GUI
|
||||||
"\""NS"QWidget\","
|
"\""NS"QWidget\","
|
||||||
|
#endif
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
"\"basic_string\","
|
"\"basic_string\","
|
||||||
"\"list\","
|
"\"list\","
|
||||||
@@ -2884,7 +2890,7 @@ void *qDumpObjectData440(
|
|||||||
<< ""NS"QString=\"" << sizeof(QString) << "\","
|
<< ""NS"QString=\"" << sizeof(QString) << "\","
|
||||||
<< ""NS"QStringList=\"" << sizeof(QStringList) << "\","
|
<< ""NS"QStringList=\"" << sizeof(QStringList) << "\","
|
||||||
<< ""NS"QObject=\"" << sizeof(QObject) << "\","
|
<< ""NS"QObject=\"" << sizeof(QObject) << "\","
|
||||||
#ifdef QT_GUI_LIB
|
#if USE_QT_GUI
|
||||||
<< ""NS"QWidget=\"" << sizeof(QWidget)<< "\","
|
<< ""NS"QWidget=\"" << sizeof(QWidget)<< "\","
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
|||||||
@@ -1,11 +1,20 @@
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
CONFIG += shared
|
CONFIG += shared
|
||||||
|
QT = core
|
||||||
linux-* {
|
linux-* {
|
||||||
CONFIG -= release
|
CONFIG -= release
|
||||||
CONFIG += debug
|
CONFIG += debug
|
||||||
}
|
}
|
||||||
SOURCES=gdbmacros.cpp
|
SOURCES=gdbmacros.cpp
|
||||||
|
|
||||||
|
true {
|
||||||
|
DEFINES += USE_QT_GUI=0
|
||||||
|
QT = core
|
||||||
|
} else {
|
||||||
|
DEFINES += USE_QT_GUI=1
|
||||||
|
QT = core gui
|
||||||
|
}
|
||||||
|
|
||||||
exists($$QMAKE_INCDIR_QT/QtCore/private/qobject_p.h) {
|
exists($$QMAKE_INCDIR_QT/QtCore/private/qobject_p.h) {
|
||||||
DEFINES+=HAS_QOBJECT_P_H
|
DEFINES+=HAS_QOBJECT_P_H
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -529,6 +529,47 @@ protected:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool visit(CastExpressionAST *ast)
|
||||||
|
{
|
||||||
|
if (ast->lparen_token && ast->type_id && ast->rparen_token && ast->expression) {
|
||||||
|
if (TypeIdAST *cast_type_id = ast->type_id->asTypeId()) {
|
||||||
|
SpecifierAST *type_specifier = cast_type_id->type_specifier;
|
||||||
|
if (! cast_type_id->declarator && type_specifier && ! type_specifier->next &&
|
||||||
|
type_specifier->asNamedTypeSpecifier() && ast->expression &&
|
||||||
|
ast->expression->asUnaryExpression()) {
|
||||||
|
// this ast node is ambigious, e.g.
|
||||||
|
// (a) + b
|
||||||
|
// it can be parsed as
|
||||||
|
// ((a) + b)
|
||||||
|
// or
|
||||||
|
// (a) (+b)
|
||||||
|
accept(ast->expression);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool visit(SizeofExpressionAST *ast)
|
||||||
|
{
|
||||||
|
if (ast->lparen_token && ast->expression && ast->rparen_token) {
|
||||||
|
if (TypeIdAST *type_id = ast->expression->asTypeId()) {
|
||||||
|
SpecifierAST *type_specifier = type_id->type_specifier;
|
||||||
|
if (! type_id->declarator && type_specifier && ! type_specifier->next &&
|
||||||
|
type_specifier->asNamedTypeSpecifier()) {
|
||||||
|
// this sizeof expression is ambiguos, e.g.
|
||||||
|
// sizeof (a)
|
||||||
|
// `a' can be a typeid or a nested-expression.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
LookupContext lookupContext(unsigned line, unsigned column) const;
|
LookupContext lookupContext(unsigned line, unsigned column) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public:
|
|||||||
DebuggerPane(QWidget *parent)
|
DebuggerPane(QWidget *parent)
|
||||||
: QPlainTextEdit(parent)
|
: QPlainTextEdit(parent)
|
||||||
{
|
{
|
||||||
|
setMaximumBlockCount(100000);
|
||||||
m_clearContentsAction = new QAction(this);
|
m_clearContentsAction = new QAction(this);
|
||||||
m_clearContentsAction->setText(tr("Clear contents"));
|
m_clearContentsAction->setText(tr("Clear contents"));
|
||||||
m_clearContentsAction->setEnabled(true);
|
m_clearContentsAction->setEnabled(true);
|
||||||
|
|||||||
@@ -14,5 +14,13 @@ CONFIG += debug
|
|||||||
QMAKE_CXXFLAGS *= -O2
|
QMAKE_CXXFLAGS *= -O2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
true {
|
||||||
|
DEFINES += USE_QT_GUI=0
|
||||||
|
QT = core
|
||||||
|
} else {
|
||||||
|
DEFINES += USE_QT_GUI=1
|
||||||
|
QT = core gui
|
||||||
|
}
|
||||||
|
|
||||||
SOURCES += ../../../share/qtcreator/gdbmacros/gdbmacros.cpp
|
SOURCES += ../../../share/qtcreator/gdbmacros/gdbmacros.cpp
|
||||||
|
|
||||||
|
|||||||
@@ -81,16 +81,16 @@ static int generationCounter = 0;
|
|||||||
class WatchItem : public WatchData
|
class WatchItem : public WatchData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WatchItem() { parent = 0; fetched = 0; }
|
WatchItem() { parent = 0; fetchedTriggered = 0; }
|
||||||
|
|
||||||
WatchItem(const WatchData &data) : WatchData(data)
|
WatchItem(const WatchData &data) : WatchData(data)
|
||||||
{ parent = 0; fetched = 0; }
|
{ parent = 0; fetchedTriggered = 0; }
|
||||||
|
|
||||||
void setData(const WatchData &data)
|
void setData(const WatchData &data)
|
||||||
{ static_cast<WatchData &>(*this) = data; }
|
{ static_cast<WatchData &>(*this) = data; }
|
||||||
|
|
||||||
WatchItem *parent;
|
WatchItem *parent;
|
||||||
bool fetched; // children fetch has been triggered
|
bool fetchedTriggered; // children fetch has been triggered
|
||||||
QList<WatchItem *> children; // fetched children
|
QList<WatchItem *> children; // fetched children
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -309,7 +309,7 @@ WatchModel::WatchModel(WatchHandler *handler, WatchType type)
|
|||||||
item->childCount = 1;
|
item->childCount = 1;
|
||||||
item->state = 0;
|
item->state = 0;
|
||||||
item->parent = m_root;
|
item->parent = m_root;
|
||||||
item->fetched = true;
|
item->fetchedTriggered = true;
|
||||||
|
|
||||||
m_root->children.append(item);
|
m_root->children.append(item);
|
||||||
}
|
}
|
||||||
@@ -501,14 +501,15 @@ static QString niceType(QString type)
|
|||||||
|
|
||||||
bool WatchModel::canFetchMore(const QModelIndex &index) const
|
bool WatchModel::canFetchMore(const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
return index.isValid() && !watchItem(index)->fetched;
|
return index.isValid() && !watchItem(index)->fetchedTriggered;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchModel::fetchMore(const QModelIndex &index)
|
void WatchModel::fetchMore(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(index.isValid(), return);
|
QTC_ASSERT(index.isValid(), return);
|
||||||
QTC_ASSERT(!watchItem(index)->fetched, return);
|
QTC_ASSERT(!watchItem(index)->fetchedTriggered, return);
|
||||||
if (WatchItem *item = watchItem(index)) {
|
if (WatchItem *item = watchItem(index)) {
|
||||||
|
item->fetchedTriggered = true;
|
||||||
WatchData data = *item;
|
WatchData data = *item;
|
||||||
data.setChildrenNeeded();
|
data.setChildrenNeeded();
|
||||||
emit m_handler->watchDataUpdateNeeded(data);
|
emit m_handler->watchDataUpdateNeeded(data);
|
||||||
|
|||||||
@@ -1980,7 +1980,9 @@ class CPLUSPLUS_EXPORT SizeofExpressionAST: public ExpressionAST
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
unsigned sizeof_token;
|
unsigned sizeof_token;
|
||||||
|
unsigned lparen_token;
|
||||||
ExpressionAST *expression;
|
ExpressionAST *expression;
|
||||||
|
unsigned rparen_token;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual SizeofExpressionAST *asSizeofExpression()
|
virtual SizeofExpressionAST *asSizeofExpression()
|
||||||
|
|||||||
@@ -3158,7 +3158,8 @@ bool Parser::parseUnaryExpression(ExpressionAST *&node)
|
|||||||
if (LA() == T_LPAREN) {
|
if (LA() == T_LPAREN) {
|
||||||
unsigned lparen_token = consumeToken();
|
unsigned lparen_token = consumeToken();
|
||||||
if (parseTypeId(ast->expression) && LA() == T_RPAREN) {
|
if (parseTypeId(ast->expression) && LA() == T_RPAREN) {
|
||||||
consumeToken();
|
ast->lparen_token = lparen_token;
|
||||||
|
ast->rparen_token = consumeToken();
|
||||||
node = ast;
|
node = ast;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user