Merge remote-tracking branch 'origin/2.5'

Conflicts:
	src/libs/qmljsdebugclient/qmlprofilereventlist.cpp
	src/libs/zeroconf/servicebrowser.cpp
	src/plugins/qmlprofiler/qml/MainView.qml
	src/plugins/qmlprofiler/qmlprofilerengine.cpp
	src/plugins/qmlprofiler/qmlprofilertool.cpp
	src/plugins/qmlprofiler/qmlprofilertraceview.h
	src/plugins/qmlprofiler/tracewindow.cpp

Change-Id: Ib5e7579efffe74f2bf6871690d1e398e1062f986
This commit is contained in:
Eike Ziller
2012-03-21 09:57:56 +01:00
42 changed files with 406 additions and 1265 deletions

3
dist/changes-2.5.0 vendored
View File

@@ -12,6 +12,8 @@ General
a located file (QTCREATORBUG-3805) a located file (QTCREATORBUG-3805)
* Add "Search Again" to recent searches (QTCREATORBUG-621) * Add "Search Again" to recent searches (QTCREATORBUG-621)
* Allow multiple parallel searches (QTCREATORBUG-6101) * Allow multiple parallel searches (QTCREATORBUG-6101)
* Add Execute filter to the locator, for executing external commands [by
Yuchen Deng]
Editing Editing
* Use the QML/JS editor for opening json files (QTCREATORBUG-4639) * Use the QML/JS editor for opening json files (QTCREATORBUG-4639)
@@ -60,6 +62,7 @@ Debugging
* Make entering commands in the log view more convenient * Make entering commands in the log view more convenient
* Re-enable debugging of Python scripts * Re-enable debugging of Python scripts
* Add pretty-printing for D arrays and strings * Add pretty-printing for D arrays and strings
* Add "Break on raise()" option for GDB/Windows
Debugging QML/JS Debugging QML/JS
* Relocate breakpoints to next executable code * Relocate breakpoints to next executable code

View File

@@ -10,9 +10,9 @@ HTML.postheader = \
" <div id=\"nav-topright\">\n" \ " <div id=\"nav-topright\">\n" \
" <ul>\n" \ " <ul>\n" \
" <li class=\"nav-topright-home\"><a href=\"http://qt.nokia.com/\">Qt HOME</a></li>\n" \ " <li class=\"nav-topright-home\"><a href=\"http://qt.nokia.com/\">Qt HOME</a></li>\n" \
" <li class=\"nav-topright-dev\"><a href=\"http://developer.qt.nokia.com/\">DEV</a></li>\n" \ " <li class=\"nav-topright-dev\"><a href=\"http://qt-project.org/\">DEV</a></li>\n" \
" <li class=\"nav-topright-labs\"><a href=\"http://labs.qt.nokia.com/blogs/\">LABS</a></li>\n" \ " <li class=\"nav-topright-labs\"><a href=\"http://labs.qt.nokia.com/blogs/\">LABS</a></li>\n" \
" <li class=\"nav-topright-doc nav-topright-doc-active\"><a href=\"http://doc.qt.nokia.com/\">\n" \ " <li class=\"nav-topright-doc nav-topright-doc-active\"><a href=\"http://qt-project.org/doc/\">\n" \
" DOC</a></li>\n" \ " DOC</a></li>\n" \
" <li class=\"nav-topright-blog\"><a href=\"http://blog.qt.nokia.com/\">BLOG</a></li>\n" \ " <li class=\"nav-topright-blog\"><a href=\"http://blog.qt.nokia.com/\">BLOG</a></li>\n" \
" </ul>\n" \ " </ul>\n" \
@@ -36,12 +36,12 @@ HTML.postheader = \
" API Lookup</h2>\n" \ " API Lookup</h2>\n" \
" <div id=\"list001\" class=\"list\">\n" \ " <div id=\"list001\" class=\"list\">\n" \
" <ul id=\"ul001\" >\n" \ " <ul id=\"ul001\" >\n" \
" <li><a href="http://doc.qt.nokia.com/4.7/classes.html">Class index</a></li>\n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/classes.html">Class index</a></li>\n" \
" <li><a href="http://doc.qt.nokia.com/4.7/functions.html">Function index</a></li>\n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/functions.html">Function index</a></li>\n" \
" <li><a href="http://doc.qt.nokia.com/4.7/modules.html">Modules</a></li>\n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/modules.html">Modules</a></li>\n" \
" <li><a href="http://doc.qt.nokia.com/4.7/namespaces.html">Namespaces</a></li>\n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/namespaces.html">Namespaces</a></li>\n" \
" <li><a href="http://doc.qt.nokia.com/4.7/qtglobal.html">Global Declarations</a></li>\n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/qtglobal.html">Global Declarations</a></li>\n" \
" <li><a href="http://doc.qt.nokia.com/4.7/qdeclarativeelements.html">QML elements</a></li>\n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/qdeclarativeelements.html">QML elements</a></li>\n" \
" </ul> \n" \ " </ul> \n" \
" </div>\n" \ " </div>\n" \
" </div>\n" \ " </div>\n" \
@@ -50,13 +50,13 @@ HTML.postheader = \
" Qt Topics</h2>\n" \ " Qt Topics</h2>\n" \
" <div id=\"list002\" class=\"list\">\n" \ " <div id=\"list002\" class=\"list\">\n" \
" <ul id=\"ul002\" >\n" \ " <ul id=\"ul002\" >\n" \
" <li><a href="http://doc.qt.nokia.com/4.7/qt-basic-concepts.html">Programming with Qt</a></li> \n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/qt-basic-concepts.html">Programming with Qt</a></li> \n" \
" <li><a href="http://doc.qt.nokia.com/4.7/qtquick.html">Device UIs &amp; Qt Quick</a></li> \n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/qtquick.html">Device UIs &amp; Qt Quick</a></li> \n" \
" <li><a href="http://doc.qt.nokia.com/4.7/qt-gui-concepts.html">UI Design with Qt</a></li> \n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/qt-gui-concepts.html">UI Design with Qt</a></li> \n" \
" <li><a href="http://doc.qt.nokia.com/4.7/developing-with-qt.html">Cross-platform and Platform-specific</a></li> \n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/developing-with-qt.html">Cross-platform and Platform-specific</a></li> \n" \
" <li><a href="http://doc.qt.nokia.com/4.7/platform-specific.html">Platform-specific info</a></li> \n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/platform-specific.html">Platform-specific info</a></li> \n" \
" <li><a href="http://doc.qt.nokia.com/4.7/technology-apis.html">Qt and Key Technologies</a></li> \n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/technology-apis.html">Qt and Key Technologies</a></li> \n" \
" <li><a href="http://doc.qt.nokia.com/4.7/best-practices.html">How-To's and Best Practices</a></li> \n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/best-practices.html">Best Practices</a></li> \n" \
" </ul> \n" \ " </ul> \n" \
" </div>\n" \ " </div>\n" \
" </div>\n" \ " </div>\n" \
@@ -65,10 +65,10 @@ HTML.postheader = \
" Examples</h2>\n" \ " Examples</h2>\n" \
" <div id=\"list003\" class=\"list\">\n" \ " <div id=\"list003\" class=\"list\">\n" \
" <ul id=\"ul003\">\n" \ " <ul id=\"ul003\">\n" \
" <li><a href="http://doc.qt.nokia.com/4.7/all-examples.html">Examples</a></li>\n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/all-examples.html">Examples</a></li>\n" \
" <li><a href="http://doc.qt.nokia.com/4.7/tutorials.html">Tutorials</a></li>\n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/tutorials.html">Tutorials</a></li>\n" \
" <li><a href="http://doc.qt.nokia.com/4.7/demos.html">Demos</a></li>\n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/demos.html">Demos</a></li>\n" \
" <li><a href="http://doc.qt.nokia.com/4.7/qdeclarativeexamples.html">QML Examples</a></li>\n" \ " <li><a href="http://qt-project.org/doc/qt-4.8/qdeclarativeexamples.html">QML Examples</a></li>\n" \
" </ul> \n" \ " </ul> \n" \
" </div>\n" \ " </div>\n" \
" </div>\n" \ " </div>\n" \

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 271 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 297 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -52,7 +52,9 @@
\c {\share\qtcreator\templates\wizards\listmodel\helloworld} and \c {\share\qtcreator\templates\wizards\listmodel\helloworld} and
\c {\share\qtcreator\templates\wizards\listmodel\listmodels} folders. After \c {\share\qtcreator\templates\wizards\listmodel\listmodels} folders. After
you restart \QC, the \gui {Custom Classes} you restart \QC, the \gui {Custom Classes}
and \gui {Custom Projects} categories appear in the \gui New dialog. and \gui {Custom Projects} categories (1) appear in the \gui New dialog. For
each category, an icon (2), a display name (3), and a description (4) are
displayed.
\image qtcreator-custom-project-wizards.png "The New dialog with custom projects and classes" \image qtcreator-custom-project-wizards.png "The New dialog with custom projects and classes"
@@ -163,14 +165,14 @@
\list \list
\o \c displayCategory appears in the \gui New dialog, under
\gui Projects.
\o \c icon appears next to the \c displayName. \o \c icon appears next to the \c displayName in the middle panel
when \c displayCategory is selected.
\o \c description appears at the bottom of the \gui New dialog when \o \c description appears in the right-most panel when
you select the display name. \c displayCategory is selected.
\o \c displayName appears in the \gui New dialog, under the
\c displayCategory.
You can add translations as values for the text elements. Specify the target You can add translations as values for the text elements. Specify the target
language as an attribute for the element. Use locale names (QLocale). language as an attribute for the element. Use locale names (QLocale).

