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)
* Add "Search Again" to recent searches (QTCREATORBUG-621)
* Allow multiple parallel searches (QTCREATORBUG-6101)
* Add Execute filter to the locator, for executing external commands [by
Yuchen Deng]
Editing
* 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
* Re-enable debugging of Python scripts
* Add pretty-printing for D arrays and strings
* Add "Break on raise()" option for GDB/Windows
Debugging QML/JS
* Relocate breakpoints to next executable code

View File

@@ -10,9 +10,9 @@ HTML.postheader = \
" <div id=\"nav-topright\">\n" \
" <ul>\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-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" \
" <li class=\"nav-topright-blog\"><a href=\"http://blog.qt.nokia.com/\">BLOG</a></li>\n" \
" </ul>\n" \
@@ -36,12 +36,12 @@ HTML.postheader = \
" API Lookup</h2>\n" \
" <div id=\"list001\" class=\"list\">\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://doc.qt.nokia.com/4.7/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://doc.qt.nokia.com/4.7/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://doc.qt.nokia.com/4.7/qdeclarativeelements.html">QML elements</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://qt-project.org/doc/qt-4.8/functions.html">Function index</a></li>\n" \
" <li><a href="http://qt-project.org/doc/qt-4.8/modules.html">Modules</a></li>\n" \
" <li><a href="http://qt-project.org/doc/qt-4.8/namespaces.html">Namespaces</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://qt-project.org/doc/qt-4.8/qdeclarativeelements.html">QML elements</a></li>\n" \
" </ul> \n" \
" </div>\n" \
" </div>\n" \
@@ -50,13 +50,13 @@ HTML.postheader = \
" Qt Topics</h2>\n" \
" <div id=\"list002\" class=\"list\">\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://doc.qt.nokia.com/4.7/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://doc.qt.nokia.com/4.7/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://doc.qt.nokia.com/4.7/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/qt-basic-concepts.html">Programming with Qt</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://qt-project.org/doc/qt-4.8/qt-gui-concepts.html">UI Design with Qt</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://qt-project.org/doc/qt-4.8/platform-specific.html">Platform-specific info</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://qt-project.org/doc/qt-4.8/best-practices.html">Best Practices</a></li> \n" \
" </ul> \n" \
" </div>\n" \
" </div>\n" \
@@ -65,10 +65,10 @@ HTML.postheader = \
" Examples</h2>\n" \
" <div id=\"list003\" class=\"list\">\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://doc.qt.nokia.com/4.7/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://doc.qt.nokia.com/4.7/qdeclarativeexamples.html">QML 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://qt-project.org/doc/qt-4.8/tutorials.html">Tutorials</a></li>\n" \
" <li><a href="http://qt-project.org/doc/qt-4.8/demos.html">Demos</a></li>\n" \
" <li><a href="http://qt-project.org/doc/qt-4.8/qdeclarativeexamples.html">QML Examples</a></li>\n" \
" </ul> \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\listmodels} folders. After
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"
@@ -163,14 +165,14 @@
\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
you select the display name.
\o \c displayName appears in the \gui New dialog, under the
\c displayCategory.
\o \c description appears in the right-most panel when
\c displayCategory is selected.
You can add translations as values for the text elements. Specify the target
language as an attribute for the element. Use locale names (QLocale).

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -1099,7 +1099,12 @@ void Bind::lambdaDeclarator(LambdaDeclaratorAST *ast)
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;
FullySpecifiedType type;
@@ -1110,7 +1115,6 @@ void Bind::lambdaDeclarator(LambdaDeclaratorAST *ast)
}
// unsigned mutable_token = ast->mutable_token;
type = this->exceptionSpecification(ast->exception_specification, type);
type = this->trailingReturnType(ast->trailing_return_type, type);
}
bool Bind::visit(TrailingReturnTypeAST *ast)

View File

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

View File

