Commit bd47ccee authored by dt's avatar dt
Browse files

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

parents ef2b100e 99f23597
#!/bin/sh
bindir=$(dirname "$0")
bindir=$(dirname $(readlink -nf $0))
if test "$(uname -m)" = "x86_64" ; then
libdir=$(cd ${bindir}/../lib64 ; pwd)
else
......
......@@ -42,7 +42,8 @@
#include <QtDebug>
#ifdef Q_OS_LINUX
# define USE_UNPATCHED_QPLUGINLOADER 0
// Using the patched version breaks on Fedora 10, KDE4.2.2/Qt4.5.
# define USE_UNPATCHED_QPLUGINLOADER 1
#else
# define USE_UNPATCHED_QPLUGINLOADER 1
#endif
......
......@@ -24,3 +24,5 @@ unix {
LIBS += -lshell32
}
target.path = /bin
INSTALLS += target
......@@ -278,7 +278,7 @@ void DebuggerManager::init()
connect(m_watchHandler, SIGNAL(setSessionValueRequested(QString,QVariant)),
this, SIGNAL(setSessionValueRequested(QString,QVariant)));
connect(theDebuggerAction(AssignValue), SIGNAL(triggered()),
this, SLOT(assignValueInDebugger()));
this, SLOT(assignValueInDebugger()), Qt::QueuedConnection);
// Tooltip
QTreeView *tooltipView = qobject_cast<QTreeView *>(m_tooltipWindow);
......
......@@ -377,18 +377,18 @@ void GdbEngine::handleResponse(const QByteArray &buff)
GdbMi record;
while (from != to) {
GdbMi data;
if (*from == ',') {
++from; // skip ','
data.parseResultOrValue(from, to);
if (data.isValid()) {
//qDebug() << "parsed response: " << data.toString();
record.m_children += data;
record.m_type = GdbMi::Tuple;
}
} else {
if (*from != ',') {
// happens on archer where we get
// 23^running <NL> *running,thread-id="all" <NL> (gdb)
record.m_type = GdbMi::Tuple;
break;
}
++from; // skip ','
data.parseResultOrValue(from, to);
if (data.isValid()) {
//qDebug() << "parsed response: " << data.toString();
record.m_children += data;
record.m_type = GdbMi::Tuple;
}
}
if (asyncClass == "stopped") {
......
......@@ -69,6 +69,7 @@ using namespace Debugger::Constants;
#else
# define SDEBUG(s)
#endif
# define XSDEBUG(s) qDebug() << s
///////////////////////////////////////////////////////////////////////
//
......@@ -194,7 +195,7 @@ ScriptEngine::~ScriptEngine()
void ScriptEngine::executeDebuggerCommand(const QString &command)
{
Q_UNUSED(command);
SDEBUG("FIXME: ScriptEngine::executeDebuggerCommand()");
XSDEBUG("FIXME: ScriptEngine::executeDebuggerCommand()");
}
void ScriptEngine::shutdown()
......@@ -247,40 +248,40 @@ void ScriptEngine::interruptInferior()
{
m_stopped = false;
m_stopOnNextLine = true;
SDEBUG("FIXME: ScriptEngine::interruptInferior()");
XSDEBUG("ScriptEngine::interruptInferior()");
}
void ScriptEngine::stepExec()
{
//SDEBUG("FIXME: ScriptEngine::stepExec()");
//SDEBUG("ScriptEngine::stepExec()");
m_stopped = false;
m_stopOnNextLine = true;
}
void ScriptEngine::stepIExec()
{
//SDEBUG("FIXME: ScriptEngine::stepIExec()");
//SDEBUG("ScriptEngine::stepIExec()");
m_stopped = false;
m_stopOnNextLine = true;
}
void ScriptEngine::stepOutExec()
{
//SDEBUG("FIXME: ScriptEngine::stepOutExec()");
//SDEBUG("ScriptEngine::stepOutExec()");
m_stopped = false;
m_stopOnNextLine = true;
}
void ScriptEngine::nextExec()
{
//SDEBUG("FIXME: ScriptEngine::nextExec()");
//SDEBUG("ScriptEngine::nextExec()");
m_stopped = false;
m_stopOnNextLine = true;
}
void ScriptEngine::nextIExec()
{
//SDEBUG("FIXME: ScriptEngine::nextIExec()");
//SDEBUG("ScriptEngine::nextIExec()");
m_stopped = false;
m_stopOnNextLine = true;
}
......@@ -295,14 +296,14 @@ void ScriptEngine::runToLineExec(const QString &fileName, int lineNumber)
void ScriptEngine::runToFunctionExec(const QString &functionName)
{
Q_UNUSED(functionName);
SDEBUG("FIXME: ScriptEngine::runToFunctionExec()");
XSDEBUG("FIXME: ScriptEngine::runToFunctionExec()");
}
void ScriptEngine::jumpToLineExec(const QString &fileName, int lineNumber)
{
Q_UNUSED(fileName);
Q_UNUSED(lineNumber);
SDEBUG("FIXME: ScriptEngine::jumpToLineExec()");
XSDEBUG("FIXME: ScriptEngine::jumpToLineExec()");
}
void ScriptEngine::activateFrame(int index)
......@@ -468,8 +469,9 @@ void ScriptEngine::setToolTipExpression(const QPoint &pos, const QString &exp0)
void ScriptEngine::assignValueInDebugger(const QString &expression,
const QString &value)
{
Q_UNUSED(expression);
Q_UNUSED(value);
XSDEBUG("ASSIGNING: " << expression + '=' + value);
m_scriptEngine->evaluate(expression + '=' + value);
updateLocals();
}
void ScriptEngine::maybeBreakNow(bool byFunction)
......@@ -521,7 +523,12 @@ void ScriptEngine::maybeBreakNow(bool byFunction)
qq->notifyInferiorStopped();
q->gotoLocation(fileName, lineNumber, true);
updateLocals();
}
void ScriptEngine::updateLocals()
{
QScriptContext *context = m_scriptEngine->currentContext();
qq->watchHandler()->reinitializeWatchers();
//SDEBUG("UPDATE LOCALS");
......@@ -647,6 +654,7 @@ void ScriptEngine::updateSubItem(const WatchData &data0)
it.next();
WatchData data1;
data1.iname = data.iname + "." + it.name();
data1.exp = it.name();
data1.name = it.name();
data1.scriptValue = it.value();
if (qq->watchHandler()->isExpandedIName(data1.iname))
......
......@@ -110,6 +110,7 @@ private:
bool supportsThreads() const { return true; }
void maybeBreakNow(bool byFunction);
void updateWatchModel();
void updateLocals();
void updateSubItem(const WatchData &data0);
private:
......
......@@ -493,6 +493,14 @@ QVariant WatchHandler::data(const QModelIndex &idx, int role) const
return QVariant();
}
bool WatchHandler::setData(const QModelIndex &index, const QVariant &value, int role)
{
Q_UNUSED(role);
Q_UNUSED(value);
emit dataChanged(index, index);
return true;
}
Qt::ItemFlags WatchHandler::flags(const QModelIndex &idx) const
{
using namespace Qt;
......
......@@ -149,6 +149,7 @@ public:
// QAbstractItemModel
//
QVariant data(const QModelIndex &index, int role) const;
bool setData(const QModelIndex &index, const QVariant &value, int role);
QModelIndex index(int, int, const QModelIndex &idx) const;
QModelIndex parent(const QModelIndex &idx) const;
int rowCount(const QModelIndex &idx) const;
......
......@@ -64,6 +64,7 @@ public:
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &,
const QModelIndex &) const
{
qDebug() << "CREATE EDITOR";
return new QLineEdit(parent);
}
......@@ -77,13 +78,15 @@ public:
lineEdit->setText(index.model()->data(index, ExpressionRole).toString());
}
void setModelData(QWidget *editor, QAbstractItemModel *,
void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const
{
//qDebug() << "SET MODEL DATA";
QLineEdit *lineEdit = qobject_cast<QLineEdit*>(editor);
QTC_ASSERT(lineEdit, return);
QString value = lineEdit->text();
QString exp = index.model()->data(index, ExpressionRole).toString();
QString exp = model->data(index, ExpressionRole).toString();
model->setData(index, value, Qt::EditRole);
if (index.column() == 1) {
// the value column
theDebuggerAction(AssignValue)->trigger(exp + '=' + value);
......@@ -147,7 +150,9 @@ void WatchWindow::keyPressEvent(QKeyEvent *ev)
QModelIndex idx1 = idx.sibling(idx.row(), 0);
QString exp = model()->data(idx1).toString();
theDebuggerAction(RemoveWatchExpression)->trigger(exp);
} else if (ev->key() == Qt::Key_Return && m_type == LocalsType) {
} else if (ev->key() == Qt::Key_Return
&& ev->modifiers() == Qt::ControlModifier
&& m_type == LocalsType) {
QModelIndex idx = currentIndex();
QModelIndex idx1 = idx.sibling(idx.row(), 0);
QString exp = model()->data(idx1).toString();
......@@ -264,4 +269,3 @@ void WatchWindow::resetHelper(const QModelIndex &idx)
collapse(idx);
}
}
......@@ -1424,7 +1424,7 @@ QString QtVersion::buildDebuggingHelperLibrary()
qmake.setWorkingDirectory(directory);
qmake.setProcessChannelMode(QProcess::MergedChannels);
qmake.start(qmakeCommand(), QStringList()<<"-spec"<<"default"<<"gdbmacros.pro");
qmake.start(qmakeCommand(), QStringList()<<"-spec"<< mkspec() <<"gdbmacros.pro");
qmake.waitForFinished();
output += qmake.readAll();
......
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** 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.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
**************************************************************************/
#include "javascriptengine_p.h"
#include "javascriptnodepool_p.h"
#include "javascriptvalue.h"
......@@ -10,17 +39,17 @@ namespace JavaScript {
int Ecma::RegExp::flagFromChar(const QChar &ch)
{
static QHash<QChar, int> flagsHash;
if (flagsHash.isEmpty()) {
flagsHash[QLatin1Char('g')] = Global;
flagsHash[QLatin1Char('i')] = IgnoreCase;
flagsHash[QLatin1Char('m')] = Multiline;
}
QHash<QChar, int>::const_iterator it;
it = flagsHash.constFind(ch);
if (it == flagsHash.constEnd())
return 0;
return it.value();
static QHash<QChar, int> flagsHash;
if (flagsHash.isEmpty()) {
flagsHash[QLatin1Char('g')] = Global;
flagsHash[QLatin1Char('i')] = IgnoreCase;
flagsHash[QLatin1Char('m')] = Multiline;
}
QHash<QChar, int>::const_iterator it;
it = flagsHash.constFind(ch);
if (it == flagsHash.constEnd())
return 0;
return it.value();
}
......@@ -35,8 +64,8 @@ NodePool::~NodePool()
Code *NodePool::createCompiledCode(AST::Node *, CompilationUnit &)
{
Q_ASSERT(0);
return 0;
Q_ASSERT(0);
return 0;
}
static int toDigit(char c)
......
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** 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.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
**************************************************************************/
#ifndef JAVASCRIPTENGINE_P_H
#define JAVASCRIPTENGINE_P_H
......@@ -42,24 +71,24 @@ public:
class JavaScriptNameIdImpl
{
QString _text;
QString _text;
public:
JavaScriptNameIdImpl(const QChar *u, int s)
: _text(u, s)
{ }
JavaScriptNameIdImpl(const QChar *u, int s)
: _text(u, s)
{ }
const QString asString() const
{ return _text; }
const QString asString() const
{ return _text; }
bool operator == (const JavaScriptNameIdImpl &other) const
{ return _text == other._text; }
bool operator == (const JavaScriptNameIdImpl &other) const
{ return _text == other._text; }
bool operator != (const JavaScriptNameIdImpl &other) const
{ return _text != other._text; }
bool operator != (const JavaScriptNameIdImpl &other) const
{ return _text != other._text; }
bool operator < (const JavaScriptNameIdImpl &other) const
{ return _text < other._text; }
bool operator < (const JavaScriptNameIdImpl &other) const
{ return _text < other._text; }
};
inline uint qHash(const JavaScriptNameIdImpl &id)
......@@ -67,43 +96,43 @@ inline uint qHash(const JavaScriptNameIdImpl &id)
class JavaScriptEnginePrivate
{
JavaScript::Lexer *_lexer;
JavaScript::NodePool *_nodePool;
JavaScript::AST::Node *_ast;
QSet<JavaScriptNameIdImpl> _literals;
JavaScript::Lexer *_lexer;
JavaScript::NodePool *_nodePool;
JavaScript::AST::Node *_ast;
QSet<JavaScriptNameIdImpl> _literals;
public:
JavaScriptEnginePrivate()
: _lexer(0), _nodePool(0), _ast(0)
{ }
JavaScriptEnginePrivate()
: _lexer(0), _nodePool(0), _ast(0)
{ }
QSet<JavaScriptNameIdImpl> literals() const
{ return _literals; }
QSet<JavaScriptNameIdImpl> literals() const
{ return _literals; }
JavaScriptNameIdImpl *intern(const QChar *u, int s)
{ return const_cast<JavaScriptNameIdImpl *>(&*_literals.insert(JavaScriptNameIdImpl(u, s))); }
JavaScriptNameIdImpl *intern(const QChar *u, int s)
{ return const_cast<JavaScriptNameIdImpl *>(&*_literals.insert(JavaScriptNameIdImpl(u, s))); }
JavaScript::Lexer *lexer() const
{ return _lexer; }
JavaScript::Lexer *lexer() const
{ return _lexer; }
void setLexer(JavaScript::Lexer *lexer)
{ _lexer = lexer; }
void setLexer(JavaScript::Lexer *lexer)
{ _lexer = lexer; }
JavaScript::NodePool *nodePool() const
{ return _nodePool; }
JavaScript::NodePool *nodePool() const
{ return _nodePool; }
void setNodePool(JavaScript::NodePool *nodePool)
{ _nodePool = nodePool; }
void setNodePool(JavaScript::NodePool *nodePool)
{ _nodePool = nodePool; }
JavaScript::AST::Node *ast() const
{ return _ast; }
JavaScript::AST::Node *ast() const
{ return _ast; }
JavaScript::AST::Node *changeAbstractSyntaxTree(JavaScript::AST::Node *node)
{
JavaScript::AST::Node *previousAST = _ast;
_ast = node;
return previousAST;
}
JavaScript::AST::Node *changeAbstractSyntaxTree(JavaScript::AST::Node *node)
{
JavaScript::AST::Node *previousAST = _ast;
_ast = node;
return previousAST;
}
};
QT_END_NAMESPACE
......
......@@ -29,7 +29,8 @@
function cube(a)
{
return a * a * a;
var x = a * a * a;
return x;
}
var a = cube(3);
......@@ -39,6 +39,7 @@
#include <QtCore/QThread>
#include <QtCore/QVariant>
#include <QtCore/QVector>
#include <QtCore/QSharedPointer>
#include <QtGui/QApplication>
#include <QtGui/QAction>
......@@ -493,6 +494,11 @@ void testQSet()
//hash.insert(ptr);
}
void testQSharedPointer()
{
}
void stringRefTest(const QString &refstring)
{
Q_UNUSED(refstring);
......
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