View File

@@ -1785,7 +1785,7 @@ class Dumper:
if field.name.startswith("_vptr."): if field.name.startswith("_vptr."):
with SubItem(self, "[vptr]"): with SubItem(self, "[vptr]"):
# int (**)(void) # int (**)(void)
n = 20 n = 100
self.putType(" ") self.putType(" ")
self.putValue(value[field.name]) self.putValue(value[field.name])
self.putNumChild(n) self.putNumChild(n)

File diff suppressed because it is too large Load Diff

View File

@@ -85,7 +85,7 @@ Rectangle {
Rectangle { Rectangle {
visible: root.width > 1042 visible: root.width > 1042
width: 2 width: 2
color: "#919191" color: "#cdcdcd"
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
@@ -94,7 +94,7 @@ Rectangle {
Rectangle { Rectangle {
visible: root.width > 1042 visible: root.width > 1042
width: 2 width: 2
color: "#919191" color: "#cdcdcd"
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom

View File

@@ -1099,7 +1099,12 @@ void Bind::lambdaDeclarator(LambdaDeclaratorAST *ast)
return; return;
Function *fun = 0; // ### implement me Function *fun = control()->newFunction(0, 0);
fun->setStartOffset(tokenAt(ast->firstToken()).begin());
fun->setEndOffset(tokenAt(ast->lastToken() - 1).end());
if (ast->trailing_return_type)
_type = this->trailingReturnType(ast->trailing_return_type, _type);
fun->setReturnType(_type);
// unsigned lparen_token = ast->lparen_token; // unsigned lparen_token = ast->lparen_token;
FullySpecifiedType type; FullySpecifiedType type;
@@ -1110,7 +1115,6 @@ void Bind::lambdaDeclarator(LambdaDeclaratorAST *ast)
} }
// unsigned mutable_token = ast->mutable_token; // unsigned mutable_token = ast->mutable_token;
type = this->exceptionSpecification(ast->exception_specification, type); type = this->exceptionSpecification(ast->exception_specification, type);
type = this->trailingReturnType(ast->trailing_return_type, type);
} }
bool Bind::visit(TrailingReturnTypeAST *ast) bool Bind::visit(TrailingReturnTypeAST *ast)

View File

@@ -173,34 +173,34 @@ void CrumblePathButton::tintImages()
void CrumblePathButton::leaveEvent(QEvent *e) void CrumblePathButton::leaveEvent(QEvent *e)
{ {
QPushButton::leaveEvent(e);
m_isHovering = false; m_isHovering = false;
update(); update();
QPushButton::leaveEvent(e);
} }
void CrumblePathButton::mouseMoveEvent(QMouseEvent *e) void CrumblePathButton::mouseMoveEvent(QMouseEvent *e)
{ {
if (!isEnabled()) if (!isEnabled())
return; return;
QPushButton::mouseMoveEvent(e);
m_isHovering = true; m_isHovering = true;
update(); update();
QPushButton::mouseMoveEvent(e);
} }
void CrumblePathButton::mousePressEvent(QMouseEvent *e) void CrumblePathButton::mousePressEvent(QMouseEvent *e)
{ {
if (!isEnabled()) if (!isEnabled())
return; return;
QPushButton::mousePressEvent(e);
m_isPressed = true; m_isPressed = true;
update(); update();
QPushButton::mousePressEvent(e);
} }
void CrumblePathButton::mouseReleaseEvent(QMouseEvent *e) void CrumblePathButton::mouseReleaseEvent(QMouseEvent *e)
{ {
QPushButton::mouseReleaseEvent(e);
m_isPressed = false; m_isPressed = false;
update(); update();
QPushButton::mouseReleaseEvent(e);
} }
void CrumblePathButton::changeEvent(QEvent *e) void CrumblePathButton::changeEvent(QEvent *e)

View File

@@ -1283,7 +1283,7 @@ ServiceBrowserPrivate::ServiceBrowserPrivate(const QString &serviceType, const Q
bool requireAddresses, MainConnectionPtr mconn): bool requireAddresses, MainConnectionPtr mconn):
q(0), serviceType(serviceType), domain(domain), mainConnection(mconn), serviceConnection(0), flags(0), interfaceIndex(0), q(0), serviceType(serviceType), domain(domain), mainConnection(mconn), serviceConnection(0), flags(0), interfaceIndex(0),
delayDeletesUntil(std::numeric_limits<qint64>::min()), failed(false), browsing(false), delayDeletesUntil(std::numeric_limits<qint64>::min()), failed(false), browsing(false),
autoResolveAddresses(requireAddresses), requireAddresses(requireAddresses) autoResolveAddresses(requireAddresses), requireAddresses(requireAddresses), shouldRefresh(false)
{ {
} }
@@ -1567,6 +1567,7 @@ void MainConnection::stop(bool wait)
} }
MainConnection::MainConnection(): MainConnection::MainConnection():
flowStatus(NormalRFS),
lib(zeroConfLibInstance()->defaultLib()), m_lock(QMutex::Recursive), lib(zeroConfLibInstance()->defaultLib()), m_lock(QMutex::Recursive),
m_mainThreadLock(QMutex::Recursive), m_mainRef(0), m_failed(false), m_status(Starting), m_nErrs(0) m_mainThreadLock(QMutex::Recursive), m_mainRef(0), m_failed(false), m_status(Starting), m_nErrs(0)
{ {

View File

@@ -667,7 +667,8 @@ bool DocumentManager::saveDocument(IDocument *document, const QString &fileName,
} }
*isReadOnly = false; *isReadOnly = false;
} }
QMessageBox::critical(d->m_mainWindow, tr("File Error"), errorString); QMessageBox::critical(d->m_mainWindow, tr("File Error"),
tr("Error while saving file: %1").arg(errorString));
out: out:
ret = false; ret = false;
} }
@@ -992,7 +993,10 @@ void DocumentManager::checkForReload()
// check if IDocument wants us to ask // check if IDocument wants us to ask
if (document->reloadBehavior(trigger, type) == IDocument::BehaviorSilent) { if (document->reloadBehavior(trigger, type) == IDocument::BehaviorSilent) {
// content change or removed, IDocument wants silent handling // content change or removed, IDocument wants silent handling
success = document->reload(&errorString, IDocument::FlagReload, type); if (type == IDocument::TypeRemoved)
editorsToClose << EditorManager::instance()->editorsForDocument(document);
else
success = document->reload(&errorString, IDocument::FlagReload, type);
// IDocument wants us to ask // IDocument wants us to ask
} else if (type == IDocument::TypeContents) { } else if (type == IDocument::TypeContents) {
// content change, IDocument wants to ask user // content change, IDocument wants to ask user

View File

@@ -613,7 +613,7 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
LookupContext targetContext(targetFile->cppDocument(), snapshot); LookupContext targetContext(targetFile->cppDocument(), snapshot);
// sync return type // sync return type
{ do {
// set up for rewriting return type // set up for rewriting return type
SubstitutionEnvironment env; SubstitutionEnvironment env;
env.setContext(sourceContext); env.setContext(sourceContext);
@@ -637,6 +637,9 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
declarator = def->declarator; declarator = def->declarator;
firstReplaceableSpecifier = findFirstReplaceableSpecifier( firstReplaceableSpecifier = findFirstReplaceableSpecifier(
targetTranslationUnit, def->decl_specifier_list); targetTranslationUnit, def->decl_specifier_list);
} else {
// no proper AST to synchronize the return type
break;
} }
int returnTypeStart = 0; int returnTypeStart = 0;
@@ -653,7 +656,7 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
targetFile->startOf(targetFunctionDeclarator->lparen_token), targetFile->startOf(targetFunctionDeclarator->lparen_token),
replacement); replacement);
} }
} } while (false);
// sync parameters // sync parameters
{ {

View File

@@ -59,11 +59,14 @@ BaseWindow::BaseWindow(QWidget *parent)
setUniformRowHeights(true); setUniformRowHeights(true);
header()->setDefaultAlignment(Qt::AlignLeft); header()->setDefaultAlignment(Qt::AlignLeft);
header()->setClickable(true);
connect(act, SIGNAL(toggled(bool)), connect(act, SIGNAL(toggled(bool)),
SLOT(setAlternatingRowColorsHelper(bool))); SLOT(setAlternatingRowColorsHelper(bool)));
connect(this, SIGNAL(activated(QModelIndex)), connect(this, SIGNAL(activated(QModelIndex)),
SLOT(rowActivatedHelper(QModelIndex))); SLOT(rowActivatedHelper(QModelIndex)));
connect(header(), SIGNAL(sectionClicked(int)),
SLOT(headerSectionClicked(int)));
m_adjustColumnsAction = new QAction(tr("Adjust Column Widths to Contents"), 0); m_adjustColumnsAction = new QAction(tr("Adjust Column Widths to Contents"), 0);
m_alwaysAdjustColumnsAction = 0; m_alwaysAdjustColumnsAction = 0;
@@ -110,6 +113,13 @@ void BaseWindow::setModel(QAbstractItemModel *model)
setAlwaysResizeColumnsToContents(m_alwaysAdjustColumnsAction->isChecked()); setAlwaysResizeColumnsToContents(m_alwaysAdjustColumnsAction->isChecked());
} }
void BaseWindow::mousePressEvent(QMouseEvent *ev)
{
QTreeView::mousePressEvent(ev);
if (!indexAt(ev->pos()).isValid())
resizeColumnsToContents();
}
void BaseWindow::resizeColumnsToContents() void BaseWindow::resizeColumnsToContents()
{ {
const int columnCount = model()->columnCount(); const int columnCount = model()->columnCount();
@@ -124,6 +134,11 @@ void BaseWindow::setAlwaysResizeColumnsToContents(bool on)
header()->setResizeMode(0, mode); header()->setResizeMode(0, mode);
} }
void BaseWindow::headerSectionClicked(int logicalIndex)
{
resizeColumnToContents(logicalIndex);
}
void BaseWindow::reset() void BaseWindow::reset()
{ {
QTreeView::reset(); QTreeView::reset();

View File

@@ -51,6 +51,7 @@ public:
void setModel(QAbstractItemModel *model); void setModel(QAbstractItemModel *model);
virtual void rowActivated(const QModelIndex &) {} virtual void rowActivated(const QModelIndex &) {}
void mousePressEvent(QMouseEvent *ev);
public slots: public slots:
void resizeColumnsToContents(); void resizeColumnsToContents();
@@ -59,6 +60,7 @@ public slots:
private slots: private slots:
void setAlternatingRowColorsHelper(bool on) { setAlternatingRowColors(on); } void setAlternatingRowColorsHelper(bool on) { setAlternatingRowColors(on); }
void rowActivatedHelper(const QModelIndex &index) { rowActivated(index); } void rowActivatedHelper(const QModelIndex &index) { rowActivated(index); }
void headerSectionClicked(int logicalIndex);
void reset(); void reset();
private: private:

View File

@@ -604,10 +604,15 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
//|| data.type == BreakpointAtVFork //|| data.type == BreakpointAtVFork
|| data.type == BreakpointAtSysCall) || data.type == BreakpointAtSysCall)
return typeToString(data.type); return typeToString(data.type);
if (data.type == WatchpointAtAddress) if (data.type == WatchpointAtAddress) {
return tr("Data at 0x%1").arg(data.address, 0, 16); quint64 address = response.address ? response.address : data.address;
if (data.type == WatchpointAtExpression) return tr("Data at 0x%1").arg(address, 0, 16);
return tr("Data at %1").arg(data.expression); }
if (data.type == WatchpointAtExpression) {
QString expression = !response.expression.isEmpty()
? response.expression : data.expression;
return tr("Data at %1").arg(expression);
}
return empty; return empty;
} }
break; break;
@@ -1052,11 +1057,14 @@ void BreakHandler::appendBreakpoint(const BreakpointParameters &data)
scheduleSynchronization(); scheduleSynchronization();
} }
void BreakHandler::handleAlienBreakpoint(BreakpointModelId id, void BreakHandler::handleAlienBreakpoint(const BreakpointResponse &response, DebuggerEngine *engine)
const BreakpointResponse &response, DebuggerEngine *engine)
{ {
if (response.id.isMinor()) { BreakpointModelId id = findSimilarBreakpoint(response);
insertSubBreakpoint(id, response); if (id.isValid()) {
if (response.id.isMinor())
insertSubBreakpoint(id, response);
else
setResponse(id, response);
} else { } else {
BreakpointModelId id(++currentId); BreakpointModelId id(++currentId);
const int row = m_storage.size(); const int row = m_storage.size();
@@ -1066,10 +1074,6 @@ void BreakHandler::handleAlienBreakpoint(BreakpointModelId id,
endInsertRows(); endInsertRows();
it->data = response; it->data = response;
it->data.type = BreakpointByFileAndLine;
it->data.functionName.clear();
it->data.address = 0;
it->response = response; it->response = response;
it->state = BreakpointInserted; it->state = BreakpointInserted;
it->engine = engine; it->engine = engine;

View File

@@ -70,8 +70,7 @@ public:
// The only way to add a new breakpoint. // The only way to add a new breakpoint.
void appendBreakpoint(const BreakpointParameters &data); void appendBreakpoint(const BreakpointParameters &data);
void handleAlienBreakpoint(BreakpointModelId id, void handleAlienBreakpoint(const BreakpointResponse &response, DebuggerEngine *engine);
const BreakpointResponse &response, DebuggerEngine *engine);
void insertSubBreakpoint(BreakpointModelId id, const BreakpointResponse &data); void insertSubBreakpoint(BreakpointModelId id, const BreakpointResponse &data);
void removeAlienBreakpoint(BreakpointModelId id); void removeAlienBreakpoint(BreakpointModelId id);

View File

@@ -1919,7 +1919,7 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
// Handle non-existing breakpoint. // Handle non-existing breakpoint.
const QString text = args.address const QString text = args.address
? tr("Set Breakpoint at 0x%1").arg(args.address, 0, 16) ? tr("Set Breakpoint at 0x%1").arg(args.address, 0, 16)
: tr("Set Breakpoint at line %1").arg(lineNumber); : tr("Set Breakpoint at Line %1").arg(lineNumber);
QAction *act = new QAction(text, menu); QAction *act = new QAction(text, menu);
act->setData(QVariant::fromValue(args)); act->setData(QVariant::fromValue(args));
act->setEnabled(contextUsable); act->setEnabled(contextUsable);
@@ -1930,7 +1930,7 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
args.mode = BreakpointMenuContextData::MessageTracePoint; args.mode = BreakpointMenuContextData::MessageTracePoint;
const QString tracePointText = args.address const QString tracePointText = args.address
? tr("Set Message Tracepoint at 0x%1...").arg(args.address, 0, 16) ? tr("Set Message Tracepoint at 0x%1...").arg(args.address, 0, 16)
: tr("Set Message Tracepoint at line %1...").arg(lineNumber); : tr("Set Message Tracepoint at Line %1...").arg(lineNumber);
act = new QAction(tracePointText, menu); act = new QAction(tracePointText, menu);
act->setData(QVariant::fromValue(args)); act->setData(QVariant::fromValue(args));
act->setEnabled(contextUsable); act->setEnabled(contextUsable);
@@ -1966,7 +1966,8 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
frame.function = cppFunctionAt(fileName, lineNumber); frame.function = cppFunctionAt(fileName, lineNumber);
frame.line = 42; // trick gdb into mixed mode. frame.line = 42; // trick gdb into mixed mode.
if (!frame.function.isEmpty()) { if (!frame.function.isEmpty()) {
const QString text = tr("Disassemble '%1()'").arg(frame.function); const QString text = tr("Disassemble Function \"%1\"")
.arg(frame.function);
QAction *disassembleAction = new QAction(text, menu); QAction *disassembleAction = new QAction(text, menu);
disassembleAction->setData(QVariant::fromValue(frame)); disassembleAction->setData(QVariant::fromValue(frame));
connect(disassembleAction, SIGNAL(triggered()), SLOT(slotDisassembleFunction())); connect(disassembleAction, SIGNAL(triggered()), SLOT(slotDisassembleFunction()));

View File

@@ -747,6 +747,7 @@ DEBUGGER_EXPORT ConfigurationCheck checkDebugConfiguration(const DebuggerStartPa
QList<DebuggerEngineType> unavailableTypes; QList<DebuggerEngineType> unavailableTypes;
foreach (DebuggerEngineType et, requiredTypes) { foreach (DebuggerEngineType et, requiredTypes) {
if (canUseEngine(et, sp, cmdLineEnabledEngines, &result)) { if (canUseEngine(et, sp, cmdLineEnabledEngines, &result)) {
result.errorDetails.clear();
usableType = et; usableType = et;
break; break;
} else { } else {

View File

@@ -518,13 +518,15 @@ void GdbEngine::handleResponse(const QByteArray &buff)
} else if (asyncClass == "breakpoint-created") { } else if (asyncClass == "breakpoint-created") {
// "{bkpt={number="1",type="breakpoint",disp="del",enabled="y", // "{bkpt={number="1",type="breakpoint",disp="del",enabled="y",
// addr="<PENDING>",pending="main",times="0", // addr="<PENDING>",pending="main",times="0",
//original-location="main"}}" // original-location="main"}}" -- or --
// {bkpt={number="2",type="hw watchpoint",disp="keep",enabled="y",
// what="*0xbfffed48",times="0",original-location="*0xbfffed48"
BreakHandler *handler = breakHandler(); BreakHandler *handler = breakHandler();
foreach (const GdbMi &bkpt, result.children()) { foreach (const GdbMi &bkpt, result.children()) {
BreakpointResponse br; BreakpointResponse br;
br.type = BreakpointByFileAndLine;
updateResponse(br, bkpt); updateResponse(br, bkpt);
BreakpointModelId id = handler->findBreakpointByResponseId(br.id); handler->handleAlienBreakpoint(br, this);
handler->handleAlienBreakpoint(id, br, this);
} }
} else if (asyncClass == "breakpoint-deleted") { } else if (asyncClass == "breakpoint-deleted") {
// "breakpoint-deleted" "{id="1"}" // "breakpoint-deleted" "{id="1"}"
@@ -2380,11 +2382,21 @@ void GdbEngine::updateResponse(BreakpointResponse &response, const GdbMi &bkpt)
} else if (child.hasName("thread")) { } else if (child.hasName("thread")) {
response.threadSpec = child.data().toInt(); response.threadSpec = child.data().toInt();
} else if (child.hasName("type")) { } else if (child.hasName("type")) {
// "breakpoint", "hw breakpoint", "tracepoint" // "breakpoint", "hw breakpoint", "tracepoint", "hw watchpoint"
if (child.data().contains("tracepoint")) // {bkpt={number="2",type="hw watchpoint",disp="keep",enabled="y",
// what="*0xbfffed48",times="0",original-location="*0xbfffed48"
if (child.data().contains("tracepoint")) {
response.tracepoint = true; response.tracepoint = true;
else if (!child.data().contains("reakpoint")) } else if (child.data() == "hw watchpoint" || child.data() == "watchpoint") {
response.type = WatchpointAtAddress; QByteArray what = bkpt.findChild("what").data();
if (what.startsWith("*0x")) {
response.type = WatchpointAtAddress;
response.address = what.mid(1).toULongLong(0, 0);
} else {
response.type = WatchpointAtExpression;
response.expression = QString::fromLocal8Bit(what);
}
}
} else if (child.hasName("original-location")) { } else if (child.hasName("original-location")) {
originalLocation = child.data(); originalLocation = child.data();
} }
@@ -3140,10 +3152,10 @@ void GdbEngine::removeBreakpoint(BreakpointModelId id)
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
void GdbEngine::loadSymbols(const QString &moduleName) void GdbEngine::loadSymbols(const QString &modulePath)
{ {
// FIXME: gdb does not understand quoted names here (tested with 6.8) // FIXME: gdb does not understand quoted names here (tested with 6.8)
postCommand("sharedlibrary " + dotEscape(moduleName.toLocal8Bit())); postCommand("sharedlibrary " + dotEscape(modulePath.toLocal8Bit()));
reloadModulesInternal(); reloadModulesInternal();
reloadBreakListInternal(); reloadBreakListInternal();
reloadStack(true); reloadStack(true);
@@ -3170,7 +3182,7 @@ void GdbEngine::loadSymbolsForStack()
if (module.startAddress <= frame.address if (module.startAddress <= frame.address
&& frame.address < module.endAddress) { && frame.address < module.endAddress) {
postCommand("sharedlibrary " postCommand("sharedlibrary "
+ dotEscape(module.moduleName.toLocal8Bit())); + dotEscape(module.modulePath.toLocal8Bit()));
needUpdate = true; needUpdate = true;
} }
} }
@@ -3184,7 +3196,7 @@ void GdbEngine::loadSymbolsForStack()
} }
} }
void GdbEngine::requestModuleSymbols(const QString &moduleName) void GdbEngine::requestModuleSymbols(const QString &modulePath)
{ {
QTemporaryFile tf(QDir::tempPath() + _("/gdbsymbols")); QTemporaryFile tf(QDir::tempPath() + _("/gdbsymbols"));
if (!tf.open()) if (!tf.open())
@@ -3192,15 +3204,15 @@ void GdbEngine::requestModuleSymbols(const QString &moduleName)
QString fileName = tf.fileName(); QString fileName = tf.fileName();
tf.close(); tf.close();
postCommand("maint print msymbols " + fileName.toLocal8Bit() postCommand("maint print msymbols " + fileName.toLocal8Bit()
+ ' ' + moduleName.toLocal8Bit(), + ' ' + modulePath.toLocal8Bit(),
NeedsStop, CB(handleShowModuleSymbols), NeedsStop, CB(handleShowModuleSymbols),
QVariant(moduleName + QLatin1Char('@') + fileName)); QVariant(modulePath + QLatin1Char('@') + fileName));
} }
void GdbEngine::handleShowModuleSymbols(const GdbResponse &response) void GdbEngine::handleShowModuleSymbols(const GdbResponse &response)
{ {
const QString cookie = response.cookie.toString(); const QString cookie = response.cookie.toString();
const QString moduleName = cookie.section(QLatin1Char('@'), 0, 0); const QString modulePath = cookie.section(QLatin1Char('@'), 0, 0);
const QString fileName = cookie.section(QLatin1Char('@'), 1, 1); const QString fileName = cookie.section(QLatin1Char('@'), 1, 1);
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
Symbols rc; Symbols rc;
@@ -3251,7 +3263,7 @@ void GdbEngine::handleShowModuleSymbols(const GdbResponse &response)
} }
file.close(); file.close();
file.remove(); file.remove();
debuggerCore()->showModuleSymbols(moduleName, rc); debuggerCore()->showModuleSymbols(modulePath, rc);
} else { } else {
showMessageBox(QMessageBox::Critical, tr("Cannot Read Symbols"), showMessageBox(QMessageBox::Critical, tr("Cannot Read Symbols"),
tr("Cannot read symbols for module \"%1\".").arg(fileName)); tr("Cannot read symbols for module \"%1\".").arg(fileName));
@@ -3270,6 +3282,11 @@ void GdbEngine::reloadModulesInternal()
postCommand("info shared", NeedsStop, CB(handleModulesList)); postCommand("info shared", NeedsStop, CB(handleModulesList));
} }
static QString nameFromPath(const QString &path)
{
return QFileInfo(path).baseName();
}
void GdbEngine::handleModulesList(const GdbResponse &response) void GdbEngine::handleModulesList(const GdbResponse &response)
{ {
Modules modules; Modules modules;
@@ -3285,7 +3302,8 @@ void GdbEngine::handleModulesList(const GdbResponse &response)
QTextStream ts(&line, QIODevice::ReadOnly); QTextStream ts(&line, QIODevice::ReadOnly);
if (line.startsWith(QLatin1String("0x"))) { if (line.startsWith(QLatin1String("0x"))) {
ts >> module.startAddress >> module.endAddress >> symbolsRead; ts >> module.startAddress >> module.endAddress >> symbolsRead;
module.moduleName = ts.readLine().trimmed(); module.modulePath = ts.readLine().trimmed();
module.moduleName = nameFromPath(module.modulePath);
module.symbolsRead = module.symbolsRead =
(symbolsRead == QLatin1String("Yes") ? Module::ReadOk : Module::ReadFailed); (symbolsRead == QLatin1String("Yes") ? Module::ReadOk : Module::ReadFailed);
modules.append(module); modules.append(module);
@@ -3295,7 +3313,8 @@ void GdbEngine::handleModulesList(const GdbResponse &response)
QTC_ASSERT(symbolsRead == QLatin1String("No"), continue); QTC_ASSERT(symbolsRead == QLatin1String("No"), continue);
module.startAddress = 0; module.startAddress = 0;
module.endAddress = 0; module.endAddress = 0;
module.moduleName = ts.readLine().trimmed(); module.modulePath = ts.readLine().trimmed();
module.moduleName = nameFromPath(module.modulePath);
modules.append(module); modules.append(module);
} }
} }
@@ -3307,8 +3326,9 @@ void GdbEngine::handleModulesList(const GdbResponse &response)
// shlib-info={...}... // shlib-info={...}...
foreach (const GdbMi &item, response.data.children()) { foreach (const GdbMi &item, response.data.children()) {
Module module; Module module;
module.moduleName = module.modulePath =
QString::fromLocal8Bit(item.findChild("path").data()); QString::fromLocal8Bit(item.findChild("path").data());
module.moduleName = nameFromPath(module.modulePath);
module.symbolsRead = (item.findChild("state").data() == "Y") module.symbolsRead = (item.findChild("state").data() == "Y")
? Module::ReadOk : Module::ReadFailed; ? Module::ReadOk : Module::ReadFailed;
module.startAddress = module.startAddress =
@@ -3327,8 +3347,8 @@ void GdbEngine::examineModules()
foreach (Module module, modulesHandler()->modules()) { foreach (Module module, modulesHandler()->modules()) {
if (module.symbolsType == Module::UnknownType) { if (module.symbolsType == Module::UnknownType) {
QProcess proc; QProcess proc;
qDebug() << _("objdump -h \"%1\"").arg(module.moduleName); qDebug() << _("objdump -h \"%1\"").arg(module.modulePath);
proc.start(_("objdump -h \"%1\"").arg(module.moduleName)); proc.start(_("objdump -h \"%1\"").arg(module.modulePath));
if (!proc.waitForStarted()) if (!proc.waitForStarted())
continue; continue;
if (!proc.waitForFinished()) if (!proc.waitForFinished())
@@ -3338,7 +3358,7 @@ void GdbEngine::examineModules()
module.symbolsType = Module::FastSymbols; module.symbolsType = Module::FastSymbols;
else else
module.symbolsType = Module::PlainSymbols; module.symbolsType = Module::PlainSymbols;
modulesHandler()->updateModule(module.moduleName, module); modulesHandler()->updateModule(module.modulePath, module);
} }
} }
} }

View File

@@ -72,7 +72,8 @@ void ModulesWindow::moduleActivated(const QModelIndex &index)
{ {
DebuggerEngine *engine = debuggerCore()->currentEngine(); DebuggerEngine *engine = debuggerCore()->currentEngine();
QTC_ASSERT(engine, return); QTC_ASSERT(engine, return);
engine->gotoLocation(index.data().toString()); if (index.isValid())
engine->gotoLocation(index.sibling(index.row(), 1).data().toString());
} }
void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev) void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
@@ -156,17 +157,17 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
if (act == actUpdateModuleList) if (act == actUpdateModuleList)
engine->reloadModules(); engine->reloadModules();
else if (act == actShowModuleSources) else if (act == actShowModuleSources)
engine->loadSymbols(name); engine->loadSymbols(fileName);
else if (act == actLoadSymbolsForAllModules) else if (act == actLoadSymbolsForAllModules)
engine->loadAllSymbols(); engine->loadAllSymbols();
else if (act == actExamineAllModules) else if (act == actExamineAllModules)
engine->examineModules(); engine->examineModules();
else if (act == actLoadSymbolsForModule) else if (act == actLoadSymbolsForModule)
engine->loadSymbols(name); engine->loadSymbols(fileName);
else if (act == actEditFile) else if (act == actEditFile)
engine->gotoLocation(name); engine->gotoLocation(fileName);
else if (act == actShowModuleSymbols) else if (act == actShowModuleSymbols)
engine->requestModuleSymbols(name); engine->requestModuleSymbols(fileName);
else if (actShowDependencies && act == actShowDependencies) else if (actShowDependencies && act == actShowDependencies)
QProcess::startDetached(QLatin1String("depends"), QStringList(fileName)); QProcess::startDetached(QLatin1String("depends"), QStringList(fileName));
else else

View File

@@ -364,7 +364,10 @@ QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters,
SLOT(documentUpdated(QmlJS::Document::Ptr))); SLOT(documentUpdated(QmlJS::Document::Ptr)));
// we won't get any debug output // we won't get any debug output
d->m_retryOnConnectFail = startParameters.useTerminal; if (startParameters.useTerminal) {
d->m_noDebugOutputTimer.setInterval(0);
d->m_retryOnConnectFail = true;
}
} }
QmlEngine::~QmlEngine() QmlEngine::~QmlEngine()
@@ -416,6 +419,7 @@ void QmlEngine::connectionEstablished()
void QmlEngine::tryToConnect(quint16 port) void QmlEngine::tryToConnect(quint16 port)
{ {
showMessage(QLatin1String("QML Debugger: No application output received in time, trying to connect ..."), LogStatus);
d->m_retryOnConnectFail = true; d->m_retryOnConnectFail = true;
beginConnection(port); beginConnection(port);
} }
@@ -447,15 +451,9 @@ void QmlEngine::beginConnection(quint16 port)
void QmlEngine::connectionStartupFailed() void QmlEngine::connectionStartupFailed()
{ {
if (isSlaveEngine()) {
if (masterEngine()->state() != InferiorRunOk) {
// we're right now debugging C++, just try longer ...
beginConnection();
return;
}
}
if (d->m_retryOnConnectFail) { if (d->m_retryOnConnectFail) {
beginConnection(); // retry after 3 seconds ...
QTimer::singleShot(3000, this, SLOT(beginConnection()));
return; return;
} }

View File

@@ -1833,6 +1833,8 @@ void WatchHandler::showInEditorHelper(QString *contents, WatchItem *item, int de
contents->append(item->name); contents->append(item->name);
contents->append(tab); contents->append(tab);
contents->append(item->value); contents->append(item->value);
contents->append(tab);
contents->append(item->type);
contents->append(nl); contents->append(nl);
foreach (WatchItem *child, item->children) foreach (WatchItem *child, item->children)
showInEditorHelper(contents, child, depth + 1); showInEditorHelper(contents, child, depth + 1);

View File

@@ -153,8 +153,33 @@ void SearchWidget::showEvent(QShowEvent *event)
void SearchWidget::search() const void SearchWidget::search() const
{ {
QList<QHelpSearchQuery> query = searchEngine->queryWidget()->query(); static QStringList charsToEscapeList;
searchEngine->search(query); if (charsToEscapeList.isEmpty()) {
charsToEscapeList << QLatin1String("\\") << QLatin1String("+")
<< QLatin1String("-") << QLatin1String("!") << QLatin1String("(")
<< QLatin1String(")") << QLatin1String(":") << QLatin1String("^")
<< QLatin1String("[") << QLatin1String("]") << QLatin1String("{")
<< QLatin1String("}") << QLatin1String("~");
}
static QString escapeChar(QLatin1String("\\"));
static QRegExp regExp(QLatin1String("[\\+\\-\\!\\(\\)\\^\\[\\]\\{\\}~:]"));
QList<QHelpSearchQuery> escapedQueries;
const QList<QHelpSearchQuery> queries = searchEngine->queryWidget()->query();
foreach (const QHelpSearchQuery &query, queries) {
QHelpSearchQuery escapedQuery;
escapedQuery.fieldName = query.fieldName;
foreach (QString word, query.wordList) {
if (word.contains(regExp)) {
foreach (const QString &charToEscape, charsToEscapeList)
word.replace(charToEscape, escapeChar + charToEscape);
}
escapedQuery.wordList.append(word);
}
escapedQueries.append(escapedQuery);
}
searchEngine->search(escapedQueries);
} }
void SearchWidget::searchingStarted() void SearchWidget::searchingStarted()

View File

@@ -65,6 +65,15 @@ ImageViewerFile::~ImageViewerFile()
delete d; delete d;
} }
Core::IDocument::ReloadBehavior ImageViewerFile::reloadBehavior(ChangeTrigger state, ChangeType type) const
{
if (type == TypeRemoved || type == TypePermissions)
return BehaviorSilent;
if (type == TypeContents && state == TriggerInternal && !isModified())
return BehaviorSilent;
return BehaviorAsk;
}
bool ImageViewerFile::reload(QString *errorString, bool ImageViewerFile::reload(QString *errorString,
Core::IDocument::ReloadFlag flag, Core::IDocument::ReloadFlag flag,
Core::IDocument::ChangeType type) Core::IDocument::ChangeType type)

View File

@@ -61,6 +61,7 @@ public:
bool isModified() const; bool isModified() const;
bool isSaveAsAllowed() const; bool isSaveAsAllowed() const;
virtual ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
bool reload(QString *errorString, ReloadFlag flag, ChangeType type); bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
void setMimetype(const QString &mimetype); void setMimetype(const QString &mimetype);

View File

@@ -281,6 +281,7 @@ TaskWindow::TaskWindow(TaskHub *taskhub) : d(new TaskWindowPrivate)
d->m_categoriesButton = new QToolButton; d->m_categoriesButton = new QToolButton;
d->m_categoriesButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_FILTER))); d->m_categoriesButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_FILTER)));
d->m_categoriesButton->setToolTip(tr("Filter by categories")); d->m_categoriesButton->setToolTip(tr("Filter by categories"));
d->m_categoriesButton->setProperty("noArrow", true);
d->m_categoriesButton->setAutoRaise(true); d->m_categoriesButton->setAutoRaise(true);
d->m_categoriesButton->setPopupMode(QToolButton::InstantPopup); d->m_categoriesButton->setPopupMode(QToolButton::InstantPopup);