@@ -1283,7 +1283,7 @@ ServiceBrowserPrivate::ServiceBrowserPrivate(const QString &serviceType, const Q
bool requireAddresses, MainConnectionPtr mconn):
q(0), serviceType(serviceType), domain(domain), mainConnection(mconn), serviceConnection(0), flags(0), interfaceIndex(0),
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():
flowStatus(NormalRFS),
lib(zeroConfLibInstance()->defaultLib()), m_lock(QMutex::Recursive),
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;
}
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:
ret = false;
}
@@ -992,7 +993,10 @@ void DocumentManager::checkForReload()
// check if IDocument wants us to ask
if (document->reloadBehavior(trigger, type) == IDocument::BehaviorSilent) {
// 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
} else if (type == IDocument::TypeContents) {
// 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);
// sync return type
{
do {
// set up for rewriting return type
SubstitutionEnvironment env;
env.setContext(sourceContext);
@@ -637,6 +637,9 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
declarator = def->declarator;
firstReplaceableSpecifier = findFirstReplaceableSpecifier(
targetTranslationUnit, def->decl_specifier_list);
} else {
// no proper AST to synchronize the return type
break;
}
int returnTypeStart = 0;
@@ -653,7 +656,7 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
targetFile->startOf(targetFunctionDeclarator->lparen_token),
replacement);
}
}
} while (false);
// sync parameters
{

View File

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

View File

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

View File

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

View File

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

View File

@@ -1919,7 +1919,7 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
// Handle non-existing breakpoint.
const QString text = args.address
? 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);
act->setData(QVariant::fromValue(args));
act->setEnabled(contextUsable);
@@ -1930,7 +1930,7 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
args.mode = BreakpointMenuContextData::MessageTracePoint;
const QString tracePointText = args.address
? 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->setData(QVariant::fromValue(args));
act->setEnabled(contextUsable);
@@ -1966,7 +1966,8 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
frame.function = cppFunctionAt(fileName, lineNumber);
frame.line = 42; // trick gdb into mixed mode.
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);
disassembleAction->setData(QVariant::fromValue(frame));
connect(disassembleAction, SIGNAL(triggered()), SLOT(slotDisassembleFunction()));

View File

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

View File

