forked from qt-creator/qt-creator
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
This commit is contained in:
@@ -529,6 +529,47 @@ protected:
|
||||
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;
|
||||
|
||||
private:
|
||||
|
||||
@@ -68,6 +68,7 @@ public:
|
||||
DebuggerPane(QWidget *parent)
|
||||
: QPlainTextEdit(parent)
|
||||
{
|
||||
setMaximumBlockCount(100000);
|
||||
m_clearContentsAction = new QAction(this);
|
||||
m_clearContentsAction->setText(tr("Clear contents"));
|
||||
m_clearContentsAction->setEnabled(true);
|
||||
|
||||
@@ -14,5 +14,13 @@ CONFIG += debug
|
||||
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
|
||||
|
||||
|
||||
@@ -81,16 +81,16 @@ static int generationCounter = 0;
|
||||
class WatchItem : public WatchData
|
||||
{
|
||||
public:
|
||||
WatchItem() { parent = 0; fetched = 0; }
|
||||
WatchItem() { parent = 0; fetchedTriggered = 0; }
|
||||
|
||||
WatchItem(const WatchData &data) : WatchData(data)
|
||||
{ parent = 0; fetched = 0; }
|
||||
{ parent = 0; fetchedTriggered = 0; }
|
||||
|
||||
void setData(const WatchData &data)
|
||||
{ static_cast<WatchData &>(*this) = data; }
|
||||
|
||||
WatchItem *parent;
|
||||
bool fetched; // children fetch has been triggered
|
||||
bool fetchedTriggered; // children fetch has been triggered
|
||||
QList<WatchItem *> children; // fetched children
|
||||
};
|
||||
|
||||
@@ -309,7 +309,7 @@ WatchModel::WatchModel(WatchHandler *handler, WatchType type)
|
||||
item->childCount = 1;
|
||||
item->state = 0;
|
||||
item->parent = m_root;
|
||||
item->fetched = true;
|
||||
item->fetchedTriggered = true;
|
||||
|
||||
m_root->children.append(item);
|
||||
}
|
||||
@@ -501,14 +501,15 @@ static QString niceType(QString type)
|
||||
|
||||
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)
|
||||
{
|
||||
QTC_ASSERT(index.isValid(), return);
|
||||
QTC_ASSERT(!watchItem(index)->fetched, return);
|
||||
QTC_ASSERT(!watchItem(index)->fetchedTriggered, return);
|
||||
if (WatchItem *item = watchItem(index)) {
|
||||
item->fetchedTriggered = true;
|
||||
WatchData data = *item;
|
||||
data.setChildrenNeeded();
|
||||
emit m_handler->watchDataUpdateNeeded(data);
|
||||
|
||||
Reference in New Issue
Block a user