View File

@@ -224,7 +224,6 @@ void PropertyEditor::NodeType::setup(const QmlObjectNode &fxObjectNode, const QS
m_contextObject->setSpecificsUrl(qmlSpecificsFile); m_contextObject->setSpecificsUrl(qmlSpecificsFile);
m_contextObject->setStateName(stateName); m_contextObject->setStateName(stateName);
QApplication::processEvents();
if (!fxObjectNode.isValid()) if (!fxObjectNode.isValid())
return; return;
ctxt->setContextProperty("propertyCount", QVariant(fxObjectNode.modelNode().properties().count())); ctxt->setContextProperty("propertyCount", QVariant(fxObjectNode.modelNode().properties().count()));

View File

@@ -130,7 +130,7 @@ void QmlProject::parseProject(RefreshOptions options)
messageManager->printToOutputPane( messageManager->printToOutputPane(
tr("Warning while loading project file %1.").arg(m_fileName)); tr("Warning while loading project file %1.").arg(m_fileName));
messageManager->printToOutputPane( messageManager->printToOutputPane(
tr("File '%' does not exist or is not readable.").arg(mainFilePath), true); tr("File '%1' does not exist or is not readable.").arg(mainFilePath), true);
} }
} }
} }

View File

@@ -101,18 +101,18 @@ void QmlProjectPlugin::extensionsInitialized()
void QmlProjectPlugin::showQmlObserverToolWarning() void QmlProjectPlugin::showQmlObserverToolWarning()
{ {
QMessageBox dialog(QApplication::activeWindow()); QMessageBox dialog(QApplication::activeWindow());
QPushButton *qtPref = dialog.addButton(tr("Open Qt4 Options"), QPushButton *qtPref = dialog.addButton(tr("Open Qt Versions"),
QMessageBox::ActionRole); QMessageBox::ActionRole);
dialog.addButton(QMessageBox::Cancel); dialog.addButton(QMessageBox::Cancel);
dialog.setDefaultButton(qtPref); dialog.setDefaultButton(qtPref);
dialog.setWindowTitle(tr("QML Observer Missing")); dialog.setWindowTitle(tr("QML Observer Missing"));
dialog.setText(tr("QML Observer could not be found.")); dialog.setText(tr("QML Observer could not be found for this Qt version."));
dialog.setInformativeText(tr( dialog.setInformativeText(tr(
"QML Observer is used to offer debugging features for " "QML Observer is used to offer debugging features for "
"QML applications, such as interactive debugging and inspection tools. " "Qt Quick UI projects in the Qt 4.7 series.\n\n"
"It must be compiled for each used Qt version separately. " "To compile QML Observer, go to the Qt Versions page, "
"On the Qt4 options page, select the current Qt installation " "select the current Qt version, "
"and click Rebuild.")); "and click Build in the Helpers section."));
dialog.exec(); dialog.exec();
if (dialog.clickedButton() == qtPref) { if (dialog.clickedButton() == qtPref) {
Core::ICore::showOptionsDialog( Core::ICore::showOptionsDialog(

View File

@@ -6489,10 +6489,11 @@ void BaseTextEditorWidget::inSnippetMode(bool *active)
void BaseTextEditorWidget::invokeAssist(AssistKind kind, IAssistProvider *provider) void BaseTextEditorWidget::invokeAssist(AssistKind kind, IAssistProvider *provider)
{ {
if (overwriteMode()) bool previousMode = overwriteMode();
return; setOverwriteMode(false);
ensureCursorVisible(); ensureCursorVisible();
d->m_codeAssistant->invoke(kind, provider); d->m_codeAssistant->invoke(kind, provider);
setOverwriteMode(previousMode);
} }
IAssistInterface *BaseTextEditorWidget::createAssistInterface(AssistKind kind, IAssistInterface *BaseTextEditorWidget::createAssistInterface(AssistKind kind,

View File

@@ -52,6 +52,9 @@
#include <Names.h> #include <Names.h>
//TESTED_COMPONENT=src/libs/cplusplus //TESTED_COMPONENT=src/libs/cplusplus
#define NO_PARSER_OR_SEMANTIC_ERROR_MESSAGES
using namespace CPlusPlus; using namespace CPlusPlus;
class tst_Semantic: public QObject class tst_Semantic: public QObject
@@ -68,13 +71,15 @@ public:
TranslationUnit *parse(const QByteArray &source, TranslationUnit *parse(const QByteArray &source,
TranslationUnit::ParseMode mode, TranslationUnit::ParseMode mode,
bool enableObjc, bool enableObjc,
bool qtMocRun) bool qtMocRun,
bool enableCxx11)
{ {
const StringLiteral *fileId = control->stringLiteral("<stdin>"); const StringLiteral *fileId = control->stringLiteral("<stdin>");
TranslationUnit *unit = new TranslationUnit(control.data(), fileId); TranslationUnit *unit = new TranslationUnit(control.data(), fileId);
unit->setSource(source.constData(), source.length()); unit->setSource(source.constData(), source.length());
unit->setObjCEnabled(enableObjc); unit->setObjCEnabled(enableObjc);
unit->setQtMocRunEnabled(qtMocRun); unit->setQtMocRunEnabled(qtMocRun);
unit->setCxxOxEnabled(enableCxx11);
unit->parse(mode); unit->parse(mode);
return unit; return unit;
} }
@@ -84,7 +89,9 @@ public:
public: public:
Document(TranslationUnit *unit) Document(TranslationUnit *unit)
: unit(unit), globals(unit->control()->newNamespace(0, 0)), errorCount(0) : unit(unit)
, globals(unit->control()->newNamespace(0, 0))
, errorCount(0)
{ } { }
~Document() ~Document()
@@ -114,23 +121,31 @@ public:
{ } { }
virtual void report(int /*level*/, virtual void report(int /*level*/,
const StringLiteral * /*fileName*/, const StringLiteral *fileName,
unsigned /*line*/, unsigned /*column*/, unsigned line, unsigned column,
const char * /*format*/, va_list /*ap*/) const char *format, va_list ap)
{ {
++errorCount; ++errorCount;
// qDebug() << fileName->chars()<<':'<<line<<':'<<column<<' '<<QString().vsprintf(format, ap); #ifndef NO_PARSER_OR_SEMANTIC_ERROR_MESSAGES
qDebug() << fileName->chars()<<':'<<line<<':'<<column<<' '<<QString().vsprintf(format, ap);
#else
Q_UNUSED(fileName);
Q_UNUSED(line);
Q_UNUSED(column);
Q_UNUSED(format);
Q_UNUSED(ap);
#endif
} }
}; };
Diagnostic diag; Diagnostic diag;
QSharedPointer<Document> document(const QByteArray &source, bool enableObjc = false, bool qtMocRun = false) QSharedPointer<Document> document(const QByteArray &source, bool enableObjc = false, bool qtMocRun = false, bool enableCxx11 = false)
{ {
diag.errorCount = 0; // reset the error count. diag.errorCount = 0; // reset the error count.
TranslationUnit *unit = parse(source, TranslationUnit::ParseTranlationUnit, enableObjc, qtMocRun); TranslationUnit *unit = parse(source, TranslationUnit::ParseTranlationUnit, enableObjc, qtMocRun, enableCxx11);
QSharedPointer<Document> doc(new Document(unit)); QSharedPointer<Document> doc(new Document(unit));
doc->check(); doc->check();
doc->errorCount = diag.errorCount; doc->errorCount = diag.errorCount;
@@ -164,6 +179,8 @@ private slots:
void q_enum_1(); void q_enum_1();
void lambda_1();
void diagnostic_error(); void diagnostic_error();
}; };
@@ -697,6 +714,17 @@ void tst_Semantic::q_enum_1()
QCOMPARE(e->name->identifier()->chars(), "e"); QCOMPARE(e->name->identifier()->chars(), "e");
} }
void tst_Semantic::lambda_1()
{
QSharedPointer<Document> doc = document("\n"
"void f() {\n"
" auto func = [](int a, int b) {return a + b;};\n"
"}\n", false, false, true);
QCOMPARE(doc->errorCount, 0U);
QCOMPARE(doc->globals->memberCount(), 1U);
}
void tst_Semantic::diagnostic_error() void tst_Semantic::diagnostic_error()
{ {
QSharedPointer<Document> doc = document("\n" QSharedPointer<Document> doc = document("\n"

View File

@@ -62,6 +62,8 @@
// Same as 1, except that the debugger will stop automatically when // Same as 1, except that the debugger will stop automatically when
// a test after a BREAK_HERE failed // a test after a BREAK_HERE failed
// Default: 0 // Default: 0
// Before using this, make sure that "Show a message box when receiving a signal"
// is disabled in "Tools" -> "Options..." -> "Debugger" -> "GDB".
#ifndef USE_AUTORUN #ifndef USE_AUTORUN
#define USE_AUTORUN 0 #define USE_AUTORUN 0
#endif #endif
@@ -555,7 +557,7 @@ namespace qbytearray {
QString s(10000, 'x'); QString s(10000, 'x');
std::string ss(10000, 'c'); std::string ss(10000, 'c');
BREAK_HERE; BREAK_HERE;
// Check ba "\377\376\375\374\373\372\371\370\367\366\365\364\363\362\361\360\357\356\355\354\353\352\351\350\347\346\345\344\343\342\341\340\337\336\335\334\333\332\331\330\327\326\325\324\323\322\321\320\317\316\315\314\313\312\311\310\307\306\305\304\303\302\301\300\277\276\275\274\273\272\271\270\267\266\265\264\263\262\261\260\257\256\255\254\253\252\251\250\247\246\245\244\243\242\241\240\237\236\235\234\233\232\231\230\227\226\225\224\223\222\221\220\217\216\215\214\213\212\211\210\207\206\205\204\203\202\201\20..." QByteArray. // CheckType ba QByteArray.
// Check s "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..." QString. // Check s "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..." QString.
// Check ss "ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc..." std::string. // Check ss "ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc..." std::string.
// Continue. // Continue.
@@ -571,8 +573,11 @@ namespace qbytearray {
QByteArray buf2(str2); QByteArray buf2(str2);
QByteArray buf3(str3); QByteArray buf3(str3);
BREAK_HERE; BREAK_HERE;
// Check buf1 "\356" QByteArray. // Check buf1 "î" QByteArray.
// Check buf2 "\356" QByteArray. // Check buf2 "î" QByteArray.
// Check buf3 "\ee" QByteArray.
// Check buf1 "î" QByteArray.
// Check buf2 "î" QByteArray.
// Check buf3 "\ee" QByteArray. // Check buf3 "\ee" QByteArray.
// CheckType str1 char *. // CheckType str1 char *.
// Continue. // Continue.
@@ -1152,8 +1157,8 @@ namespace qlist {
BREAK_HERE; BREAK_HERE;
// Expand l. // Expand l.
// Check l <3 items> QList<unsigned long long>. // Check l <3 items> QList<unsigned long long>.
// CheckType l.0 101 unsigned long long. // CheckType l.0 unsigned long long.
// CheckType l.2 102 unsigned long long. // CheckType l.2 unsigned long long.
// Continue. // Continue.
dummyStatement(&l); dummyStatement(&l);
} }
@@ -3447,7 +3452,7 @@ namespace formats {
else else
u = QString::fromUtf16((ushort *)w); u = QString::fromUtf16((ushort *)w);
BREAK_HERE; BREAK_HERE;
// Check u "a\366a" QString. // Check u "aöa" QString.
// CheckType w wchar_t *. // CheckType w wchar_t *.
// Continue. // Continue.
@@ -5898,6 +5903,7 @@ namespace bug6933 {
BREAK_HERE; BREAK_HERE;
// Expand b b.bug6933::Base // Expand b b.bug6933::Base
// Check b.[bug6933::Base].[vptr] // Check b.[bug6933::Base].[vptr]
// Continue.
dummyStatement(&d, b); dummyStatement(&d, b);
} }
} }