@@ -518,13 +518,15 @@ void GdbEngine::handleResponse(const QByteArray &buff)
} else if (asyncClass == "breakpoint-created") {
// "{bkpt={number="1",type="breakpoint",disp="del",enabled="y",
// 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();
foreach (const GdbMi &bkpt, result.children()) {
BreakpointResponse br;
br.type = BreakpointByFileAndLine;
updateResponse(br, bkpt);
BreakpointModelId id = handler->findBreakpointByResponseId(br.id);
handler->handleAlienBreakpoint(id, br, this);
handler->handleAlienBreakpoint(br, this);
}
} else if (asyncClass == "breakpoint-deleted") {
// "breakpoint-deleted" "{id="1"}"
@@ -2380,11 +2382,21 @@ void GdbEngine::updateResponse(BreakpointResponse &response, const GdbMi &bkpt)
} else if (child.hasName("thread")) {
response.threadSpec = child.data().toInt();
} else if (child.hasName("type")) {
// "breakpoint", "hw breakpoint", "tracepoint"
if (child.data().contains("tracepoint"))
// "breakpoint", "hw breakpoint", "tracepoint", "hw watchpoint"
// {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;
else if (!child.data().contains("reakpoint"))
response.type = WatchpointAtAddress;
} else if (child.data() == "hw watchpoint" || child.data() == "watchpoint") {
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")) {
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)
postCommand("sharedlibrary " + dotEscape(moduleName.toLocal8Bit()));
postCommand("sharedlibrary " + dotEscape(modulePath.toLocal8Bit()));
reloadModulesInternal();
reloadBreakListInternal();
reloadStack(true);
@@ -3170,7 +3182,7 @@ void GdbEngine::loadSymbolsForStack()
if (module.startAddress <= frame.address
&& frame.address < module.endAddress) {
postCommand("sharedlibrary "
+ dotEscape(module.moduleName.toLocal8Bit()));
+ dotEscape(module.modulePath.toLocal8Bit()));
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"));
if (!tf.open())
@@ -3192,15 +3204,15 @@ void GdbEngine::requestModuleSymbols(const QString &moduleName)
QString fileName = tf.fileName();
tf.close();
postCommand("maint print msymbols " + fileName.toLocal8Bit()
+ ' ' + moduleName.toLocal8Bit(),
+ ' ' + modulePath.toLocal8Bit(),
NeedsStop, CB(handleShowModuleSymbols),
QVariant(moduleName + QLatin1Char('@') + fileName));
QVariant(modulePath + QLatin1Char('@') + fileName));
}
void GdbEngine::handleShowModuleSymbols(const GdbResponse &response)
{
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);
if (response.resultClass == GdbResultDone) {
Symbols rc;
@@ -3251,7 +3263,7 @@ void GdbEngine::handleShowModuleSymbols(const GdbResponse &response)
}
file.close();
file.remove();
debuggerCore()->showModuleSymbols(moduleName, rc);
debuggerCore()->showModuleSymbols(modulePath, rc);
} else {
showMessageBox(QMessageBox::Critical, tr("Cannot Read Symbols"),
tr("Cannot read symbols for module \"%1\".").arg(fileName));
@@ -3270,6 +3282,11 @@ void GdbEngine::reloadModulesInternal()
postCommand("info shared", NeedsStop, CB(handleModulesList));
}
static QString nameFromPath(const QString &path)
{
return QFileInfo(path).baseName();
}
void GdbEngine::handleModulesList(const GdbResponse &response)
{
Modules modules;
@@ -3285,7 +3302,8 @@ void GdbEngine::handleModulesList(const GdbResponse &response)
QTextStream ts(&line, QIODevice::ReadOnly);
if (line.startsWith(QLatin1String("0x"))) {
ts >> module.startAddress >> module.endAddress >> symbolsRead;
module.moduleName = ts.readLine().trimmed();
module.modulePath = ts.readLine().trimmed();
module.moduleName = nameFromPath(module.modulePath);
module.symbolsRead =
(symbolsRead == QLatin1String("Yes") ? Module::ReadOk : Module::ReadFailed);
modules.append(module);
@@ -3295,7 +3313,8 @@ void GdbEngine::handleModulesList(const GdbResponse &response)
QTC_ASSERT(symbolsRead == QLatin1String("No"), continue);
module.startAddress = 0;
module.endAddress = 0;
module.moduleName = ts.readLine().trimmed();
module.modulePath = ts.readLine().trimmed();
module.moduleName = nameFromPath(module.modulePath);
modules.append(module);
}
}
@@ -3307,8 +3326,9 @@ void GdbEngine::handleModulesList(const GdbResponse &response)
// shlib-info={...}...
foreach (const GdbMi &item, response.data.children()) {
Module module;
module.moduleName =
module.modulePath =
QString::fromLocal8Bit(item.findChild("path").data());
module.moduleName = nameFromPath(module.modulePath);
module.symbolsRead = (item.findChild("state").data() == "Y")
? Module::ReadOk : Module::ReadFailed;
module.startAddress =
@@ -3327,8 +3347,8 @@ void GdbEngine::examineModules()
foreach (Module module, modulesHandler()->modules()) {
if (module.symbolsType == Module::UnknownType) {
QProcess proc;
qDebug() << _("objdump -h \"%1\"").arg(module.moduleName);
proc.start(_("objdump -h \"%1\"").arg(module.moduleName));
qDebug() << _("objdump -h \"%1\"").arg(module.modulePath);
proc.start(_("objdump -h \"%1\"").arg(module.modulePath));
if (!proc.waitForStarted())
continue;
if (!proc.waitForFinished())
@@ -3338,7 +3358,7 @@ void GdbEngine::examineModules()
module.symbolsType = Module::FastSymbols;
else
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();
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)
@@ -156,17 +157,17 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
if (act == actUpdateModuleList)
engine->reloadModules();
else if (act == actShowModuleSources)
engine->loadSymbols(name);
engine->loadSymbols(fileName);
else if (act == actLoadSymbolsForAllModules)
engine->loadAllSymbols();
else if (act == actExamineAllModules)
engine->examineModules();
else if (act == actLoadSymbolsForModule)
engine->loadSymbols(name);
engine->loadSymbols(fileName);
else if (act == actEditFile)
engine->gotoLocation(name);
engine->gotoLocation(fileName);
else if (act == actShowModuleSymbols)
engine->requestModuleSymbols(name);
engine->requestModuleSymbols(fileName);
else if (actShowDependencies && act == actShowDependencies)
QProcess::startDetached(QLatin1String("depends"), QStringList(fileName));
else

View File

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

View File

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

View File

@@ -153,8 +153,33 @@ void SearchWidget::showEvent(QShowEvent *event)
void SearchWidget::search() const
{
QList<QHelpSearchQuery> query = searchEngine->queryWidget()->query();
searchEngine->search(query);
static QStringList charsToEscapeList;
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()

View File

@@ -65,6 +65,15 @@ ImageViewerFile::~ImageViewerFile()
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,
Core::IDocument::ReloadFlag flag,
Core::IDocument::ChangeType type)

View File

@@ -61,6 +61,7 @@ public:
bool isModified() const;
bool isSaveAsAllowed() const;
virtual ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
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->setIcon(QIcon(QLatin1String(Core::Constants::ICON_FILTER)));
d->m_categoriesButton->setToolTip(tr("Filter by categories"));
d->m_categoriesButton->setProperty("noArrow", true);
d->m_categoriesButton->setAutoRaise(true);
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->setStateName(stateName);
QApplication::processEvents();
if (!fxObjectNode.isValid())
return;
ctxt->setContextProperty("propertyCount", QVariant(fxObjectNode.modelNode().properties().count()));

View File

@@ -130,7 +130,7 @@ void QmlProject::parseProject(RefreshOptions options)
messageManager->printToOutputPane(
tr("Warning while loading project file %1.").arg(m_fileName));
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()
{
QMessageBox dialog(QApplication::activeWindow());
QPushButton *qtPref = dialog.addButton(tr("Open Qt4 Options"),
QPushButton *qtPref = dialog.addButton(tr("Open Qt Versions"),
QMessageBox::ActionRole);
dialog.addButton(QMessageBox::Cancel);
dialog.setDefaultButton(qtPref);
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(
"QML Observer is used to offer debugging features for "
"QML applications, such as interactive debugging and inspection tools. "
"It must be compiled for each used Qt version separately. "
"On the Qt4 options page, select the current Qt installation "
"and click Rebuild."));
"Qt Quick UI projects in the Qt 4.7 series.\n\n"
"To compile QML Observer, go to the Qt Versions page, "
"select the current Qt version, "
"and click Build in the Helpers section."));
dialog.exec();
if (dialog.clickedButton() == qtPref) {
Core::ICore::showOptionsDialog(

View File

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

View File

@@ -52,6 +52,9 @@
#include <Names.h>
//TESTED_COMPONENT=src/libs/cplusplus
#define NO_PARSER_OR_SEMANTIC_ERROR_MESSAGES
using namespace CPlusPlus;
class tst_Semantic: public QObject
@@ -68,13 +71,15 @@ public:
TranslationUnit *parse(const QByteArray &source,
TranslationUnit::ParseMode mode,
bool enableObjc,
bool qtMocRun)
bool qtMocRun,
bool enableCxx11)
{
const StringLiteral *fileId = control->stringLiteral("<stdin>");
TranslationUnit *unit = new TranslationUnit(control.data(), fileId);
unit->setSource(source.constData(), source.length());
unit->setObjCEnabled(enableObjc);
unit->setQtMocRunEnabled(qtMocRun);
unit->setCxxOxEnabled(enableCxx11);
unit->parse(mode);
return unit;
}
@@ -84,7 +89,9 @@ public:
public:
Document(TranslationUnit *unit)
: unit(unit), globals(unit->control()->newNamespace(0, 0)), errorCount(0)
: unit(unit)
, globals(unit->control()->newNamespace(0, 0))
, errorCount(0)
{ }
~Document()
@@ -114,23 +121,31 @@ public:
{ }
virtual void report(int /*level*/,
const StringLiteral * /*fileName*/,
unsigned /*line*/, unsigned /*column*/,
const char * /*format*/, va_list /*ap*/)
const StringLiteral *fileName,
unsigned line, unsigned column,
const char *format, va_list ap)
{
++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;
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.
TranslationUnit *unit = parse(source, TranslationUnit::ParseTranlationUnit, enableObjc, qtMocRun);
TranslationUnit *unit = parse(source, TranslationUnit::ParseTranlationUnit, enableObjc, qtMocRun, enableCxx11);
QSharedPointer<Document> doc(new Document(unit));
doc->check();
doc->errorCount = diag.errorCount;
@@ -164,6 +179,8 @@ private slots:
void q_enum_1();
void lambda_1();
void diagnostic_error();
};
@@ -697,6 +714,17 @@ void tst_Semantic::q_enum_1()
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()
{
QSharedPointer<Document> doc = document("\n"

View File

@@ -62,6 +62,8 @@
// Same as 1, except that the debugger will stop automatically when
// a test after a BREAK_HERE failed
// 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
#define USE_AUTORUN 0
#endif
@@ -555,7 +557,7 @@ namespace qbytearray {
QString s(10000, 'x');
std::string ss(10000, 'c');
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 ss "ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc..." std::string.
// Continue.
@@ -571,8 +573,11 @@ namespace qbytearray {
QByteArray buf2(str2);
QByteArray buf3(str3);
BREAK_HERE;
// Check buf1 "\356" QByteArray.
// Check buf2 "\356" QByteArray.
// Check buf1 "î" QByteArray.
// Check buf2 "î" QByteArray.
// Check buf3 "\ee" QByteArray.
// Check buf1 "î" QByteArray.
// Check buf2 "î" QByteArray.
// Check buf3 "\ee" QByteArray.
// CheckType str1 char *.
// Continue.
@@ -1152,8 +1157,8 @@ namespace qlist {
BREAK_HERE;
// Expand l.
// Check l <3 items> QList<unsigned long long>.
// CheckType l.0 101 unsigned long long.
// CheckType l.2 102 unsigned long long.
// CheckType l.0 unsigned long long.
// CheckType l.2 unsigned long long.
// Continue.
dummyStatement(&l);
}
@@ -3447,7 +3452,7 @@ namespace formats {
else
u = QString::fromUtf16((ushort *)w);
BREAK_HERE;
// Check u "a\366a" QString.
// Check u "aöa" QString.
// CheckType w wchar_t *.
// Continue.
@@ -5898,6 +5903,7 @@ namespace bug6933 {
BREAK_HERE;
// Expand b b.bug6933::Base
// Check b.[bug6933::Base].[vptr]
// Continue.
dummyStatement(&d, b);
}
}