Commit 4058ff6f authored by Eike Ziller's avatar Eike Ziller
Browse files

Merge remote-tracking branch 'origin/3.4'

Conflicts:
	src/libs/extensionsystem/pluginview.cpp

Change-Id: I410156c1003d5dc81e915110c6d432bcd71da010
parents fa704e0b 13a947d1
......@@ -5,7 +5,7 @@ staging=${broot}/staging
pyversion=2.7
expatversion=2.1.0
arch=`uname -sm | sed 's/ /-/g' | tr A-Z a-z`
version=7.8.2
version=7.9
targetdir=${broot}/qtcreator-gdb-${version}
gdbtargets=$(addprefix ${targetdir}/gdb-, ${targets})
packagename=qtcreator-gdb-${version}-${arch}.tar.gz
......
......@@ -6,7 +6,7 @@ pyversion=2.7
pydir=${broot}/python
expatversion=2.1.0
iconvversion=1.14
version=7.8.2
version=7.9
targetdir=${broot}/qtcreator-gdb-${version}
gdbtargets=$(addprefix ${targetdir}/gdb-, ${targets})
packageparts=${targetdir}/lib ${targetdir}/data-directory ${targetdir}/libiconv-2.dll ${targetdir}/python27.dll ${targetdir}/libexpat-1.dll
......
......@@ -5,7 +5,7 @@ staging=${broot}/staging
pyversion=2.7
expatversion=2.1.0
arch=`uname -sm | sed 's/ /-/g' | tr A-Z a-z`
version=7.8.2
version=7.9
targetdir=${broot}/qtcreator-gdb-${version}
gdbtargets=$(addprefix ${targetdir}/gdb-, ${targets})
packagename=qtcreator-gdb-${version}-${arch}.tar.gz
......
......@@ -59,6 +59,12 @@
\li In the \uicontrol {Qt Quick component set} field, select
\uicontrol {Qt Quick 2.1}.
\note This selection determines the set of files that the wizard
generates and their contents. The instructions in this tutorial
might not apply if you select some other component set, such as Qt
Quick 2.4. The wizard indicates which Qt version each component set
requires at minimum.
\li Select \l{glossary-buildandrun-kit}{kits} for running and building your project,
and then click \uicontrol{Next}.
......@@ -90,8 +96,7 @@
To use the states.png image in your application, you must copy it to the
project directory (same subdirectory as the QML file) from the examples
directory in the Qt installation directory. For example:
\c {C:\Qt\Qt5.3.0\5.3.0\msvc2010\examples\declarative\animation\states}. The
image appears
\c {C:\Qt\Examples\Qt-5.4\declarative\animation\states}. The image appears
in \uicontrol Resources. You can also use any other image or a QML
type, instead.
......@@ -104,8 +109,8 @@
\image qmldesigner-tutorial-design-mode.png "Transitions project in Design Mode"
\li In the \uicontrol Navigator, select \uicontrol Text and press \key Delete to
delete it.
\li In the \uicontrol Navigator, select \uicontrol MouseArea and
\uicontrol Text and press \key Delete to delete them.
\li Select \uicontrol Window to edit its properties.
......@@ -116,13 +121,8 @@
\li In the \uicontrol Id field, enter \e page, to be able to reference the
window from other places.
\li In the code editor, set the window background color to #343434:
\quotefromfile transitions/main.qml
\skipto Window {
\printuntil color
\li Delete the \c {Qt.quit();} command.
\li In the \uicontrol Color field, set the window background color
to #343434.
\endlist
......@@ -139,8 +139,9 @@
\endlist
\li Double-click the resource file, qml.qrc, in the \uicontrol Projects view
to add states.png to the resource file for deployment.
\li Right-click the resource file, qml.qrc, in the \uicontrol Projects
view, and select \uicontrol {Open in Editor} to add states.png to
the resource file for deployment.
\li Click \uicontrol Add and select states.png.
......@@ -186,9 +187,8 @@
\endlist
\li In the \uicontrol Navigator, drag and drop the \uicontrol {Mouse Area}
from \e page to \e topLeftRect to make it apply only to the
rectangle and not to the whole page.
\li Drag and drop a \uicontrol {Mouse Area} type from the
\uicontrol Library to \e topLeftRect in the \uicontrol Navigator.
\li Edit the \uicontrol {Mouse Area} properties:
......@@ -217,9 +217,7 @@
\quotefromfile transitions/main.qml
\skipto Window {
\printuntil onClicked
\printuntil }
\printuntil }
\printuntil mouseArea1
\printuntil }
\li In the \uicontrol Navigator, copy topLeftRect (by pressing
......@@ -274,8 +272,7 @@
\quotefromfile transitions/main.qml
\skipto Window {
\printuntil State2
\printuntil }
\printuntil mouseArea3
\printuntil }
\printuntil }
......
......@@ -1040,21 +1040,8 @@ class DumperBase:
return
typeName = str(value.type)
innerType = value.type.target().unqualified()
innerTypeName = str(innerType)
goodPointer = False
try:
target = value.dereference()
str(target) # Dummy access.
if self.isLldb and target.GetError().Fail():
pass
else:
goodPointer = True
except:
pass
if not goodPointer:
if self.isBadPointer(value):
# Failure to dereference a pointer should at least
# show the value of a pointer.
self.putValue(self.cleanAddress(value))
......@@ -1063,6 +1050,8 @@ class DumperBase:
return
displayFormat = self.currentItemFormat(value.type)
innerType = value.type.target().unqualified()
innerTypeName = str(innerType)
if innerTypeName == "void":
#warn("VOID POINTER: %s" % displayFormat)
......
......@@ -522,6 +522,14 @@ class Dumper(DumperBase):
except:
return None
def isBadPointer(self, value):
try:
target = value.dereference()
target.is_optimized_out # Access test.
return False
except:
return True
def makeValue(self, typeobj, init):
typename = "::" + self.stripClassTag(str(typeobj));
# Avoid malloc symbol clash with QVector.
......
......@@ -365,6 +365,10 @@ class Dumper(DumperBase):
#self.warn(" -> %s" % result)
return result
def isBadPointer(self, value):
target = value.dereference()
return target.GetError().Fail()
def makeValue(self, type, *args):
thread = self.currentThread()
frame = thread.GetFrameAtIndex(0)
......
......@@ -1651,10 +1651,6 @@ def qdump__QSet(d, value):
it = node.dereference().cast(innerType)
with SubItem(d, i):
key = it["key"]
if not key:
# LLDB can't access directly since it's in anonymous union
# for Qt4 optimized int keytype
key = it[1]["key"]
d.putItem(key)
......
......@@ -203,12 +203,9 @@ std::string SymbolGroup::dump(const std::string &iname,
DebugPrint() << "SymbolGroup::dump(" << iname << '/'
<< aNode->absoluteFullIName() <<" resolves to " << node->absoluteFullIName()
<< " expanded=" << node->isExpanded();
if (node->isExpanded()) { // Mark expand request by watch model
node->clearFlags(SymbolGroupNode::ExpandedByDumper);
} else {
if (node->canExpand() && !node->expand(errorMessage))
return std::string();
}
if (!node->isExpanded() && node->canExpand() && !node->expand(errorMessage))
return std::string();
node->addFlags(SymbolGroupNode::ExpandedByRequest);
// After expansion, run the complex dumpers
if (p.dumpFlags & DumpParameters::DumpComplexDumpers)
node->runComplexDumpers(ctx);
......@@ -378,8 +375,12 @@ static inline SymbolGroupNode *
bool SymbolGroup::expand(const std::string &nodeName, std::string *errorMessage)
{
if (SymbolGroupNode *node = findNodeForExpansion(this, nodeName, errorMessage))
return node == m_root ? true : node->expand(errorMessage);
if (SymbolGroupNode *node = findNodeForExpansion(this, nodeName, errorMessage)) {
if (node == m_root)
return true;
node->addFlags(SymbolGroupNode::ExpandedByRequest);
return node->expand(errorMessage);
}
return false;
}
......@@ -393,8 +394,12 @@ bool SymbolGroup::collapse(const std::string &nodeName, std::string *errorMessag
bool SymbolGroup::expandRunComplexDumpers(const std::string &nodeName, const SymbolGroupValueContext &ctx, std::string *errorMessage)
{
if (SymbolGroupNode *node = findNodeForExpansion(this, nodeName, errorMessage))
return node == m_root ? true : node->expandRunComplexDumpers(ctx, errorMessage);
if (SymbolGroupNode *node = findNodeForExpansion(this, nodeName, errorMessage)) {
if (node == m_root)
return true;
node->addFlags(SymbolGroupNode::ExpandedByRequest);
return node->expandRunComplexDumpers(ctx, errorMessage);
}
return false;
}
......
......@@ -62,8 +62,8 @@ static inline void debugNodeFlags(std::ostream &str, unsigned f)
str << " DumperOk";
if (f & SymbolGroupNode::SimpleDumperFailed)
str << " DumperFailed";
if (f & SymbolGroupNode::ExpandedByDumper)
str << " ExpandedByDumper";
if (f & SymbolGroupNode::ExpandedByRequest)
str << " ExpandedByRequest";
if (f & SymbolGroupNode::AdditionalSymbol)
str << " AdditionalSymbol";
if (f & SymbolGroupNode::Obscured)
......@@ -594,8 +594,8 @@ void ErrorSymbolGroupNode::debug(std::ostream &os, const std::string &visitingFu
\endlist
The dumping is mostly based on SymbolGroupValue expressions.
in the debugger. Evaluating those dumpers might expand symbol nodes, which are
then marked as 'ExpandedByDumper'. This stops the dump recursion to prevent
in the debugger. Evaluating those dumpers might expand symbol nodes, but those
are not marked as 'ExpandedByRequest'. This stops the dump recursion to prevent
outputting data that were not explicitly expanded by the watch handler.
\ingroup qtcreatorcdbext */
......@@ -1022,7 +1022,6 @@ void SymbolGroupNode::runComplexDumpers(const SymbolGroupValueContext &ctx)
if (ctChildren.empty())
return;
clearFlags(ExpandedByDumper);
// Mark current children as obscured. We cannot show both currently
// as this would upset the numerical sorting of the watch model
AbstractSymbolGroupNodePtrVectorConstIterator cend = children().end();
......@@ -1269,11 +1268,8 @@ bool SymbolGroupNode::expand(std::string *errorMessage)
DebugPrint() << "SymbolGroupNode::expand " << name()
<<'/' << absoluteFullIName() << ' '
<< m_index << DebugNodeFlags(flags());
if (isExpanded()) {
// Clear the flag indication dumper expansion on a second, explicit request
clearFlags(ExpandedByDumper);
if (isExpanded())
return true;
}
if (!canExpand()) {
*errorMessage = msgExpandFailed(name(), absoluteFullIName(), m_index,
"No subelements to expand in node.");
......@@ -1661,6 +1657,17 @@ SymbolGroupNodeVisitor::VisitResult
return VisitSkipChildren;
if (node->testFlags(SymbolGroupNode::AdditionalSymbol) && !node->testFlags(SymbolGroupNode::WatchNode))
return VisitSkipChildren;
// Recurse to children only if expanded by explicit watchmodel request
// and initialized.
bool visitChildren = true; // Report only one level for Qt Creator.
// Visit children of a SymbolGroupNode only if not expanded by its dumpers.
if (const SymbolGroupNode *realNode = node->resolveReference()->asSymbolGroupNode()) {
if (!realNode->isExpanded()
|| realNode->testFlags(SymbolGroupNode::Uninitialized)
|| !realNode->testFlags(SymbolGroupNode::ExpandedByRequest)) {
visitChildren = false;
}
}
// Comma between same level children given obscured children
if (depth == m_lastDepth)
m_os << ',';
......@@ -1673,28 +1680,16 @@ SymbolGroupNodeVisitor::VisitResult
m_os << '{';
const int childCount = node->dump(m_os, fullIname, m_parameters, m_context);
m_os << ",numchild=\"" << childCount << '"';
if (childCount) {
// Recurse to children only if expanded by explicit watchmodel request
// and initialized.
// Visit children of a SymbolGroupNode only if not expanded by its dumpers.
bool skipit = false;
if (const SymbolGroupNode *realNode = node->resolveReference()->asSymbolGroupNode()) {
if (!realNode->isExpanded() || realNode->testFlags(SymbolGroupNode::Uninitialized | SymbolGroupNode::ExpandedByDumper))
skipit = true;
}
if (!skipit) {
m_os << ",children=[";
if (m_parameters.humanReadable())
m_os << '\n';
return VisitContinue;
}
if (!childCount)
visitChildren = false;
if (visitChildren) { // open children array
m_os << ",children=[";
} else { // No children, close array.
m_os << '}';
}
// No children, close array.
m_os << '}';
if (m_parameters.humanReadable())
m_os << '\n';
return VisitSkipChildren;
return visitChildren ? VisitContinue : VisitSkipChildren;
}
void DumpSymbolGroupNodeVisitor::childrenVisited(const AbstractSymbolGroupNode *n, unsigned)
......
......@@ -224,7 +224,7 @@ public:
SimpleDumperOk = 0x4, // Internal dumper ran, value set
SimpleDumperFailed = 0x8, // Internal dumper failed
SimpleDumperMask = SimpleDumperNotApplicable|SimpleDumperOk|SimpleDumperFailed,
ExpandedByDumper = 0x10,
ExpandedByRequest = 0x10,
AdditionalSymbol = 0x20, // Introduced by addSymbol, should not be visible
Obscured = 0x40, // Symbol is obscured by (for example) fake container children
ComplexDumperOk = 0x80,
......
......@@ -160,10 +160,8 @@ bool SymbolGroupValue::ensureExpanded() const
// Set a flag indicating the node was expanded by SymbolGroupValue
// and not by an explicit request from the watch model.
if (m_node->expand(&m_errorMessage)) {
m_node->addFlags(SymbolGroupNode::ExpandedByDumper);
if (m_node->expand(&m_errorMessage))
return true;
}
if (SymbolGroupValue::verbose)
DebugPrint() << "Expand failure of '" << name() << "': " << m_errorMessage;
return false;
......
......@@ -52,6 +52,20 @@
This class has some validation logic for embedding into QWizardPage.
*/
static QString appBundleExpandedPath(const QString &path)
{
if (Utils::HostOsInfo::hostOs() == Utils::OsTypeMac && path.endsWith(QLatin1String(".app"))) {
// possibly expand to Foo.app/Contents/MacOS/Foo
QFileInfo info(path);
if (info.isDir()) {
QString exePath = path + QLatin1String("/Contents/MacOS/") + info.completeBaseName();
if (QFileInfo(exePath).exists())
return exePath;
}
}
return path;
}
namespace Utils {
// ------------------ BinaryVersionToolTipEventFilter
......@@ -362,20 +376,13 @@ void PathChooser::slotBrowse()
newPath = QFileDialog::getOpenFileName(this,
makeDialogTitle(tr("Choose Executable")), predefined,
d->m_dialogFilter);
if (HostOsInfo::hostOs() == OsTypeMac && newPath.endsWith(QLatin1String(".app"))) {
// possibly expand to Foo.app/Contents/MacOS/Foo
QFileInfo info(newPath);
if (info.isDir()) {
QString exePath = newPath + QLatin1String("/Contents/MacOS/") + info.completeBaseName();
if (QFileInfo(exePath).isExecutable())
newPath = exePath;
}
}
newPath = appBundleExpandedPath(newPath);
break;
case PathChooser::File: // fall through
newPath = QFileDialog::getOpenFileName(this,
makeDialogTitle(tr("Choose File")), predefined,
d->m_dialogFilter);
newPath = appBundleExpandedPath(newPath);
break;
case PathChooser::SaveFile:
newPath = QFileDialog::getSaveFileName(this,
......
......@@ -31,11 +31,15 @@
#include "baremetaldevice.h"
#include "baremetaldeviceconfigurationwidget.h"
#include "defaultgdbserverprovider.h"
#include "gdbserverprovidermanager.h"
#include "gdbserverproviderprocess.h"
#include <coreplugin/id.h>
#include <ssh/sshconnection.h>
#include <utils/qtcassert.h>
#include <QCoreApplication>
using namespace ProjectExplorer;
......@@ -73,7 +77,17 @@ void BareMetalDevice::setGdbServerProviderId(const QString &id)
void BareMetalDevice::fromMap(const QVariantMap &map)
{
IDevice::fromMap(map);
setGdbServerProviderId(map.value(QLatin1String(gdbServerProviderIdKeyC)).toString());
QString gdbServerProvider = map.value(QLatin1String(gdbServerProviderIdKeyC)).toString();
if (gdbServerProvider.isEmpty()) {
const QSsh::SshConnectionParameters sshParams = sshParameters();
DefaultGdbServerProvider *newProvider = new DefaultGdbServerProvider;
newProvider->setDisplayName(displayName());
newProvider->m_host = sshParams.host;
newProvider->m_port = sshParams.port;
GdbServerProviderManager::instance()->registerProvider(newProvider);
gdbServerProvider = newProvider->id();
}
setGdbServerProviderId(gdbServerProvider);
}
QVariantMap BareMetalDevice::toMap() const
......
......@@ -65,6 +65,7 @@ private:
friend class DefaultGdbServerProviderConfigWidget;
friend class DefaultGdbServerProviderFactory;
friend class BareMetalDevice;
};
class DefaultGdbServerProviderFactory : public GdbServerProviderFactory
......
......@@ -680,6 +680,7 @@ int ClangCompletionAssistProcessor::startCompletionHelper()
return startCompletionInternal(fileName, line, column, endOfOperator);
}
// TODO: Extract duplicated logic from InternalCppCompletionAssistProcessor::startOfOperator
int ClangCompletionAssistProcessor::startOfOperator(int pos,
unsigned *kind,
bool wantFunctionCall) const
......@@ -724,8 +725,9 @@ int ClangCompletionAssistProcessor::startOfOperator(int pos,
start = pos;
}
// Don't complete in comments or strings, but still check for include completion
else if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT) ||
(tk.isLiteral() && (*kind != T_STRING_LITERAL
else if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT)
|| tk.is(T_CPP_DOXY_COMMENT) || tk.is(T_DOXY_COMMENT)
|| (tk.isLiteral() && (*kind != T_STRING_LITERAL
&& *kind != T_ANGLE_STRING_LITERAL
&& *kind != T_SLASH))) {
*kind = T_EOF_SYMBOL;
......
......@@ -205,21 +205,31 @@ QStringList CMakeProject::getCXXFlagsFor(const CMakeBuildTarget &buildTarget)
// Attempt to find build.ninja file and obtain FLAGS (CXX_FLAGS) from there if no suitable flags.make were
// found
// Get "all" target's working directory
QString buildNinjaFile = QDir::fromNativeSeparators(buildTarget.workingDirectory);
buildNinjaFile += QLatin1String("/build.ninja");
QFile buildNinja(buildNinjaFile);
if (buildNinja.exists()) {
buildNinja.open(QIODevice::ReadOnly | QIODevice::Text);
QTextStream stream(&buildNinja);
bool cxxFound = false;
while (!stream.atEnd()) {
QString line = stream.readLine().trimmed();
// Look for a build rule which invokes CXX_COMPILER
if (line.startsWith(QLatin1String("build"))) {
cxxFound = line.indexOf(QLatin1String("CXX_COMPILER")) != -1;
} else if (cxxFound && line.startsWith(QLatin1String("FLAGS ="))) {
// Skip past =
return line.mid(7).trimmed().split(QLatin1Char(' '), QString::SkipEmptyParts);
if (!buildTargets().empty()) {
QString buildNinjaFile = QDir::fromNativeSeparators(buildTargets().at(0).workingDirectory);
buildNinjaFile += QLatin1String("/build.ninja");
QFile buildNinja(buildNinjaFile);
if (buildNinja.exists()) {
buildNinja.open(QIODevice::ReadOnly | QIODevice::Text);
QTextStream stream(&buildNinja);
bool targetFound = false;
bool cxxFound = false;
QString targetSearchPattern = QString::fromLatin1("target %1").arg(buildTarget.title);
while (!stream.atEnd()) {
// 1. Look for a block that refers to the current target
// 2. Look for a build rule which invokes CXX_COMPILER
// 3. Return the FLAGS definition
QString line = stream.readLine().trimmed();
if (line.startsWith(QLatin1String("#"))) {
if (!line.startsWith(QLatin1String("# Object build statements for"))) continue;
targetFound = line.endsWith(targetSearchPattern);
} else if (targetFound && line.startsWith(QLatin1String("build"))) {
cxxFound = line.indexOf(QLatin1String("CXX_COMPILER")) != -1;
} else if (cxxFound && line.startsWith(QLatin1String("FLAGS ="))) {
// Skip past =
return line.mid(7).trimmed().split(QLatin1Char(' '), QString::SkipEmptyParts);
}
}
}
}
......
......@@ -347,8 +347,7 @@ void OutputWindow::grayOutOldContent()
(bkgFactor * bkgColor.blue() + fgdFactor * fgdColor.blue()) ));
d->cursor.mergeCharFormat(format);
if (!d->cursor.atEnd())
d->cursor.movePosition(QTextCursor::End);
d->cursor.movePosition(QTextCursor::End);
d->cursor.setCharFormat(endFormat);
d->cursor.insertBlock(QTextBlockFormat());
}
......
......@@ -61,9 +61,6 @@ namespace {
class ParseParams
{
public:
ParseParams() : revision(0) {}
int revision;
ProjectPart::HeaderPaths headerPaths;
WorkingCopy workingCopy;
QSet<QString> sourceFiles;
......@@ -189,7 +186,6 @@ void indexFindErrors(QFutureInterface<void> &future, const ParseParams params)
void index(QFutureInterface<void> &future, const ParseParams params)
{
QScopedPointer<CppSourceProcessor> sourceProcessor(CppModelManager::createSourceProcessor());
sourceProcessor->setRevision(params.revision);
sourceProcessor->setHeaderPaths(params.headerPaths);
sourceProcessor->setWorkingCopy(params.workingCopy);
......@@ -347,7 +343,6 @@ private:
} // anonymous namespace
BuiltinIndexingSupport::BuiltinIndexingSupport()
: m_revision(0)
{
m_synchronizer.setCancelOnWait(true);
}
......@@ -361,7 +356,6 @@ QFuture<void> BuiltinIndexingSupport::refreshSourceFiles(const QSet<QString> &so
CppModelManager *mgr = CppModelManager::instance();
ParseParams params;
params.revision = ++m_revision;
params.headerPaths = mgr->headerPaths();
params.workingCopy = mgr->workingCopy();
params.sourceFiles = sourceFiles;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment