Commit f19ce6c2 authored by dt's avatar dt
Browse files

Merge branch '1.3' of git@scm.dev.nokia.troll.no:creator/mainline into 1.3

parents a562a379 92c39390
......@@ -64,19 +64,25 @@ Debugging
* CDB: Added more types to the dumpers (QSharedPointer, QVector, common
QMap/QSet types), dereference reference and pointer parameters
* CDB: Simplified display of STL types in the locals window
* CDB: Fixed thread handling
* CDB: Fixed thread handling, display thread position
* CDB: Added internal dumpers for string types for debuggee crashes
* CDB: Set symbol paths correctly
* Improved QObject dumping, print out QRect/QSize, enumerations and flags
* Made it possible to use the BinEditor plugin for displaying raw memory
* Replace disassembler window by a real text editor enabling "mixed" output
* Improved dumper building on options page, run in background
Designer
* Added support for rearranging and floating form editor tools
Version control plugins
* Added CVS support
* Display diff/annotation with correct encoding
* Added "sync" menu item to the Perforce plugin
* Fixed locking of temporary submit message files on Windows
* Use a single, colored output pane for all version control systems
* Position annotation view of file at current line of editor
Wizards
* Fixed GUI project and form class wizards to use the same settings.
* Added version control checkout wizards
......
......@@ -34,55 +34,6 @@
using namespace CPlusPlus;
FastMacroResolver::FastMacroResolver(TranslationUnit *unit, const Snapshot &snapshot)
: _unit(unit), _snapshot(snapshot)
{
const QString fileName = QString::fromUtf8(unit->fileName(), unit->fileNameLength());
QSet<QString> processed;
updateCache(fileName, &processed);
}
bool FastMacroResolver::isMacro(TranslationUnit *unit, unsigned tokenIndex) const
{
if (unit != _unit){
qWarning() << Q_FUNC_INFO << "unexpected translation unit:" << unit->fileName();
return false;
}
const Token &tk = unit->tokenAt(tokenIndex);
if (tk.isNot(T_IDENTIFIER))
return false;
Identifier *id = tk.identifier;
const QByteArray macroName = QByteArray::fromRawData(id->chars(), id->size());
return _cachedMacros.contains(macroName);
}
void FastMacroResolver::updateCache(const QString &fileName, QSet<QString> *processed)
{
if (processed->contains(fileName))
return;
processed->insert(fileName);
if (Document::Ptr doc = _snapshot.value(fileName)) {
const QList<Macro> definedMacros = doc->definedMacros();
for (int i = definedMacros.size() - 1; i != -1; --i) {
const Macro &macro = definedMacros.at(i);
if (macro.isHidden())
_cachedMacros.remove(macro.name());
else
_cachedMacros.insert(macro.name());
}
foreach (const Document::Include &incl, doc->includes())
updateCache(incl.fileName(), processed);
}
}
FastPreprocessor::FastPreprocessor(const Snapshot &snapshot)
: _snapshot(snapshot),
_preproc(this, &_env)
......
......@@ -41,22 +41,6 @@
namespace CPlusPlus {
class CPLUSPLUS_EXPORT FastMacroResolver: public MacroResolver
{
public:
FastMacroResolver(TranslationUnit *unit, const Snapshot &snapshot);
virtual bool isMacro(TranslationUnit *unit, unsigned tokenIndex) const;
private:
void updateCache(const QString &fileName, QSet<QString> *processed);
private:
TranslationUnit *_unit;
Snapshot _snapshot;
QSet<QByteArray> _cachedMacros;
};
class CPLUSPLUS_EXPORT FastPreprocessor: public Client
{
Environment _env;
......
......@@ -2090,11 +2090,7 @@ SemanticInfo SemanticHighlighter::semanticInfo(const Source &source)
snapshot = source.snapshot;
doc = source.snapshot.documentFromSource(preprocessedCode, source.fileName);
FastMacroResolver fastMacroResolver(doc->translationUnit(), snapshot);
doc->control()->setMacroResolver(&fastMacroResolver);
doc->check();
doc->control()->setMacroResolver(0);
}
Control *control = doc->control();
......
......@@ -531,13 +531,7 @@ static void find_helper(QFutureInterface<Utils::FileSearchResult> &future,
if (Identifier *id = control->findIdentifier(symbolId->chars(), symbolId->size())) {
QTime tm;
tm.start();
TranslationUnit *unit = doc->translationUnit();
Control *control = doc->control();
FastMacroResolver fastMacroResolver(unit, snapshot);
control->setMacroResolver(&fastMacroResolver);
doc->parse();
control->setMacroResolver(0);
//qDebug() << "***" << unit->fileName() << "parsed in:" << tm.elapsed();
......@@ -548,6 +542,8 @@ static void find_helper(QFutureInterface<Utils::FileSearchResult> &future,
tm.start();
Process process(doc, snapshot, &future);
TranslationUnit *unit = doc->translationUnit();
process(symbol, id, unit->ast());
//qDebug() << "***" << unit->fileName() << "processed in:" << tm.elapsed();
......
......@@ -30,6 +30,7 @@
#include "breakwindow.h"
#include "debuggeractions.h"
#include "debuggermanager.h"
#include "ui_breakcondition.h"
#include "ui_breakbyfunction.h"
......@@ -179,6 +180,7 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
editConditionAction->setEnabled(si.size() > 0);
QAction *synchronizeAction = new QAction(tr("Synchronize breakpoints"), &menu);
synchronizeAction->setEnabled(Debugger::DebuggerManager::instance()->debuggerActionsEnabled());
QModelIndex idx0 = (si.size() ? si.front() : QModelIndex());
QModelIndex idx2 = idx0.sibling(idx0.row(), 2);
......
......@@ -662,13 +662,15 @@ void DebuggerManager::setSimpleDockWidgetArrangement()
}
foreach (QDockWidget *dockWidget, dockWidgets) {
d->m_mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dockWidget);
if (dockWidget == d->m_outputDock)
d->m_mainWindow->addDockWidget(Qt::TopDockWidgetArea, dockWidget);
else
d->m_mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dockWidget);
dockWidget->show();
}
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_breakDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_modulesDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_outputDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_registerDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_threadsDock);
d->m_mainWindow->tabifyDockWidget(d->m_watchDock, d->m_sourceFilesDock);
......@@ -1684,11 +1686,51 @@ void DebuggerManager::setState(DebuggerState state)
d->m_actions.runToFunctionAction->setEnabled(stopped);
d->m_actions.jumpToLineAction->setEnabled(stopped);
d->m_actions.nextAction->setEnabled(stopped);
const bool actionsEnabled = debuggerActionsEnabled();
theDebuggerAction(RecheckDebuggingHelpers)->setEnabled(actionsEnabled);
theDebuggerAction(AutoDerefPointers)->setEnabled(actionsEnabled && d->m_engine->isGdbEngine());
theDebuggerAction(ExpandStack)->setEnabled(actionsEnabled);
theDebuggerAction(ExecuteCommand)->setEnabled(d->m_state != DebuggerNotReady);
emit stateChanged(d->m_state);
const bool notbusy = state == InferiorStopped
|| state == DebuggerNotReady
|| state == InferiorUnrunnable;
setBusyCursor(!notbusy);
}
bool DebuggerManager::debuggerActionsEnabled() const
{
if (!d->m_engine)
return false;
switch (state()) {
case InferiorPrepared:
case InferiorStarting:
case InferiorRunningRequested:
case InferiorRunning:
case InferiorUnrunnable:
case InferiorStopping:
case InferiorStopped:
return true;
case DebuggerNotReady:
case EngineStarting:
case AdapterStarting:
case AdapterStarted:
case AdapterStartFailed:
case InferiorPreparing:
case InferiorPreparationFailed:
case InferiorStartFailed:
case InferiorStopFailed:
case InferiorShuttingDown:
case InferiorShutDown:
case InferiorShutdownFailed:
case AdapterShuttingDown:
case AdapterShutdownFailed:
break;
}
return false;
}
QDebug operator<<(QDebug d, DebuggerState state)
......
......@@ -175,6 +175,8 @@ public:
void showMessageBox(int icon, const QString &title, const QString &text);
bool debuggerActionsEnabled() const;
static DebuggerManager *instance();
public slots:
......
......@@ -155,7 +155,6 @@ public:
m_clearContentsAction = new QAction(this);
m_clearContentsAction->setText(tr("Clear contents"));
m_clearContentsAction->setEnabled(true);
m_clearContentsAction->setShortcut(Qt::ControlModifier + Qt::Key_R);
connect(m_clearContentsAction, SIGNAL(triggered(bool)),
parent, SLOT(clearContents()));
......
......@@ -105,11 +105,15 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
if (index.isValid())
name = model()->data(index).toString();
QMenu menu;
const bool enabled = Debugger::DebuggerManager::instance()->debuggerActionsEnabled();
QAction *act0 = new QAction(tr("Update module list"), &menu);
QAction *act3 = new QAction(tr("Show source files for module \"%1\"").arg(name),
&menu);
act0->setEnabled(enabled);
QAction *act3 = new QAction(tr("Show source files for module \"%1\"").arg(name), &menu);
act3->setEnabled(enabled);
QAction *act4 = new QAction(tr("Load symbols for all modules"), &menu);
act4->setEnabled(enabled);
QAction *act5 = 0;
QAction *act6 = 0;
QAction *act7 = 0;
......
......@@ -177,6 +177,7 @@ void RegisterWindow::contextMenuEvent(QContextMenuEvent *ev)
} else {
actShowMemory->setText(tr("Open memory editor at %1").arg(address));
}
actShowMemory->setEnabled(m_manager->debuggerActionsEnabled());
menu.addSeparator();
int base = model()->data(QModelIndex(), RegisterNumberBaseRole).toInt();
......
......@@ -29,6 +29,7 @@
#include "sourcefileswindow.h"
#include "debuggeractions.h"
#include "debuggermanager.h"
#include <QtCore/QDebug>
#include <QtCore/QFileInfo>
......@@ -199,6 +200,7 @@ void SourceFilesWindow::contextMenuEvent(QContextMenuEvent *ev)
QMenu menu;
QAction *act1 = new QAction(tr("Reload data"), &menu);
act1->setEnabled(Debugger::DebuggerManager::instance()->debuggerActionsEnabled());
//act1->setCheckable(true);
QAction *act2 = 0;
if (name.isEmpty()) {
......
......@@ -240,6 +240,7 @@ bool StackHandler::isDebuggingDebuggingHelpers() const
ThreadData::ThreadData(int threadId) :
id(threadId),
address(0),
line(-1)
{
}
......
......@@ -102,7 +102,7 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
actShowMemory->setEnabled(false);
} else {
actShowMemory->setText(tr("Open memory editor at %1").arg(address));
}
}
QAction *actShowDisassembler = menu.addAction(QString());
if (address.isEmpty()) {
......@@ -113,8 +113,9 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
}
menu.addSeparator();
#if 0 // @TODO: not implemented
menu.addAction(theDebuggerAction(UseToolTipsInStackView));
#endif
menu.addAction(theDebuggerAction(UseAddressInStackView));
QAction *actAdjust = menu.addAction(tr("Adjust column widths to contents"));
......
......@@ -237,6 +237,10 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
individualFormatMenu.addAction(act);
individualFormatActions.append(act);
}
if (alternativeFormats.isEmpty()) {
typeFormatMenu.setEnabled(false);
individualFormatMenu.setEnabled(false);
}
} else {
typeFormatMenu.setTitle(tr("Change format for type"));
typeFormatMenu.setEnabled(false);
......@@ -245,16 +249,15 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
}
QMenu menu;
//QAction *actWatchExpressionInWindow
// = theDebuggerAction(WatchExpressionInWindow);
//menu.addAction(actWatchExpressionInWindow);
QAction *actInsertNewWatchItem = menu.addAction(tr("Insert new watch item"));
QAction *actSelectWidgetToWatch = menu.addAction(tr("Select widget to watch"));
const QString address = model()->data(mi0, AddressRole).toString();
QAction *actWatchKnownMemory = 0;
QAction *actWatchUnknownMemory = new QAction(tr("Open memory editor..."), &menu);;
QAction *actWatchUnknownMemory = new QAction(tr("Open memory editor..."), &menu);
actWatchUnknownMemory->setEnabled(m_manager->debuggerActionsEnabled());
if (!address.isEmpty())
actWatchKnownMemory = new QAction(tr("Open memory editor at %1").arg(address), &menu);
menu.addSeparator();
......@@ -270,6 +273,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
menu.addAction(actWatchKnownMemory);
menu.addAction(actWatchUnknownMemory);
menu.addSeparator();
menu.addAction(theDebuggerAction(RecheckDebuggingHelpers));
menu.addAction(theDebuggerAction(UseDebuggingHelpers));
......@@ -277,8 +281,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
menu.addAction(theDebuggerAction(UseToolTipsInLocalsView));
menu.addAction(theDebuggerAction(AutoDerefPointers));
theDebuggerAction(AutoDerefPointers)->
setEnabled(m_manager->currentEngine()->isGdbEngine());
QAction *actAdjustColumnWidths =
menu.addAction(tr("Adjust column widths to contents"));
QAction *actAlwaysAdjustColumnWidth =
......
......@@ -215,6 +215,15 @@ QStringList GettingStartedWelcomePageWidget::tipsOfTheDay()
#else
tr("Alt", "Shortcut key");
#endif
QString ctrlShortcut =
#ifdef Q_WS_MAC
tr("Cmd", "Shortcut key");
#else
tr("Ctrl", "Shortcut key");
#endif
tips.append(tr("You can switch between Qt Creator's modes using <tt>Ctrl+number</tt>:<ul>"
"<li>1 - Welcome</li><li>2 - Edit</li><li>3 - Debug</li><li>4 - Projects</li><li>5 - Help</li>"
"<li></li><li>6 - Output</li></ul>"));
......@@ -236,7 +245,7 @@ QStringList GettingStartedWelcomePageWidget::tipsOfTheDay()
"<ul><li>1 - Build Issues</li><li>2 - Search Results</li><li>3 - Application Output</li>"
"<li>4 - Compile Output</li></ul>").arg(altShortcut));
tips.append(tr("You can quickly search methods, classes, help and more using the "
"<a href=\"qthelp://com.nokia.qtcreator/doc/creator-navigation.html\">Locator bar</a> (<tt>Ctrl+K</tt>)."));
"<a href=\"qthelp://com.nokia.qtcreator/doc/creator-navigation.html\">Locator bar</a> (<tt>%1+K</tt>).").arg(ctrlShortcut));
tips.append(tr("You can add custom build steps in the "
"<a href=\"qthelp://com.nokia.qtcreator/doc/creator-build-settings.html\">build settings</a>."));
tips.append(tr("Within a session, you can add "
......
s/#include "qscriptcontext_p.h"//g
s/#include "qscriptcontext.h"//g
s/#include "qscriptengine.h"//g
s/#include "qscriptmember_p.h"//g
s/#include "qscriptobject_p.h"//g
s/#include "qscriptvalueimpl_p.h"//g
s/#ifndef QT_NO_SCRIPT//g
s,#endif // QT_NO_SCRIPT,,g
s/QScript/JavaScript/g
s/QSCRIPT/JAVASCRIPT/g
s/qscript/javascript/g
s/Q_SCRIPT/J_SCRIPT/g
s/qsreal/qjsreal/g
\ No newline at end of file
#!/bin/sh
me=$(dirname $0)
rm -f javascript.g
rm -f javascriptast.cpp
rm -f javascriptast_p.h
rm -f javascriptastfwd_p.h
rm -f javascriptastvisitor.cpp
rm -f javascriptastvisitor_p.h
rm -f javascriptlexer.cpp
rm -f javascriptlexer_p.h
rm -f javascriptmemorypool_p.h
rm -f javascriptnodepool_p.h
rm -f javascriptgrammar_p.h
rm -f javascriptgrammar.cpp
rm -f javascriptparser_p.h
rm -f javascriptparser.cpp
sed -f $me/cmd.sed $QTDIR/src/script/qscript.g > javascript.g
sed -f $me/cmd.sed $QTDIR/src/script/qscriptast.cpp > javascriptast.cpp
sed -f $me/cmd.sed $QTDIR/src/script/qscriptast_p.h > javascriptast_p.h
sed -f $me/cmd.sed $QTDIR/src/script/qscriptastfwd_p.h > javascriptastfwd_p.h
sed -f $me/cmd.sed $QTDIR/src/script/qscriptastvisitor.cpp > javascriptastvisitor.cpp
sed -f $me/cmd.sed $QTDIR/src/script/qscriptastvisitor_p.h > javascriptastvisitor_p.h
sed -f $me/cmd.sed $QTDIR/src/script/qscriptlexer_p.h > javascriptlexer_p.h
sed -f $me/cmd.sed $QTDIR/src/script/qscriptlexer.cpp > javascriptlexer.cpp
sed -f $me/cmd.sed $QTDIR/src/script/qscriptmemorypool_p.h > javascriptmemorypool_p.h
sed -f $me/cmd.sed $QTDIR/src/script/qscriptnodepool_p.h > javascriptnodepool_p.h
qlalr --troll --no-lines --no-debug $me/javascript.g
chmod ugo-w javascript.g
chmod ugo-w javascriptast.cpp
chmod ugo-w javascriptast_p.h
chmod ugo-w javascriptastfwd_p.h
chmod ugo-w javascriptastvisitor.cpp
chmod ugo-w javascriptastvisitor_p.h
chmod ugo-w javascriptlexer_p.h
chmod ugo-w javascriptlexer.cpp
chmod ugo-w javascriptmemorypool_p.h
chmod ugo-w javascriptnodepool_p.h
chmod ugo-w javascriptgrammar_p.h
chmod ugo-w javascriptgrammar.cpp
chmod ugo-w javascriptparser_p.h
chmod ugo-w javascriptparser.cpp
// This file was generated by qlalr - DO NOT EDIT!
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "javascriptgrammar_p.h"
const char *const JavaScriptGrammar::spell [] = {
......
......@@ -2,13 +2,41 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the $MODULE$ of the Qt Toolkit.
** This file is part of the QtCore module of the Qt Toolkit.
**
** $TROLLTECH_DUAL_LICENSE$
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
......
Markdown is supported
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