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

This commit is contained in:
Erik Verbruggen
2009-09-11 14:43:39 +02:00
96 changed files with 3160 additions and 2606 deletions

View File

@@ -5,7 +5,7 @@
\title Qt Creator Manual
\section1 Version 1.2.80
\section1 Version 1.2.91
The goal of Qt Creator is to provide a cross-platform, complete Integrated
Development Environment (IDE) to develop Qt projects. It is available for
@@ -1786,7 +1786,7 @@
There are some known issues with Qt Creator.
The development team is aware of those, there is no need to report them as bug.
\section1 Known Issues of Version 1.2.80
\section1 Known Issues of Version 1.2.91
\list
\o Gdb on Windows may not work if the 'Embassy \reg Security Center' software

View File

@@ -19,16 +19,16 @@ sources.fileextensions = "qtcreator.qdoc addressbook-sdk.qdoc"
qhp.projects = QtCreator
qhp.QtCreator.file = qtcreator.qhp
qhp.QtCreator.namespace = com.nokia.qtcreator.1280
qhp.QtCreator.namespace = com.nokia.qtcreator.1291
qhp.QtCreator.virtualFolder = doc
qhp.QtCreator.indexTitle = Qt Creator
qhp.QtCreator.indexRoot =
qhp.QtCreator.extraFiles = classic.css \
images/qt-logo.png \
images/qtcreator-screenshots.png
qhp.QtCreator.filterAttributes = qtcreator 1.2.80
qhp.QtCreator.customFilters.QtCreator.name = Qt Creator 1.2.80
qhp.QtCreator.customFilters.QtCreator.filterAttributes = qtcreator 1.2.80
qhp.QtCreator.filterAttributes = qtcreator 1.2.91
qhp.QtCreator.customFilters.QtCreator.name = Qt Creator 1.2.91
qhp.QtCreator.customFilters.QtCreator.filterAttributes = qtcreator 1.2.91
# macros.qdocconf
@@ -211,5 +211,5 @@ HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
"<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
"<td width=\"40%\" align=\"left\">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
"<td width=\"20%\" align=\"center\"><a href=\"trademarks.html\">Trademarks</a></td>\n" \
"<td width=\"40%\" align=\"right\"><div align=\"right\">Qt Creator 1.2.80</div></td>\n" \
"<td width=\"40%\" align=\"right\"><div align=\"right\">Qt Creator 1.2.91</div></td>\n" \
"</tr></table></div></address>"

File diff suppressed because it is too large Load Diff

View File

@@ -184,8 +184,8 @@
<key>CFBundleIdentifier</key>
<string>com.nokia.qtcreator</string>
<key>CFBundleVersion</key>
<string>1.2.80</string>
<string>1.2.91</string>
<key>CFBundleShortVersionString</key>
<string>1.2.80</string>
<string>1.2.91</string>
</dict>
</plist>

View File

@@ -17,7 +17,7 @@ win32 {
} else:macx {
CONFIG(debug, debug|release):LIBS *= -lExtensionSystem_debug -lAggregation_debug
else:LIBS *= -lExtensionSystem -lAggregation
LIBS += -framework CoreFoundation
ICON = qtcreator.icns
QMAKE_INFO_PLIST = Info.plist
FILETYPES.files = profile.icns prifile.icns

View File

@@ -48,6 +48,20 @@
#ifdef Q_OS_MAC
# include <sys/resource.h>
# include <CoreFoundation/CoreFoundation.h>
// Helper function CoreFoundation -> Qt
static QString stringFromCFString(CFStringRef value) {
QString retVal;
CFIndex maxLength = 2 * CFStringGetLength(value) + 1/*zero term*/; // max UTF8
char *cstring = new char[maxLength];
if (CFStringGetCString(CFStringRef(value), cstring, maxLength, kCFStringEncodingUTF8)) {
retVal = QString::fromUtf8(cstring);
}
delete cstring;
return retVal;
}
#endif
enum { OptionIndent = 4, DescriptionIndent = 24 };
@@ -216,7 +230,29 @@ int main(int argc, char **argv)
QTranslator translator;
QTranslator qtTranslator;
const QString &locale = QLocale::system().name();
QString locale = QLocale::system().name();
#ifdef Q_OS_MAC
// because QLocale's system locale is basically useless on the Mac.
// Try to get the real system setting via core foundation
CFLocaleRef maclocale = CFLocaleCopyCurrent();
CFTypeRef value = CFLocaleGetValue(maclocale, kCFLocaleLanguageCode);
QString preferredLanguage = stringFromCFString(CFStringRef(value));
if (!preferredLanguage.isEmpty())
locale = preferredLanguage;
CFRelease(maclocale);
CFArrayRef languages = (CFArrayRef)CFPreferencesCopyValue(
CFSTR("AppleLanguages"),
kCFPreferencesAnyApplication,
kCFPreferencesCurrentUser,
kCFPreferencesAnyHost);
// CFShow(languages);
if (CFArrayGetCount(languages) > 0) {
QString preferredLanguage = stringFromCFString(CFStringRef(CFArrayGetValueAtIndex(languages, 0)));
if (!preferredLanguage.isEmpty())
locale = preferredLanguage;
}
CFRelease(languages);
#endif
const QString &creatorTrPath = QCoreApplication::applicationDirPath()
+ QLatin1String(SHARE_PATH "/translations");
if (translator.load(QLatin1String("qtcreator_") + locale, creatorTrPath)) {

View File

@@ -1,4 +1,4 @@
<plugin name="BinEditor" version="1.2.80" compatVersion="1.2.80">
<plugin name="BinEditor" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,7 +19,7 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Binary editor component.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
<dependency name="TextEditor" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -33,6 +33,9 @@
#include <texteditor/texteditorconstants.h>
#include <QtCore/QByteArrayMatcher>
#include <QtCore/QFile>
#include <QtCore/QTemporaryFile>
#include <QtGui/QApplication>
#include <QtGui/QClipboard>
#include <QtGui/QFontMetrics>
@@ -77,6 +80,7 @@ BinEditor::BinEditor(QWidget *parent)
{
m_ieditor = 0;
m_inLazyMode = false;
m_baseAddr = 0;
m_blockSize = 4096;
init();
m_unmodifiedState = 0;
@@ -88,7 +92,7 @@ BinEditor::BinEditor(QWidget *parent)
m_cursorVisible = false;
m_caseSensitiveSearch = false;
setFocusPolicy(Qt::WheelFocus);
m_addressString = QString(9, QLatin1Char(':'));
m_addressString = QString(16 + 3, QLatin1Char(':'));
}
BinEditor::~BinEditor()
@@ -108,7 +112,7 @@ void BinEditor::init()
m_numVisibleLines = viewport()->height() / m_lineHeight;
m_textWidth = 16 * m_charWidth + m_charWidth;
int m_numberWidth = fm.width(QChar(QLatin1Char('9')));
m_labelWidth = 8 * m_numberWidth + 2 * m_charWidth;
m_labelWidth = 16 * m_numberWidth + 4 * m_charWidth;
int expectedCharWidth = m_columnWidth / 3;
const char *hex = "0123456789abcdef";
@@ -129,13 +133,19 @@ void BinEditor::init()
}
void BinEditor::addLazyData(int block, const QByteArray &data)
void BinEditor::addLazyData(quint64 block, const QByteArray &data)
{
Q_ASSERT(m_inLazyMode);
Q_ASSERT(data.size() == m_blockSize);
m_lazyData.insert(block, data);
m_lazyRequests.remove(block);
viewport()->update();
const quint64 addr = block * m_blockSize;
if (addr >= m_baseAddr && addr <= m_baseAddr + m_size - 1) {
if (m_lazyData.size() * m_blockSize >= 64 * 1024 * 1024)
m_lazyData.clear();
const int translatedBlock = (addr - m_baseAddr) / m_blockSize;
m_lazyData.insert(translatedBlock, data);
m_lazyRequests.remove(translatedBlock);
viewport()->update();
}
}
bool BinEditor::requestDataAt(int pos, bool synchronous) const
@@ -144,11 +154,15 @@ bool BinEditor::requestDataAt(int pos, bool synchronous) const
return true;
int block = pos / m_blockSize;
QMap<int, QByteArray>::const_iterator it = m_lazyData.find(block);
QMap<int, QByteArray>::const_iterator it = m_modifiedData.find(block);
if (it != m_modifiedData.constEnd())
return true;
it = m_lazyData.find(block);
if (it == m_lazyData.end()) {
if (!m_lazyRequests.contains(block)) {
m_lazyRequests.insert(block);
emit const_cast<BinEditor*>(this)->lazyDataRequested(block, synchronous);
emit const_cast<BinEditor*>(this)->
lazyDataRequested(m_baseAddr / m_blockSize + block, synchronous);
if (!m_lazyRequests.contains(block))
return true; // synchronous data source
}
@@ -162,10 +176,8 @@ char BinEditor::dataAt(int pos) const
{
if (!m_inLazyMode)
return m_data.at(pos);
int block = pos / m_blockSize;
return m_lazyData.value(block, m_emptyBlock).at(pos - (block*m_blockSize));
return blockData(block).at(pos - (block*m_blockSize));
}
void BinEditor::changeDataAt(int pos, char c)
@@ -175,8 +187,17 @@ void BinEditor::changeDataAt(int pos, char c)
return;
}
int block = pos / m_blockSize;
if (m_lazyData.contains(block))
m_lazyData[block][pos - (block*m_blockSize)] = c;
QMap<int, QByteArray>::iterator it = m_modifiedData.find(block);
if (it != m_modifiedData.end()) {
it.value()[pos - (block*m_blockSize)] = c;
} else {
it = m_lazyData.find(block);
if (it != m_lazyData.end()) {
QByteArray data = it.value();
data[pos - (block*m_blockSize)] = c;
m_modifiedData.insert(block, data);
}
}
}
QByteArray BinEditor::dataMid(int from, int length) const
@@ -189,7 +210,7 @@ QByteArray BinEditor::dataMid(int from, int length) const
QByteArray data;
do {
data += m_lazyData.value(block++, m_emptyBlock);
data += blockData(block++);
} while (block * m_blockSize < end);
return data.mid(from - ((from / m_blockSize) * m_blockSize), length);
@@ -203,7 +224,9 @@ QByteArray BinEditor::blockData(int block) const
data.resize(m_blockSize);
return data;
}
return m_lazyData.value(block, m_emptyBlock);
QMap<int, QByteArray>::const_iterator it = m_modifiedData.find(block);
return it != m_modifiedData.constEnd()
? it.value() : m_lazyData.value(block, m_emptyBlock);
}
@@ -294,7 +317,9 @@ bool BinEditor::isReadOnly() const
void BinEditor::setData(const QByteArray &data)
{
m_inLazyMode = false;
m_baseAddr = 0;
m_lazyData.clear();
m_modifiedData.clear();
m_lazyRequests.clear();
m_data = data;
m_size = data.size();
@@ -316,21 +341,49 @@ QByteArray BinEditor::data() const
return m_data;
}
bool BinEditor::applyModifications(QByteArray &data) const
bool BinEditor::save(const QString &oldFileName, const QString &newFileName)
{
if (!m_inLazyMode) {
data = m_data;
return true;
}
if (data.size() != m_size)
return false;
for (QMap<int,QByteArray>::const_iterator it = m_lazyData.begin(); it != m_lazyData.end(); ++it) {
::memcpy(data.data() + it.key() * m_blockSize, it->constData(), m_blockSize);
if (m_inLazyMode) {
if (oldFileName != newFileName) {
QString tmpName;
{
QTemporaryFile tmp;
if (!tmp.open())
return false;
tmpName = tmp.fileName();
}
if (!QFile::copy(oldFileName, tmpName))
return false;
if (QFile::exists(newFileName) && !QFile::remove(newFileName))
return false;
if (!QFile::rename(tmpName, newFileName))
return false;
}
QFile output(newFileName);
if (!output.open(QIODevice::ReadWrite)) // QtBug: WriteOnly truncates.
return false;
const qint64 size = output.size();
for (QMap<int, QByteArray>::const_iterator it = m_modifiedData.constBegin();
it != m_modifiedData.constEnd(); ++it) {
if (!output.seek(it.key() * m_blockSize))
return false;
if (output.write(it.value()) < m_blockSize)
return false;
}
if (size % m_blockSize != 0 && !output.resize(size))
return false;
} else {
QFile output(newFileName);
if (!output.open(QIODevice::WriteOnly | QIODevice::Truncate))
return false;
if (output.write(m_data) < m_size)
return false;
}
setModified(false);
return true;
}
void BinEditor::setLazyData(int cursorPosition, int size, int blockSize)
void BinEditor::setLazyData(quint64 startAddr, int range, int blockSize)
{
m_inLazyMode = true;
m_blockSize = blockSize;
@@ -338,8 +391,16 @@ void BinEditor::setLazyData(int cursorPosition, int size, int blockSize)
m_emptyBlock = QByteArray(blockSize, '\0');
m_data.clear();
m_lazyData.clear();
m_modifiedData.clear();
m_lazyRequests.clear();
m_size = size;
// In lazy mode, users can edit data in the range
// [startAddr - range/2, startAddr + range/2].
m_baseAddr = static_cast<quint64>(range/2) > startAddr
? 0 : startAddr - range/2;
m_baseAddr = (m_baseAddr / blockSize) * blockSize;
m_size = m_baseAddr != 0 && static_cast<quint64>(range) >= -m_baseAddr
? -m_baseAddr : range;
m_unmodifiedState = 0;
m_undoStack.clear();
@@ -347,7 +408,7 @@ void BinEditor::setLazyData(int cursorPosition, int size, int blockSize)
init();
m_cursorPosition = cursorPosition;
m_cursorPosition = startAddr - m_baseAddr;
verticalScrollBar()->setValue(m_cursorPosition / 16);
emit cursorPositionChanged(m_cursorPosition);
@@ -471,8 +532,9 @@ int BinEditor::dataIndexOf(const QByteArray &pattern, int from, bool caseSensiti
QByteArrayMatcher matcher(pattern);
int block = from / m_blockSize;
while (from < m_size) {
const int end =
qMin<qint64>(static_cast<qint64>(from) + SearchStride, m_size);
while (from < end) {
if (!requestDataAt(block * m_blockSize, true))
return -1;
QByteArray data = blockData(block);
@@ -488,7 +550,7 @@ int BinEditor::dataIndexOf(const QByteArray &pattern, int from, bool caseSensiti
++block;
from = block * m_blockSize - trailing;
}
return -1;
return end == m_size ? -1 : -2;
}
int BinEditor::dataLastIndexOf(const QByteArray &pattern, int from, bool caseSensitive) const
@@ -505,8 +567,8 @@ int BinEditor::dataLastIndexOf(const QByteArray &pattern, int from, bool caseSen
char *b = buffer.data();
int block = from / m_blockSize;
while (from > 0) {
const int lowerBound = qMax(0, from - SearchStride);
while (from > lowerBound) {
if (!requestDataAt(block * m_blockSize, true))
return -1;
QByteArray data = blockData(block);
@@ -522,11 +584,12 @@ int BinEditor::dataLastIndexOf(const QByteArray &pattern, int from, bool caseSen
--block;
from = block * m_blockSize + (m_blockSize-1) + trailing;
}
return -1;
return lowerBound == 0 ? -1 : -2;
}
int BinEditor::find(const QByteArray &pattern_arg, int from, QTextDocument::FindFlags findFlags)
int BinEditor::find(const QByteArray &pattern_arg, int from,
QTextDocument::FindFlags findFlags)
{
if (pattern_arg.isEmpty())
return 0;
@@ -541,7 +604,7 @@ int BinEditor::find(const QByteArray &pattern_arg, int from, QTextDocument::Find
bool backwards = (findFlags & QTextDocument::FindBackward);
int found = backwards ? dataLastIndexOf(pattern, from, caseSensitiveSearch)
: dataIndexOf(pattern, from, caseSensitiveSearch);
int foundHex = -1;
QByteArray hexPattern = calculateHexPattern(pattern_arg);
if (!hexPattern.isEmpty()) {
@@ -549,7 +612,8 @@ int BinEditor::find(const QByteArray &pattern_arg, int from, QTextDocument::Find
: dataIndexOf(hexPattern, from);
}
int pos = (found >= 0 && (foundHex < 0 || found < foundHex)) ? found : foundHex;
int pos = foundHex == -1 || (found >= 0 && (foundHex == -2 || found < foundHex))
? found : foundHex;
if (pos >= m_size)
pos = -1;
@@ -593,20 +657,21 @@ void BinEditor::drawItems(QPainter *painter, int x, int y, const QString &itemSt
}
}
QString BinEditor::addressString(uint address)
QString BinEditor::addressString(quint64 address)
{
QChar *addressStringData = m_addressString.data();
const char *hex = "0123456789abcdef";
for (int h = 0; h < 4; ++h) {
int shift = 4*(7-h);
addressStringData[h] = hex[(address & (0xf<<shift))>>shift];
}
for (int h = 4; h < 8; ++h) {
int shift = 4*(7-h);
addressStringData[h+1] = hex[(address & (0xf<<shift))>>shift];
// Take colons into account.
const int indices[16] = {
0, 1, 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18
};
for (int b = 0; b < 8; ++b) {
addressStringData[indices[15 - b*2]] = hex[(address >> (8*b)) & 0xf];
addressStringData[indices[14 - b*2]] = hex[(address >> (8*b + 4)) & 0xf];
}
return m_addressString;
}
void BinEditor::paintEvent(QPaintEvent *e)
@@ -663,7 +728,8 @@ void BinEditor::paintEvent(QPaintEvent *e)
continue;
painter.drawText(-xoffset, i * m_lineHeight + m_ascent, addressString(((uint) line) * 16));
painter.drawText(-xoffset, i * m_lineHeight + m_ascent,
addressString(m_baseAddr + ((uint) line) * 16));
int cursor = -1;
if (line * 16 <= m_cursorPosition && m_cursorPosition < line * 16 + 16)

View File

@@ -31,8 +31,10 @@
#define BINEDITOR_H
#include <QtCore/QBasicTimer>
#include <QtCore/QMap>
#include <QtCore/QSet>
#include <QtCore/QStack>
#include <QtCore/QString>
#include <QtGui/QAbstractScrollArea>
#include <QtGui/QTextDocument>
@@ -64,10 +66,10 @@ public:
inline int dataSize() const { return m_size; }
inline bool inLazyMode() const { return m_inLazyMode; }
Q_INVOKABLE void setLazyData(int cursorPosition, int size, int blockSize = 4096);
Q_INVOKABLE void setLazyData(quint64 startAddr, int range, int blockSize = 4096);
inline int lazyDataBlockSize() const { return m_blockSize; }
Q_INVOKABLE void addLazyData(int block, const QByteArray &data);
bool applyModifications(QByteArray &data) const;
Q_INVOKABLE void addLazyData(quint64 block, const QByteArray &data);
bool save(const QString &oldFileName, const QString &newFileName);
void zoomIn(int range = 1);
void zoomOut(int range = 1);
@@ -86,7 +88,8 @@ public:
void setReadOnly(bool);
bool isReadOnly() const;
int find(const QByteArray &pattern, int from = 0, QTextDocument::FindFlags findFlags = 0);
int find(const QByteArray &pattern, int from = 0,
QTextDocument::FindFlags findFlags = 0);
void selectAll();
void clear();
@@ -106,8 +109,9 @@ public:
bool isUndoAvailable() const { return m_undoStack.size(); }
bool isRedoAvailable() const { return m_redoStack.size(); }
QString addressString(uint address);
QString addressString(quint64 address);
static const int SearchStride = 1024 * 1024;
public Q_SLOTS:
void setFontSettings(const TextEditor::FontSettings &fs);
@@ -121,7 +125,7 @@ Q_SIGNALS:
void copyAvailable(bool);
void cursorPositionChanged(int position);
void lazyDataRequested(int block, bool syncronous);
void lazyDataRequested(quint64 block, bool synchronous);
protected:
void scrollContentsBy(int dx, int dy);
@@ -142,6 +146,7 @@ private:
QByteArray m_data;
QMap <int, QByteArray> m_lazyData;
int m_blockSize;
QMap <int, QByteArray> m_modifiedData;
mutable QSet<int> m_lazyRequests;
QByteArray m_emptyBlock;
QByteArray m_lowerBlock;
@@ -169,6 +174,7 @@ private:
int m_numLines;
int m_numVisibleLines;
quint64 m_baseAddr;
bool m_cursorVisible;
int m_cursorPosition;

View File

@@ -61,7 +61,11 @@ class BinEditorFind : public Find::IFindSupport
{
Q_OBJECT
public:
BinEditorFind(BinEditor *editor) { m_editor = editor; m_incrementalStartPos = -1; }
BinEditorFind(BinEditor *editor)
{
m_editor = editor;
m_incrementalStartPos = m_contPos = -1;
}
~BinEditorFind() {}
bool supportsReplace() const { return false; }
@@ -70,7 +74,11 @@ public:
return IFindSupport::FindBackward | IFindSupport::FindCaseSensitively;
}
void resetIncrementalSearch() { m_incrementalStartPos = -1; }
void resetIncrementalSearch()
{
m_incrementalStartPos = m_contPos = -1;
}
void clearResults() { m_editor->highlightSearchResults(QByteArray()); }
QString currentFindString() const { return QString(); }
QString completedFindString() const { return QString(); }
@@ -82,41 +90,68 @@ public:
return pos;
}
int found = m_editor->find(pattern, pos, Find::IFindSupport::textDocumentFlagsForFindFlags(findFlags));
if (found < 0)
found = m_editor->find(pattern,
(findFlags & Find::IFindSupport::FindBackward)?m_editor->dataSize()-1:0,
Find::IFindSupport::textDocumentFlagsForFindFlags(findFlags));
return found;
return m_editor->find(pattern, pos, Find::IFindSupport::textDocumentFlagsForFindFlags(findFlags));
}
bool findIncremental(const QString &txt, Find::IFindSupport::FindFlags findFlags) {
Result findIncremental(const QString &txt, Find::IFindSupport::FindFlags findFlags) {
QByteArray pattern = txt.toLatin1();
if (pattern != m_lastPattern)
resetIncrementalSearch(); // Because we don't search for nibbles.
m_lastPattern = pattern;
if (m_incrementalStartPos < 0)
m_incrementalStartPos = m_editor->selectionStart();
int pos = m_incrementalStartPos;
if (m_contPos == -1)
m_contPos = m_incrementalStartPos;
findFlags &= ~Find::IFindSupport::FindBackward;
int found = find(pattern, pos, findFlags);
if (found >= 0)
int found = find(pattern, m_contPos, findFlags);
Result result;
if (found >= 0) {
result = Found;
m_editor->highlightSearchResults(pattern, Find::IFindSupport::textDocumentFlagsForFindFlags(findFlags));
else
m_editor->highlightSearchResults(QByteArray(), 0);
return found >= 0;
m_contPos = -1;
} else {
if (found == -2) {
result = NotYetFound;
m_contPos +=
findFlags & Find::IFindSupport::FindBackward
? -BinEditor::SearchStride : BinEditor::SearchStride;
} else {
result = NotFound;
m_contPos = -1;
m_editor->highlightSearchResults(QByteArray(), 0);
}
}
return result;
}
bool findStep(const QString &txt, Find::IFindSupport::FindFlags findFlags) {
Result findStep(const QString &txt, Find::IFindSupport::FindFlags findFlags) {
QByteArray pattern = txt.toLatin1();
bool wasReset = (m_incrementalStartPos < 0);
int pos = m_editor->cursorPosition();
if (findFlags & Find::IFindSupport::FindBackward)
pos = m_editor->selectionStart()-1;
int found = find(pattern, pos, findFlags);
if (found)
if (m_contPos == -1) {
m_contPos = m_editor->cursorPosition();
if (findFlags & Find::IFindSupport::FindBackward)
m_contPos = m_editor->selectionStart()-1;
}
int found = find(pattern, m_contPos, findFlags);
Result result;
if (found >= 0) {
result = Found;
m_incrementalStartPos = found;
if (wasReset && found >= 0)
m_editor->highlightSearchResults(pattern, Find::IFindSupport::textDocumentFlagsForFindFlags(findFlags));
return found >= 0;
m_contPos = -1;
if (wasReset)
m_editor->highlightSearchResults(pattern, Find::IFindSupport::textDocumentFlagsForFindFlags(findFlags));
} else if (found == -2) {
result = NotYetFound;
m_contPos += findFlags & Find::IFindSupport::FindBackward
? -BinEditor::SearchStride : BinEditor::SearchStride;
} else {
result = NotFound;
m_contPos = -1;
}
return result;
}
bool replaceStep(const QString &, const QString &,
Find::IFindSupport::FindFlags) { return false;}
int replaceAll(const QString &, const QString &,
@@ -125,6 +160,8 @@ public:
private:
BinEditor *m_editor;
int m_incrementalStartPos;
int m_contPos; // Only valid if last result was NotYetFound.
QByteArray m_lastPattern;
};
@@ -137,48 +174,35 @@ public:
m_mimeType(QLatin1String(BINEditor::Constants::C_BINEDITOR_MIMETYPE))
{
m_editor = parent;
connect(m_editor, SIGNAL(lazyDataRequested(int, bool)), this, SLOT(provideData(int)));
connect(m_editor, SIGNAL(lazyDataRequested(quint64, bool)), this, SLOT(provideData(quint64)));
}
~BinEditorFile() {}
virtual QString mimeType() const { return m_mimeType; }
bool save(const QString &fileName = QString()) {
QFile file(fileName);
QByteArray data;
if (m_editor->inLazyMode()) {
QFile read(m_fileName);
if (!read.open(QIODevice::ReadOnly))
return false;
data = read.readAll();
read.close();
if (!m_editor->applyModifications(data))
return false;
} else {
data = m_editor->data();
}
if (file.open(QIODevice::WriteOnly)) {
file.write(data);
file.close();
m_editor->setModified(false);
m_editor->editorInterface()->setDisplayName(QFileInfo(fileName).fileName());
if (m_editor->save(m_fileName, fileName)) {
m_fileName = fileName;
m_editor->editorInterface()->
setDisplayName(QFileInfo(fileName).fileName());
emit changed();
return true;
} else {
return false;
}
return false;
}
bool open(const QString &fileName) {
QFile file(fileName);
if (file.open(QIODevice::ReadOnly)) {
m_fileName = fileName;
if (file.isSequential()) {
if (file.isSequential() && file.size() <= 64 * 1024 * 1024) {
m_editor->setData(file.readAll());
} else {
m_editor->setLazyData(0, file.size());
m_editor->editorInterface()->setDisplayName(QFileInfo(fileName).fileName());
m_editor->setLazyData(0, qMin(file.size(),
static_cast<qint64>(INT_MAX-16)));
m_editor->editorInterface()->
setDisplayName(QFileInfo(fileName).fileName());
}
file.close();
return true;
@@ -187,7 +211,7 @@ public:
}
private slots:
void provideData(int block) {
void provideData(quint64 block) {
QFile file(m_fileName);
if (file.open(QIODevice::ReadOnly)) {
int blockSize = m_editor->lazyDataBlockSize();

View File

@@ -1,4 +1,4 @@
<plugin name="Bookmarks" version="1.2.80" compatVersion="1.2.80">
<plugin name="Bookmarks" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,8 +19,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Bookmarks in text editors.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="Core" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="ProjectExplorer" version="1.2.91"/>
<dependency name="Core" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="CMakeProjectManager" version="1.2.80" compatVersion="1.2.80">
<plugin name="CMakeProjectManager" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,9 +19,9 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>CMake support</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="CppTools" version="1.2.80"/>
<dependency name="CppEditor" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="ProjectExplorer" version="1.2.91"/>
<dependency name="CppTools" version="1.2.91"/>
<dependency name="CppEditor" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="Core" version="1.2.80" compatVersion="1.2.80">
<plugin name="Core" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>

View File

@@ -35,7 +35,7 @@ namespace Constants {
#define IDE_VERSION_MAJOR 1
#define IDE_VERSION_MINOR 2
#define IDE_VERSION_RELEASE 80
#define IDE_VERSION_RELEASE 91
#define STRINGIFY_INTERNAL(x) #x
#define STRINGIFY(x) STRINGIFY_INTERNAL(x)

View File

@@ -40,6 +40,7 @@ class CORE_EXPORT IEditor : public IContext
{
Q_OBJECT
public:
IEditor(QObject *parent = 0) : IContext(parent) {}
virtual ~IEditor() {}

View File

@@ -160,7 +160,7 @@ MainWindow::MainWindow() :
QCoreApplication::setOrganizationName(QLatin1String("Nokia"));
QSettings::setDefaultFormat(QSettings::IniFormat);
QString baseName = qApp->style()->objectName();
#ifdef Q_WS_X11
#ifdef Q_WS_X11
if (baseName == QLatin1String("windows")) {
// Sometimes we get the standard windows 95 style as a fallback
// e.g. if we are running on a KDE4 desktop
@@ -325,7 +325,7 @@ bool MainWindow::init(QString *errorMessage)
void MainWindow::modeChanged(Core::IMode *mode)
{
if (mode == m_outputMode) {
if (mode == m_outputMode) {
int idx = OutputPaneManager::instance()->m_widgetComboBox->itemData(OutputPaneManager::instance()->m_widgetComboBox->currentIndex()).toInt();
IOutputPane *out = OutputPaneManager::instance()->m_pageMap.value(idx);
if (out && out->canFocus())
@@ -678,6 +678,7 @@ void MainWindow::registerDefaultActions()
cmd = am->registerAction(m_optionsAction, Constants::OPTIONS, m_globalContext);
#ifdef Q_WS_MAC
cmd->setDefaultKeySequence(QKeySequence("Ctrl+,"));
cmd->action()->setMenuRole(QAction::PreferencesRole);
#endif
mtools->addAction(cmd, Constants::G_DEFAULT_THREE);
connect(m_optionsAction, SIGNAL(triggered()), this, SLOT(showOptionsDialog()));
@@ -735,7 +736,11 @@ void MainWindow::registerDefaultActions()
cmd = am->registerAction(tmpaction, Constants::ABOUT_QTCREATOR, m_globalContext);
mhelp->addAction(cmd, Constants::G_HELP_ABOUT);
tmpaction->setEnabled(true);
#ifdef Q_WS_MAC
cmd->action()->setMenuRole(QAction::ApplicationSpecificRole);
#endif
connect(tmpaction, SIGNAL(triggered()), this, SLOT(aboutQtCreator()));
//About Plugins Action
tmpaction = new QAction(tr("About &Plugins..."), this);
cmd = am->registerAction(tmpaction, Constants::ABOUT_PLUGINS, m_globalContext);

View File

@@ -1,4 +1,4 @@
<plugin name="CodePaster" version="1.2.80" compatVersion="1.2.80">
<plugin name="CodePaster" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,8 +19,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Codepaster plugin for pushing/fetching diff from server</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="Core" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="ProjectExplorer" version="1.2.91"/>
<dependency name="Core" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="CppEditor" version="1.2.80" compatVersion="1.2.80">
<plugin name="CppEditor" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,8 +19,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>C/C++ editor component.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="CppTools" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="CppTools" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -73,6 +73,8 @@ void CppHighlighter::highlightBlock(const QString &text)
userData->setCollapseMode(TextBlockUserData::NoCollapse);
}
TextEditDocumentLayout::clearParentheses(currentBlock());
if (text.length()) // the empty line can still contain whitespace
setFormat(0, text.length(), visualSpaceFormat);
return;
}
@@ -171,7 +173,7 @@ void CppHighlighter::highlightBlock(const QString &text)
}
// mark the trailing white spaces
if (! tokens.isEmpty()) {
{
const SimpleToken tk = tokens.last();
const int lastTokenEnd = tk.position() + tk.length();
if (text.length() > lastTokenEnd)

View File

@@ -1,4 +1,4 @@
<plugin name="CppTools" version="1.2.80" compatVersion="1.2.80">
<plugin name="CppTools" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,8 +19,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Tools for analyzing C/C++ code.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="QuickOpen" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="ProjectExplorer" version="1.2.91"/>
<dependency name="QuickOpen" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="CVS" version="1.2.80" compatVersion="1.2.80">
<plugin name="CVS" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,9 +19,9 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>CVS integration.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="Core" version="1.2.80"/>
<dependency name="VCSBase" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="ProjectExplorer" version="1.2.91"/>
<dependency name="Core" version="1.2.91"/>
<dependency name="VCSBase" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="Debugger" version="1.2.80" compatVersion="1.2.80">
<plugin name="Debugger" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,10 +19,10 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Debugger integration.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="CppEditor" version="1.2.80"/><!-- Debugger plugin adds items to the editor's context menu -->
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="Core" version="1.2.80"/>
<dependency name="Find" version="1.2.80"/>
<dependency name="CppEditor" version="1.2.91"/><!-- Debugger plugin adds items to the editor's context menu -->
<dependency name="ProjectExplorer" version="1.2.91"/>
<dependency name="Core" version="1.2.91"/>
<dependency name="Find" version="1.2.91"/>
</dependencyList>
<argumentList>
<argument name="-disable-cdb">Disable Cdb debugger engine</argument>

View File

@@ -563,11 +563,11 @@ void CdbDebugEnginePrivate::clearDisplay()
m_debuggerManagerAccess->registerHandler()->removeAll();
}
bool CdbDebugEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
void CdbDebugEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
{
if (m_d->m_hDebuggeeProcess) {
warning(QLatin1String("Internal error: Attempt to start debugger while another process is being debugged."));
return false;
emit startFailed();
}
m_d->clearDisplay();
@@ -627,7 +627,11 @@ bool CdbDebugEngine::startDebugger(const QSharedPointer<DebuggerStartParameters>
} else {
warning(errorMessage);
}
return rc;
if (rc)
emit startSuccessful();
else
emit startFailed();
}
bool CdbDebugEngine::startAttachDebugger(qint64 pid, DebuggerStartMode sm, QString *errorMessage)

View File

@@ -62,7 +62,7 @@ public:
virtual void shutdown();
virtual void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
virtual bool startDebugger(const QSharedPointer<DebuggerStartParameters> &startParameters);
virtual void startDebugger(const QSharedPointer<DebuggerStartParameters> &startParameters);
virtual void exitDebugger();
virtual void detachDebugger();
virtual void updateWatchData(const WatchData &data);

View File

@@ -87,5 +87,7 @@ include(cdb/cdb.pri)
include(gdb/gdb.pri)
include(script/script.pri)
include(tcf/tcf.pri)
include(symbian/symbian.pri)
include(shared/shared.pri)
OTHER_FILES += Debugger.pluginspec

View File

@@ -57,7 +57,7 @@ namespace Internal {
//
///////////////////////////////////////////////////////////////////////
/*!
/*!
\class MemoryViewAgent
Objects form this class are created in response to user actions in
@@ -84,30 +84,30 @@ MemoryViewAgent::~MemoryViewAgent()
m_editor->deleteLater();
}
void MemoryViewAgent::init(quint64 addr)
void MemoryViewAgent::init(quint64 addr)
{
Core::EditorManager *editorManager = Core::EditorManager::instance();
QString titlePattern = tr("Memory $");
m_editor = editorManager->openEditorWithContents(
Core::Constants::K_DEFAULT_BINARY_EDITOR,
&titlePattern);
connect(m_editor->widget(), SIGNAL(lazyDataRequested(int,bool)),
this, SLOT(fetchLazyData(int,bool)));
connect(m_editor->widget(), SIGNAL(lazyDataRequested(quint64,bool)),
this, SLOT(fetchLazyData(quint64,bool)));
editorManager->activateEditor(m_editor);
QMetaObject::invokeMethod(m_editor->widget(), "setLazyData",
Q_ARG(int, addr), Q_ARG(int, INT_MAX), Q_ARG(int, BinBlockSize));
Q_ARG(quint64, addr), Q_ARG(int, 1024 * 1024), Q_ARG(int, BinBlockSize));
}
void MemoryViewAgent::fetchLazyData(int block, bool sync)
void MemoryViewAgent::fetchLazyData(quint64 block, bool sync)
{
Q_UNUSED(sync); // FIXME: needed support for incremental searching
m_engine->fetchMemory(this, BinBlockSize * block, BinBlockSize);
m_engine->fetchMemory(this, BinBlockSize * block, BinBlockSize);
}
void MemoryViewAgent::addLazyData(quint64 addr, const QByteArray &ba)
{
QMetaObject::invokeMethod(m_editor->widget(), "addLazyData",
Q_ARG(int, addr / BinBlockSize), Q_ARG(QByteArray, ba));
Q_ARG(quint64, addr / BinBlockSize), Q_ARG(QByteArray, ba));
}

View File

@@ -63,7 +63,7 @@ public slots:
// Called from Engine
void addLazyData(quint64 addr, const QByteArray &data);
// Called from Editor
void fetchLazyData(int block, bool sync);
void fetchLazyData(quint64 block, bool sync);
private:
void init(quint64 startaddr);

View File

@@ -103,6 +103,8 @@ namespace Internal {
IDebuggerEngine *createGdbEngine(DebuggerManager *parent, QList<Core::IOptionsPage*> *);
IDebuggerEngine *createSymbianEngine(DebuggerManager *parent, QList<Core::IOptionsPage*> *);
QDebug operator<<(QDebug str, const DebuggerStartParameters &p)
{
QDebug nospace = str.nospace();
@@ -180,9 +182,10 @@ void DebuggerStartParameters::clear()
///////////////////////////////////////////////////////////////////////
static IDebuggerEngine *gdbEngine = 0;
static IDebuggerEngine *winEngine = 0;
static IDebuggerEngine *scriptEngine = 0;
static IDebuggerEngine *symbianEngine = 0;
static IDebuggerEngine *tcfEngine = 0;
static IDebuggerEngine *winEngine = 0;
DebuggerManager::DebuggerManager()
: m_startParameters(new DebuggerStartParameters),
@@ -195,9 +198,10 @@ DebuggerManager::~DebuggerManager()
{
#define doDelete(ptr) delete ptr; ptr = 0
doDelete(gdbEngine);
doDelete(winEngine);
doDelete(scriptEngine);
doDelete(symbianEngine);
doDelete(tcfEngine);
doDelete(winEngine);
#undef doDelete
}
@@ -444,6 +448,8 @@ QList<Core::IOptionsPage*> DebuggerManager::initializeEngines(unsigned enabledTy
QList<Core::IOptionsPage*> rc;
if (enabledTypeFlags & GdbEngineType)
gdbEngine = createGdbEngine(this, &rc);
if (enabledTypeFlags & SymbianEngineType)
symbianEngine = createSymbianEngine(this, &rc);
winEngine = createWinEngine(this, (enabledTypeFlags & CdbEngineType), &rc);
if (enabledTypeFlags & ScriptEngineType)
scriptEngine = createScriptEngine(this, &rc);
@@ -693,9 +699,10 @@ void DebuggerManager::updateWatchData(const WatchData &data)
m_engine->updateWatchData(data);
}
static inline QString msgEngineNotAvailable(const char *engine)
static QString msgEngineNotAvailable(const char *engine)
{
return DebuggerManager::tr("The application requires the debugger engine '%1', which is disabled.").arg(QLatin1String(engine));
return DebuggerManager::tr("The application requires the debugger engine '%1', "
"which is disabled.").arg(QLatin1String(engine));
}
static IDebuggerEngine *debuggerEngineForToolChain(ProjectExplorer::ToolChain::ToolChainType tc)
@@ -737,7 +744,16 @@ static IDebuggerEngine *determineDebuggerEngine(const QString &executable,
return scriptEngine;
}
if (IDebuggerEngine *tce = debuggerEngineForToolChain(static_cast<ProjectExplorer::ToolChain::ToolChainType>(toolChainType)))
if (executable.endsWith(_(".sym"))) {
if (!symbianEngine) {
*errorMessage = msgEngineNotAvailable("Symbian Engine");
return 0;
}
return symbianEngine;
}
if (IDebuggerEngine *tce = debuggerEngineForToolChain(
static_cast<ProjectExplorer::ToolChain::ToolChainType>(toolChainType)))
return tce;
#ifndef Q_OS_WIN
@@ -772,7 +788,8 @@ static IDebuggerEngine *determineDebuggerEngine(int /* pid */,
int toolChainType,
QString *errorMessage)
{
if (IDebuggerEngine *tce = debuggerEngineForToolChain(static_cast<ProjectExplorer::ToolChain::ToolChainType>(toolChainType)))
if (IDebuggerEngine *tce = debuggerEngineForToolChain(
static_cast<ProjectExplorer::ToolChain::ToolChainType>(toolChainType)))
return tce;
#ifdef Q_OS_WIN
// Preferably Windows debugger
@@ -844,11 +861,15 @@ void DebuggerManager::startNewDebugger(DebuggerRunControl *runControl,
setBusyCursor(false);
setStatus(DebuggerProcessStartingUp);
if (!m_engine->startDebugger(m_startParameters)) {
setStatus(DebuggerProcessNotReady);
debuggingFinished();
return;
}
connect(m_engine, SIGNAL(startFailed()), this, SLOT(startFailed()));
m_engine->startDebugger(m_startParameters);
}
void DebuggerManager::startFailed()
{
disconnect(m_engine, SIGNAL(startFailed()), this, SLOT(startFailed()));
setStatus(DebuggerProcessNotReady);
debuggingFinished();
}
void DebuggerManager::cleanupViews()
@@ -1334,14 +1355,18 @@ void DebuggerManager::modulesDockToggled(bool on)
void DebuggerManager::showDebuggerOutput(int channel, const QString &msg)
{
QTC_ASSERT(m_outputWindow, return);
m_outputWindow->showOutput(channel, msg);
if (m_outputWindow)
m_outputWindow->showOutput(channel, msg);
else
qDebug() << "OUTPUT: " << channel << msg;
}
void DebuggerManager::showDebuggerInput(int channel, const QString &msg)
{
QTC_ASSERT(m_outputWindow, return);
m_outputWindow->showInput(channel, msg);
if (m_outputWindow)
m_outputWindow->showInput(channel, msg);
else
qDebug() << "INPUT: " << channel << msg;
}

View File

@@ -172,12 +172,18 @@ class CdbDebugEngine;
struct CdbDebugEnginePrivate;
// Flags for initialization
enum DebuggerEngineTypeFlags {
GdbEngineType = 0x1,
ScriptEngineType = 0x2,
CdbEngineType = 0x4,
TcfEngineType = 0x8,
AllEngineTypes = (GdbEngineType|ScriptEngineType|CdbEngineType|TcfEngineType)
enum DebuggerEngineTypeFlags
{
GdbEngineType = 0x01,
ScriptEngineType = 0x02,
CdbEngineType = 0x04,
TcfEngineType = 0x08,
SymbianEngineType = 0x10,
AllEngineTypes = GdbEngineType
| ScriptEngineType
| CdbEngineType
| TcfEngineType
| SymbianEngineType
};
// The construct below is not nice but enforces a bit of order. The
@@ -324,6 +330,8 @@ public slots:
void showStatusMessage(const QString &msg, int timeout = -1); // -1 forever
private slots:
void showDebuggerOutput(const QString &msg)
{ showDebuggerOutput(LogDebug, msg); }
void showDebuggerOutput(int channel, const QString &msg);
void showDebuggerInput(int channel, const QString &msg);
void showApplicationOutput(const QString &data);
@@ -343,6 +351,7 @@ private slots:
void attemptBreakpointSynchronization();
void reloadFullStack();
void stepByInstructionTriggered();
void startFailed();
private:
//
@@ -421,6 +430,7 @@ private:
BreakpointData *findBreakpoint(const QString &fileName, int lineNumber);
void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
// FIXME: Remove engine-specific state
QSharedPointer<DebuggerStartParameters> m_startParameters;
DebuggerRunControl *m_runControl;
QString m_dumperLib;

View File

@@ -43,7 +43,8 @@
#include <QtGui/QTextDocument>
using namespace Debugger::Internal;
namespace Debugger {
namespace Internal {
using ProjectExplorer::RunConfiguration;
using ProjectExplorer::RunControl;
@@ -120,10 +121,10 @@ QWidget *DebuggerRunner::configurationWidget(RunConfigurationPtr runConfiguratio
DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager,
DebuggerStartMode mode,
const QSharedPointer<DebuggerStartParameters> &startParameters,
QSharedPointer<ApplicationRunConfiguration> runConfiguration) :
RunControl(runConfiguration),
DebuggerStartMode mode,
const QSharedPointer<DebuggerStartParameters> &startParameters,
QSharedPointer<ApplicationRunConfiguration> runConfiguration)
: RunControl(runConfiguration),
m_mode(mode),
m_startParameters(startParameters),
m_manager(manager),
@@ -140,44 +141,44 @@ DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager,
Qt::QueuedConnection);
connect(this, SIGNAL(stopRequested()),
m_manager, SLOT(exitDebugger()));
if (!runConfiguration)
return;
// Enhance parameters by info from the project, but do not clobber
// arguments given in the dialogs
if (m_startParameters->executable.isEmpty())
m_startParameters->executable = runConfiguration->executable();
if (m_startParameters->environment.empty())
m_startParameters->environment = runConfiguration->environment().toStringList();
if (m_startParameters->workingDir.isEmpty())
m_startParameters->workingDir = runConfiguration->workingDirectory();
if (m_mode != StartExternal)
m_startParameters->processArgs = runConfiguration->commandLineArguments();
switch (m_startParameters->toolChainType) {
case ProjectExplorer::ToolChain::UNKNOWN:
case ProjectExplorer::ToolChain::INVALID:
m_startParameters->toolChainType = runConfiguration->toolChainType();
break;
default:
break;
}
if (const ProjectExplorer::Project *project = runConfiguration->project()) {
m_startParameters->buildDir =
project->buildDirectory(project->activeBuildConfiguration());
}
m_startParameters->useTerminal =
runConfiguration->runMode() == ApplicationRunConfiguration::Console;
m_dumperLibrary = runConfiguration->dumperLibrary();
m_dumperLibraryLocations = runConfiguration->dumperLibraryLocations();
}
void DebuggerRunControl::start()
{
m_running = true;
ApplicationRunConfigurationPtr rc =
runConfiguration().objectCast<ApplicationRunConfiguration>();
if (rc) {
// Enhance parameters by info from the project, but do not clobber
// arguments given in the dialogs
if (m_startParameters->executable.isEmpty())
m_startParameters->executable = rc->executable();
if (m_startParameters->environment.empty())
m_startParameters->environment = rc->environment().toStringList();
if (m_startParameters->workingDir.isEmpty())
m_startParameters->workingDir = rc->workingDirectory();
if (m_mode != StartExternal)
m_startParameters->processArgs = rc->commandLineArguments();
switch (m_startParameters->toolChainType) {
case ProjectExplorer::ToolChain::UNKNOWN:
case ProjectExplorer::ToolChain::INVALID:
m_startParameters->toolChainType = rc->toolChainType();
break;
default:
break;
}
m_manager->setQtDumperLibraryName(rc->dumperLibrary());
m_manager->setQtDumperLibraryLocations(rc->dumperLibraryLocations());
if (const ProjectExplorer::Project *project = rc->project()) {
m_startParameters->buildDir = project->buildDirectory(project->activeBuildConfiguration());
}
m_startParameters->useTerminal = rc->runMode() == ApplicationRunConfiguration::Console;
}
//emit addToOutputWindow(this, tr("Debugging %1").arg(m_executable));
m_manager->setQtDumperLibraryName(m_dumperLibrary);
m_manager->setQtDumperLibraryLocations(m_dumperLibraryLocations);
m_manager->startNewDebugger(this, m_startParameters);
emit started();
//debuggingFinished();
}
void DebuggerRunControl::slotAddToOutputWindowInline(const QString &data)
@@ -187,7 +188,6 @@ void DebuggerRunControl::slotAddToOutputWindowInline(const QString &data)
void DebuggerRunControl::stop()
{
//qDebug() << "DebuggerRunControl::stop";
m_running = false;
emit stopRequested();
}
@@ -195,13 +195,13 @@ void DebuggerRunControl::stop()
void DebuggerRunControl::debuggingFinished()
{
m_running = false;
//qDebug() << "DebuggerRunControl::finished";
//emit addToOutputWindow(this, tr("Debugging %1 finished").arg(m_executable));
emit finished();
}
bool DebuggerRunControl::isRunning() const
{
//qDebug() << "DebuggerRunControl::isRunning" << m_running;
return m_running;
}
} // namespace Internal
} // namespace Debugger

View File

@@ -51,7 +51,8 @@ typedef QSharedPointer<ProjectExplorer::RunConfiguration>
typedef QSharedPointer<ProjectExplorer::ApplicationRunConfiguration>
ApplicationRunConfigurationPtr;
class DebuggerRunner : public ProjectExplorer::IRunConfigurationRunner
class DebuggerRunner
: public ProjectExplorer::IRunConfigurationRunner
{
Q_OBJECT
@@ -59,7 +60,7 @@ public:
explicit DebuggerRunner(DebuggerManager *manager);
// ProjectExplorer::IRunConfigurationRunner
virtual bool canRun(RunConfigurationPtr runConfiguration, const QString &mode);
bool canRun(RunConfigurationPtr runConfiguration, const QString &mode);
virtual ProjectExplorer::RunControl *run(RunConfigurationPtr runConfiguration, const QString &mode);
virtual QString displayName() const;
@@ -79,15 +80,16 @@ private:
};
// This is a job description
class DebuggerRunControl : public ProjectExplorer::RunControl
class DebuggerRunControl
: public ProjectExplorer::RunControl
{
Q_OBJECT
public:
explicit DebuggerRunControl(DebuggerManager *manager,
DebuggerStartMode mode,
const QSharedPointer<DebuggerStartParameters> &sp,
ApplicationRunConfigurationPtr runConfiguration);
DebuggerRunControl(DebuggerManager *manager,
DebuggerStartMode mode,
const QSharedPointer<DebuggerStartParameters> &sp,
ApplicationRunConfigurationPtr runConfiguration);
DebuggerStartMode startMode() const { return m_mode; }
@@ -109,27 +111,30 @@ private:
const QSharedPointer<DebuggerStartParameters> m_startParameters;
DebuggerManager *m_manager;
bool m_running;
QString m_dumperLibrary;
QStringList m_dumperLibraryLocations;
};
// A default run configuration for external executables or attaching to
// running processes by id.
class DefaultApplicationRunConfiguration : public ProjectExplorer::ApplicationRunConfiguration
class DefaultApplicationRunConfiguration
: public ProjectExplorer::ApplicationRunConfiguration
{
Q_OBJECT
public:
explicit DefaultApplicationRunConfiguration(const QString &executable = QString());
virtual QString executable() const { return m_executable; }
virtual RunMode runMode() const { return Gui; }
virtual QString workingDirectory() const { return QString(); }
virtual QStringList commandLineArguments() const { return QStringList(); }
virtual QString executable() const { return m_executable; }
virtual RunMode runMode() const { return Gui; }
virtual QString workingDirectory() const { return QString(); }
virtual QStringList commandLineArguments() const { return QStringList(); }
virtual ProjectExplorer::Environment environment() const
{ return ProjectExplorer::Environment(); }
virtual QString dumperLibrary() const { return QString(); }
virtual QString dumperLibrary() const { return QString(); }
virtual QStringList dumperLibraryLocations() const { return QStringList(); }
virtual ProjectExplorer::ToolChain::ToolChainType toolChainType() const
{ return ProjectExplorer::ToolChain::UNKNOWN; }
virtual QWidget *configurationWidget() { return 0; }
virtual QWidget *configurationWidget() { return 0; }
private:
const QString m_executable;

View File

@@ -1,4 +1,5 @@
HEADERS += \
$$PWD/gdbprocessbase.h \
$$PWD/gdbmi.h \
$$PWD/gdbengine.h \
$$PWD/gdboptionspage.h \

View File

@@ -138,13 +138,27 @@ static QByteArray parsePlainConsoleStream(const GdbResultRecord &record)
return out.mid(pos + 3);
}
///////////////////////////////////////////////////////////////////////
//
// GdbProcess
//
///////////////////////////////////////////////////////////////////////
void GdbProcess::attach(GdbEngine *engine) const
{
QFileInfo fi(engine->startParameters().executable);
QString fileName = fi.absoluteFilePath();
engine->postCommand(_("-file-exec-and-symbols ") + fileName,
&GdbEngine::handleFileExecAndSymbols, "handleFileExecAndSymbols");
}
///////////////////////////////////////////////////////////////////////
//
// GdbEngine
//
///////////////////////////////////////////////////////////////////////
GdbEngine::GdbEngine(DebuggerManager *parent) :
GdbEngine::GdbEngine(DebuggerManager *parent, GdbProcessBase *gdbProc) :
#ifdef Q_OS_WIN // Do injection loading with MinGW (call loading does not work with 64bit)
m_dumperInjectionLoad(true),
#else
@@ -153,6 +167,7 @@ GdbEngine::GdbEngine(DebuggerManager *parent) :
q(parent),
qq(parent->engineInterface())
{
m_gdbProc = gdbProc;
m_stubProc.setMode(Core::Utils::ConsoleProcess::Debug);
#ifdef Q_OS_UNIX
m_stubProc.setSettings(Core::ICore::instance()->settings());
@@ -164,20 +179,23 @@ GdbEngine::GdbEngine(DebuggerManager *parent) :
GdbEngine::~GdbEngine()
{
// prevent sending error messages afterwards
m_gdbProc.disconnect(this);
m_gdbProc->disconnect(this);
delete m_gdbProc;
}
void GdbEngine::initializeConnections()
{
// Gdb Process interaction
connect(&m_gdbProc, SIGNAL(error(QProcess::ProcessError)),
connect(m_gdbProc, SIGNAL(error(QProcess::ProcessError)),
this, SLOT(gdbProcError(QProcess::ProcessError)));
connect(&m_gdbProc, SIGNAL(readyReadStandardOutput()),
connect(m_gdbProc, SIGNAL(readyReadStandardOutput()),
this, SLOT(readGdbStandardOutput()));
connect(&m_gdbProc, SIGNAL(readyReadStandardError()),
connect(m_gdbProc, SIGNAL(readyReadStandardError()),
this, SLOT(readGdbStandardError()));
connect(&m_gdbProc, SIGNAL(finished(int, QProcess::ExitStatus)),
connect(m_gdbProc, SIGNAL(finished(int, QProcess::ExitStatus)),
q, SLOT(exitDebugger()));
connect(m_gdbProc, SIGNAL(started()),
this, SLOT(startDebugger2()));
connect(&m_stubProc, SIGNAL(processError(QString)),
this, SLOT(stubError(QString)));
@@ -265,6 +283,7 @@ void GdbEngine::gdbProcError(QProcess::ProcessError error)
"invoked program '%1' is missing, or you may have insufficient "
"permissions to invoke the program.")
.arg(theDebuggerStringSetting(GdbLocation));
emitStartFailed();
break;
case QProcess::Crashed:
kill = false;
@@ -614,7 +633,7 @@ void GdbEngine::stubError(const QString &msg)
void GdbEngine::readGdbStandardError()
{
qWarning() << "Unexpected gdb stderr:" << m_gdbProc.readAllStandardError();
qWarning() << "Unexpected gdb stderr:" << m_gdbProc->readAllStandardError();
}
void GdbEngine::readGdbStandardOutput()
@@ -622,7 +641,7 @@ void GdbEngine::readGdbStandardOutput()
int newstart = 0;
int scan = m_inbuffer.size();
m_inbuffer.append(m_gdbProc.readAllStandardOutput());
m_inbuffer.append(m_gdbProc->readAllStandardOutput());
while (newstart < m_inbuffer.size()) {
int start = newstart;
@@ -651,7 +670,7 @@ void GdbEngine::interruptInferior()
{
qq->notifyInferiorStopRequested();
if (m_gdbProc.state() == QProcess::NotRunning) {
if (m_gdbProc->state() == QProcess::NotRunning) {
debugMessage(_("TRYING TO INTERRUPT INFERIOR WITHOUT RUNNING GDB"));
qq->notifyInferiorExited();
return;
@@ -698,7 +717,7 @@ void GdbEngine::postCommand(const QString &command, GdbCommandFlags flags,
GdbCommandCallback callback, const char *callbackName,
const QVariant &cookie)
{
if (m_gdbProc.state() == QProcess::NotRunning) {
if (m_gdbProc->state() == QProcess::NotRunning) {
debugMessage(_("NO GDB PROCESS RUNNING, CMD IGNORED: ") + command);
return;
}
@@ -742,10 +761,8 @@ void GdbEngine::flushCommand(GdbCommand &cmd)
if (cmd.flags & EmbedToken)
cmd.command = cmd.command.arg(currentToken());
m_gdbProc.write(cmd.command.toLatin1() + "\r\n");
//emit gdbInputAvailable(QString(), " " + currentTime());
//emit gdbInputAvailable(QString(), "[" + currentTime() + "] " + cmd.command);
emit gdbInputAvailable(LogInput, cmd.command);
executeDebuggerCommand(cmd.command);
}
void GdbEngine::handleResultRecord(const GdbResultRecord &record)
@@ -829,12 +846,12 @@ void GdbEngine::handleResultRecord(const GdbResultRecord &record)
void GdbEngine::executeDebuggerCommand(const QString &command)
{
if (m_gdbProc.state() == QProcess::NotRunning) {
debugMessage(_("NO GDB PROCESS RUNNING, PLAIN CMD IGNORED: ") + command);
if (m_gdbProc->state() != QProcess::Running) {
debugMessage(_("GDB PROCESS NOT RUNNING, PLAIN CMD IGNORED: ") + command);
return;
}
m_gdbProc.write(command.toLocal8Bit() + "\r\n");
m_gdbProc->write(command.toLatin1() + "\r\n");
}
void GdbEngine::handleTargetCore(const GdbResultRecord &, const QVariant &)
@@ -1061,7 +1078,6 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
return;
}
//MAC: bool isFirstStop = data.findChild("bkptno").data() == "1";
//!MAC: startSymbolName == data.findChild("frame").findChild("func")
if (m_waitingForFirstBreakpointToBeHit) {
@@ -1275,6 +1291,15 @@ void GdbEngine::handleAsyncOutput2(const GdbMi &data)
}
}
// FIXME: Hack, remove as soon as we get real stack traces.
if (m_gdbProc->isAdapter()) {
StackFrame f;
f.file = QString::fromLocal8Bit(fullName.data());
f.line = frame.findChild("line").data().toInt();
f.address = _(frame.findChild("addr").data());
q->gotoLocation(f, true);
}
//
// Stack
//
@@ -1434,15 +1459,16 @@ void GdbEngine::detachDebugger()
void GdbEngine::exitDebugger()
{
debugMessage(_("GDBENGINE EXITDEBUGGER: %1").arg(m_gdbProc.state()));
if (m_gdbProc.state() == QProcess::Starting) {
debugMessage(_("GDBENGINE EXITDEBUGGER: %1").arg(m_gdbProc->state()));
if (m_gdbProc->state() == QProcess::Starting) {
debugMessage(_("WAITING FOR GDB STARTUP TO SHUTDOWN: %1")
.arg(m_gdbProc.state()));
m_gdbProc.waitForStarted();
.arg(m_gdbProc->state()));
// FIXME: handle this!
//m_gdbProc->waitForStarted();
}
if (m_gdbProc.state() == QProcess::Running) {
if (m_gdbProc->state() == QProcess::Running) {
debugMessage(_("WAITING FOR RUNNING GDB TO SHUTDOWN: %1")
.arg(m_gdbProc.state()));
.arg(m_gdbProc->state()));
if (q->status() != DebuggerInferiorStopped
&& q->status() != DebuggerProcessStartingUp) {
QTC_ASSERT(q->status() == DebuggerInferiorRunning,
@@ -1455,17 +1481,17 @@ void GdbEngine::exitDebugger()
postCommand(_("kill"));
postCommand(_("-gdb-exit"), CB(handleExit));
// 20s can easily happen when loading webkit debug information
if (!m_gdbProc.waitForFinished(20000)) {
if (!m_gdbProc->waitForFinished(20000)) {
debugMessage(_("FORCING TERMINATION: %1")
.arg(m_gdbProc.state()));
m_gdbProc.terminate();
m_gdbProc.waitForFinished(20000);
.arg(m_gdbProc->state()));
m_gdbProc->terminate();
m_gdbProc->waitForFinished(20000);
}
}
if (m_gdbProc.state() != QProcess::NotRunning) {
if (m_gdbProc->state() != QProcess::NotRunning) {
debugMessage(_("PROBLEM STOPPING DEBUGGER: STATE %1")
.arg(m_gdbProc.state()));
m_gdbProc.kill();
.arg(m_gdbProc->state()));
m_gdbProc->kill();
}
m_outputCollector.shutdown();
@@ -1479,18 +1505,20 @@ int GdbEngine::currentFrame() const
return qq->stackHandler()->currentIndex();
}
bool GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
void GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
{
m_startParameters = *sp;
// This should be set by the constructor or in exitDebugger().
QTC_ASSERT(m_debuggingHelperState == DebuggingHelperUninitialized,
initializeVariables());
QStringList gdbArgs;
if (m_gdbProc.state() != QProcess::NotRunning) {
debugMessage(_("GDB IS ALREADY RUNNING, STATE: %1").arg(m_gdbProc.state()));
m_gdbProc.kill();
return false;
if (m_gdbProc->state() != QProcess::NotRunning) {
debugMessage(_("GDB IS ALREADY RUNNING, STATE: %1").arg(m_gdbProc->state()));
m_gdbProc->kill();
emitStartFailed();
return;
}
//gdbArgs.prepend(_("--quiet"));
@@ -1501,62 +1529,73 @@ bool GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
// nothing to do
} else if (q->startMode() == StartRemote) {
// Start the remote server
if (sp->serverStartScript.isEmpty()) {
if (m_startParameters.serverStartScript.isEmpty()) {
q->showStatusMessage(_("No server start script given. "
"Assuming server runs already."));
} else {
if (!sp->workingDir.isEmpty())
m_uploadProc.setWorkingDirectory(sp->workingDir);
if (!sp->environment.isEmpty())
m_uploadProc.setEnvironment(sp->environment);
m_uploadProc.start(_("/bin/sh ") + sp->serverStartScript);
if (!m_startParameters.workingDir.isEmpty())
m_uploadProc.setWorkingDirectory(m_startParameters.workingDir);
if (!m_startParameters.environment.isEmpty())
m_uploadProc.setEnvironment(m_startParameters.environment);
m_uploadProc.start(_("/bin/sh ") + m_startParameters.serverStartScript);
m_uploadProc.waitForStarted();
}
} else if (sp->useTerminal) {
} else if (m_startParameters.useTerminal) {
m_stubProc.stop(); // We leave the console open, so recycle it now.
m_stubProc.setWorkingDirectory(sp->workingDir);
m_stubProc.setEnvironment(sp->environment);
if (!m_stubProc.start(sp->executable, sp->processArgs))
return false; // Error message for user is delivered via a signal.
m_stubProc.setWorkingDirectory(m_startParameters.workingDir);
m_stubProc.setEnvironment(m_startParameters.environment);
if (!m_stubProc.start(m_startParameters.executable,
m_startParameters.processArgs)) {
// Error message for user is delivered via a signal.
emitStartFailed();
return;
}
} else {
if (!m_outputCollector.listen()) {
QMessageBox::critical(q->mainWindow(), tr("Debugger Startup Failure"),
tr("Cannot set up communication with child process: %1")
.arg(m_outputCollector.errorString()));
return false;
emitStartFailed();
return;
}
gdbArgs.prepend(_("--tty=") + m_outputCollector.serverName());
if (!sp->workingDir.isEmpty())
m_gdbProc.setWorkingDirectory(sp->workingDir);
if (!sp->environment.isEmpty())
m_gdbProc.setEnvironment(sp->environment);
if (!m_startParameters.workingDir.isEmpty())
m_gdbProc->setWorkingDirectory(m_startParameters.workingDir);
if (!m_startParameters.environment.isEmpty())
m_gdbProc->setEnvironment(m_startParameters.environment);
}
#if 0
qDebug() << "Command:" << q->settings()->m_gdbCmd;
qDebug() << "WorkingDirectory:" << m_gdbProc.workingDirectory();
qDebug() << "WorkingDirectory:" << m_gdbProc->workingDirectory();
qDebug() << "ScriptFile:" << q->settings()->m_scriptFile;
qDebug() << "Environment:" << m_gdbProc.environment();
qDebug() << "Environment:" << m_gdbProc->environment();
qDebug() << "Arguments:" << gdbArgs;
qDebug() << "BuildDir:" << sp->buildDir;
qDebug() << "ExeFile:" << sp->executable;
qDebug() << "BuildDir:" << m_startParameters.buildDir;
qDebug() << "ExeFile:" << m_startParameters.executable;
#endif
QString loc = theDebuggerStringSetting(GdbLocation);
q->showStatusMessage(tr("Starting Debugger: ") + loc + _c(' ') + gdbArgs.join(_(" ")));
m_gdbProc.start(loc, gdbArgs);
if (!m_gdbProc.waitForStarted()) {
QMessageBox::critical(q->mainWindow(), tr("Debugger Startup Failure"),
tr("Cannot start debugger: %1").arg(m_gdbProc.errorString()));
m_outputCollector.shutdown();
m_stubProc.blockSignals(true);
m_stubProc.stop();
m_stubProc.blockSignals(false);
return false;
}
m_gdbProc->start(loc, gdbArgs);
}
void GdbEngine::emitStartFailed()
{
// QMessageBox::critical(q->mainWindow(), tr("Debugger Startup Failure"),
// tr("Cannot start debugger: %1").arg(m_gdbProc->errorString()));
m_outputCollector.shutdown();
m_stubProc.blockSignals(true);
m_stubProc.stop();
m_stubProc.blockSignals(false);
emit startFailed();
}
void GdbEngine::startDebugger2()
{
debugMessage(_("STARTUP, PHASE 2"));
q->showStatusMessage(tr("Gdb Running..."));
postCommand(_("show version"), CB(handleShowVersion));
@@ -1637,54 +1676,56 @@ bool GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
}
if (q->startMode() == AttachExternal || q->startMode() == AttachCrashedExternal) {
postCommand(_("attach %1").arg(sp->attachPID), CB(handleAttach));
postCommand(_("attach %1").arg(m_startParameters.attachPID), CB(handleAttach));
// Task 254674 does not want to remove them
//qq->breakHandler()->removeAllBreakpoints();
} else if (q->startMode() == AttachCore) {
QFileInfo fi(sp->executable);
QFileInfo fi(m_startParameters.executable);
QString fileName = _c('"') + fi.absoluteFilePath() + _c('"');
QFileInfo fi2(sp->coreFile);
QFileInfo fi2(m_startParameters.coreFile);
// quoting core name below fails in gdb 6.8-debian
QString coreName = fi2.absoluteFilePath();
postCommand(_("-file-exec-and-symbols ") + fileName, CB(handleFileExecAndSymbols));
postCommand(_("target core ") + coreName, CB(handleTargetCore));
qq->breakHandler()->removeAllBreakpoints();
} else if (q->startMode() == StartRemote) {
postCommand(_("set architecture %1").arg(sp->remoteArchitecture));
postCommand(_("set architecture %1").arg(m_startParameters.remoteArchitecture));
qq->breakHandler()->setAllPending();
//QFileInfo fi(sp->executable);
//QFileInfo fi(m_startParameters.executable);
//QString fileName = fi.absoluteFileName();
QString fileName = sp->executable;
QString fileName = m_startParameters.executable;
postCommand(_("-file-exec-and-symbols \"%1\"").arg(fileName), CB(handleFileExecAndSymbols));
// works only for > 6.8
postCommand(_("set target-async on"), CB(handleSetTargetAsync));
} else if (sp->useTerminal) {
} else if (m_startParameters.useTerminal) {
qq->breakHandler()->setAllPending();
} else if (q->startMode() == StartInternal || q->startMode() == StartExternal) {
QFileInfo fi(sp->executable);
QString fileName = _c('"') + fi.absoluteFilePath() + _c('"');
postCommand(_("-file-exec-and-symbols ") + fileName, CB(handleFileExecAndSymbols));
//postCommand(_("file ") + fileName, handleFileExecAndSymbols);
#ifdef Q_OS_MAC
postCommand(_("sharedlibrary apply-load-rules all"));
#endif
if (!sp->processArgs.isEmpty())
postCommand(_("-exec-arguments ") + sp->processArgs.join(_(" ")));
#ifndef Q_OS_MAC
if (!m_dumperInjectionLoad)
postCommand(_("set auto-solib-add off"));
postCommand(_("info target"), CB(handleStart));
#else
// On MacOS, breaking in at the entry point wreaks havoc.
postCommand(_("tbreak main"));
m_waitingForFirstBreakpointToBeHit = true;
qq->notifyInferiorRunningRequested();
postCommand(_("-exec-run"), CB(handleExecRun));
#endif
m_gdbProc->attach(this);
if (m_gdbProc->isAdapter()) {
qq->notifyInferiorRunningRequested();
postCommand(_("-exec-continue"), CB(handleExecContinue));
} else {
#ifdef Q_OS_MAC
postCommand(_("sharedlibrary apply-load-rules all"));
#endif
if (!m_startParameters.processArgs.isEmpty())
postCommand(_("-exec-arguments ") + m_startParameters.processArgs.join(_(" ")));
#ifdef Q_OS_MAC
// On MacOS, breaking in at the entry point wreaks havoc.
postCommand(_("tbreak main"));
m_waitingForFirstBreakpointToBeHit = true;
qq->notifyInferiorRunningRequested();
postCommand(_("-exec-run"), CB(handleExecRun));
#else
if (!m_dumperInjectionLoad)
postCommand(_("set auto-solib-add off"));
postCommand(_("info target"), CB(handleStart));
#endif
}
qq->breakHandler()->setAllPending();
}
return true;
emit startSuccessful();
}
void GdbEngine::continueInferior()
@@ -1749,7 +1790,6 @@ void GdbEngine::handleAttach(const GdbResultRecord &, const QVariant &)
void GdbEngine::handleSetTargetAsync(const GdbResultRecord &record, const QVariant &)
{
if (record.resultClass == GdbResultDone) {
//postCommand(_("info target"), handleStart);
qq->notifyInferiorRunningRequested();
postCommand(_("target remote %1").arg(q->startParameters()->remoteChannel),
CB(handleTargetRemote));
@@ -2001,7 +2041,8 @@ void GdbEngine::sendInsertBreakpoint(int index)
}
// The argument is simply a C-quoted version of the argument to the
// non-MI "break" command, including the "original" quoting it wants.
where = _("\"\\\"") + GdbMi::escapeCString(where) + _("\\\":") + data->lineNumber + _c('"');
where = _("\"\\\"%1\\\":%2\"")
.arg(GdbMi::escapeCString(where)).arg(data->lineNumber);
} else {
where = data->funcName;
}
@@ -2018,6 +2059,8 @@ void GdbEngine::sendInsertBreakpoint(int index)
// cmd += "-c " + data->condition + " ";
#else
QString cmd = _("-break-insert -f ");
if (m_gdbProc->isAdapter())
cmd = _("-break-insert ");
//if (!data->condition.isEmpty())
// cmd += _("-c ") + data->condition + ' ';
#endif
@@ -4198,7 +4241,7 @@ void GdbEngine::handleFetchDisassemblerByAddress0(const GdbResultRecord &record,
IDebuggerEngine *createGdbEngine(DebuggerManager *parent, QList<Core::IOptionsPage*> *opts)
{
opts->push_back(new GdbOptionsPage);
return new GdbEngine(parent);
return new GdbEngine(parent, new GdbProcess);
}
} // namespace Internal

View File

@@ -31,7 +31,9 @@
#define DEBUGGER_GDBENGINE_H
#include "idebuggerengine.h"
#include "debuggermanager.h" // only for StartParameters
#include "gdbmi.h"
#include "gdbprocessbase.h"
#include "outputcollector.h"
#include "watchutils.h"
@@ -56,6 +58,7 @@ QT_END_NAMESPACE
namespace Debugger {
namespace Internal {
class DebuggerManager;
class IDebuggerManagerAccessForEngines;
class GdbResultRecord;
@@ -72,13 +75,50 @@ enum DebuggingHelperState
DebuggingHelperUnavailable,
};
class GdbProcess : public GdbProcessBase
{
public:
GdbProcess(QObject *parent = 0)
: GdbProcessBase(parent)
{
connect(&m_proc, SIGNAL(error(QProcess::ProcessError)),
this, SIGNAL(error(QProcess::ProcessError)));
connect(&m_proc, SIGNAL(readyReadStandardOutput()),
this, SIGNAL(readyReadStandardOutput()));
connect(&m_proc, SIGNAL(readyReadStandardError()),
this, SIGNAL(readyReadStandardError()));
connect(&m_proc, SIGNAL(started()),
this, SIGNAL(started()));
connect(&m_proc, SIGNAL(finished(int, QProcess::ExitStatus)),
this, SIGNAL(finished(int, QProcess::ExitStatus)));
}
void start(const QString &program, const QStringList &args,
QIODevice::OpenMode mode) { m_proc.start(program, args, mode); }
void kill() { m_proc.kill(); }
void terminate() { m_proc.terminate(); }
bool waitForStarted(int msecs) { return m_proc.waitForStarted(msecs); }
bool waitForFinished(int msecs) { return m_proc.waitForFinished(msecs); }
QProcess::ProcessState state() const { return m_proc.state(); }
QString errorString() const { return m_proc.errorString(); }
QByteArray readAllStandardError() { return m_proc.readAllStandardError(); }
QByteArray readAllStandardOutput() { return m_proc.readAllStandardOutput(); }
qint64 write(const char *data) { return m_proc.write(data); }
void setWorkingDirectory(const QString &dir) { m_proc.setWorkingDirectory(dir); }
void setEnvironment(const QStringList &env) { m_proc.setEnvironment(env); }
bool isAdapter() const { return false; }
void attach(GdbEngine *engine) const;
private:
QProcess m_proc;
};
class GdbEngine : public IDebuggerEngine
{
Q_OBJECT
public:
GdbEngine(DebuggerManager *parent);
GdbEngine(DebuggerManager *parent, GdbProcessBase *gdbProc);
~GdbEngine();
signals:
@@ -87,6 +127,11 @@ signals:
void applicationOutputAvailable(const QString &output);
private:
friend class GdbProcess;
friend class SymbianAdapter;
const DebuggerStartParameters &startParameters() const
{ return m_startParameters; }
//
// IDebuggerEngine implementation
//
@@ -98,7 +143,8 @@ private:
void shutdown();
void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
bool startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
void startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
Q_SLOT void startDebugger2();
void exitDebugger();
void detachDebugger();
@@ -166,6 +212,7 @@ public: // otherwise the Qt flag macros are unhappy
};
Q_DECLARE_FLAGS(GdbCommandFlags, GdbCommandFlag)
private:
typedef void (GdbEngine::*GdbCommandCallback)(const GdbResultRecord &record, const QVariant &cookie);
@@ -210,6 +257,7 @@ private slots:
void stubStarted();
void stubError(const QString &msg);
void uploadProcError(QProcess::ProcessError error);
void emitStartFailed();
private:
int terminationIndex(const QByteArray &buffer, int &length);
@@ -251,7 +299,7 @@ private:
QByteArray m_inbuffer;
QProcess m_gdbProc;
GdbProcessBase *m_gdbProc;
QProcess m_uploadProc;
Core::Utils::ConsoleProcess m_stubProc;
@@ -395,6 +443,7 @@ private:
DebuggerManager * const q;
IDebuggerManagerAccessForEngines * const qq;
DebuggerStartParameters m_startParameters;
// make sure to re-initialize new members in initializeVariables();
};

View File

@@ -0,0 +1,80 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (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 http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef DEBUGGER_PROCESSBASE_H
#define DEBUGGER_PROCESSBASE_H
#include <QtCore/QObject>
#include <QtCore/QProcess>
namespace Debugger {
namespace Internal {
class GdbEngine;
// GdbProcessBase is inherited by GdbProcess and the gdb/trk Adapter.
// In the GdbProcess case it's just a wrapper around a QProcess running
// gdb, in the Adapter case it's the interface to the gdb process in
// the whole rfomm/gdb/gdbserver combo.
class GdbProcessBase : public QObject
{
Q_OBJECT
public:
GdbProcessBase(QObject *parent = 0) : QObject(parent) {}
virtual void start(const QString &program, const QStringList &args,
QIODevice::OpenMode mode = QIODevice::ReadWrite) = 0;
virtual void kill() = 0;
virtual void terminate() = 0;
//virtual bool waitForStarted(int msecs = 30000) = 0;
virtual bool waitForFinished(int msecs = 30000) = 0;
virtual QProcess::ProcessState state() const = 0;
virtual QString errorString() const = 0;
virtual QByteArray readAllStandardError() = 0;
virtual QByteArray readAllStandardOutput() = 0;
virtual qint64 write(const char *data) = 0;
virtual void setWorkingDirectory(const QString &dir) = 0;
virtual void setEnvironment(const QStringList &env) = 0;
virtual bool isAdapter() const = 0;
virtual void attach(GdbEngine *engine) const = 0;
signals:
void error(QProcess::ProcessError);
void started();
void readyReadStandardOutput();
void readyReadStandardError();
void finished(int, QProcess::ExitStatus);
};
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGER_PROCESSBASE_H

View File

@@ -55,12 +55,14 @@ class WatchData;
class IDebuggerEngine : public QObject
{
Q_OBJECT
public:
IDebuggerEngine(QObject *parent = 0) : QObject(parent) {}
virtual void shutdown() = 0;
virtual void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos) = 0;
virtual bool startDebugger(const QSharedPointer<DebuggerStartParameters> &startParameters) = 0;
virtual void startDebugger(const QSharedPointer<DebuggerStartParameters> &startParameters) = 0;
virtual void exitDebugger() = 0;
virtual void detachDebugger() {}
virtual void updateWatchData(const WatchData &data) = 0;
@@ -101,6 +103,10 @@ public:
virtual void fetchDisassembler(DisassemblerViewAgent *, const StackFrame &) {}
virtual void setRegisterValue(int regnr, const QString &value)
{ Q_UNUSED(regnr); Q_UNUSED(value); }
signals:
void startSuccessful();
void startFailed();
};
} // namespace Internal

View File

@@ -217,7 +217,7 @@ void ScriptEngine::exitDebugger()
qq->notifyInferiorExited();
}
bool ScriptEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
void ScriptEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
{
if (!m_scriptEngine)
m_scriptEngine = new QScriptEngine(this);
@@ -233,15 +233,17 @@ bool ScriptEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &
QFileInfo fi(sp->executable);
m_scriptFileName = fi.absoluteFilePath();
QFile scriptFile(m_scriptFileName);
if (!scriptFile.open(QIODevice::ReadOnly))
return false;
if (!scriptFile.open(QIODevice::ReadOnly)) {
emit startFailed();
return;
}
QTextStream stream(&scriptFile);
m_scriptContents = stream.readAll();
scriptFile.close();
attemptBreakpointSynchronization();
qq->notifyInferiorRunningRequested();
QTimer::singleShot(0, this, SLOT(runInferior()));
return true;
emit startSuccessful();
}
void ScriptEngine::continueInferior()

View File

@@ -75,7 +75,7 @@ private:
void shutdown();
void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
bool startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
void startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
void exitDebugger();

View File

@@ -0,0 +1,16 @@
HEADERS += \
$$PWD/trkutils.h \
$$PWD/trkclient.h \
$$PWD/symbianadapter.h \
#$$PWD/gdboptionspage.h \
SOURCES += \
$$PWD/trkutils.cpp \
$$PWD/trkclient.cpp \
$$PWD/symbianadapter.cpp \
$$PWD/symbianengine.cpp \
#$$PWD/gdboptionspage.cpp \
#FORMS += $$PWD/gdboptionspage.ui
#RESOURCES += $$PWD/gdb.qrc

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,245 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (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 http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef DEBUGGER_SYMBIANADAPTER_H
#define DEBUGGER_SYMBIANADAPTER_H
#include "trkutils.h"
#include "trkclient.h"
#include "../gdb/gdbprocessbase.h"
#include <QtCore/QDebug>
#include <QtCore/QDir>
#include <QtCore/QFile>
#include <QtCore/QHash>
#include <QtCore/QPointer>
#include <QtCore/QProcess>
#include <QtCore/QQueue>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QTextStream>
#include <QtCore/QTimer>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QMainWindow>
#include <QtGui/QKeyEvent>
#include <QtGui/QTextBlock>
#include <QtGui/QTextEdit>
#include <QtGui/QToolBar>
#include <QtNetwork/QTcpServer>
#include <QtNetwork/QTcpSocket>
#include <QtNetwork/QLocalServer>
#include <QtNetwork/QLocalSocket>
namespace Debugger {
namespace Internal {
struct GdbResult
{
QByteArray data;
};
///////////////////////////////////////////////////////////////////////
//
// SymbianAdapter
//
///////////////////////////////////////////////////////////////////////
class SymbianAdapter : public GdbProcessBase
{
Q_OBJECT
public:
typedef trk::TrkResult TrkResult;
typedef trk::TrkFunctor1<const TrkResult &> TrkCallback;
typedef trk::TrkFunctor1<const GdbResult &> GdbCallback;
SymbianAdapter();
~SymbianAdapter();
void setGdbServerName(const QString &name);
QString gdbServerName() const { return m_gdbServerName; }
QString gdbServerIP() const;
uint gdbServerPort() const;
void setVerbose(int verbose) { m_verbose = verbose; }
void setSerialFrame(bool b) { m_serialFrame = b; }
void setBufferedMemoryRead(bool b) { m_bufferedMemoryRead = b; }
trk::Session &session() { return m_session; }
public slots:
void startInferior();
void run();
signals:
void output(const QString &msg);
void startSuccessful();
void startFailed();
private slots:
void startGdb();
private:
friend class RunnerGui;
QString m_rfcommDevice; // /dev/rfcomm0
QString m_gdbServerName; // 127.0.0.1:(2222+uid)
QProcess m_gdbProc;
QProcess m_rfcommProc;
bool m_running;
public:
//
// Implementation of GdbProcessBase
//
void start(const QString &program, const QStringList &args,
QIODevice::OpenMode mode = QIODevice::ReadWrite);
void kill();
void terminate();
bool waitForFinished(int msecs = 30000);
QProcess::ProcessState state() const;
QString errorString() const;
QByteArray readAllStandardError();
QByteArray readAllStandardOutput();
qint64 write(const char *data);
void setWorkingDirectory(const QString &dir);
void setEnvironment(const QStringList &env);
bool isAdapter() const { return true; }
void attach(GdbEngine *engine) const;
//
// TRK
//
void sendTrkMessage(byte code,
TrkCallback callback = TrkCallback(),
const QByteArray &data = QByteArray(),
const QVariant &cookie = QVariant());
Q_SLOT void handleTrkResult(const trk::TrkResult &data);
Q_SLOT void handleTrkError(const QString &msg);
// convenience messages
void sendTrkAck(byte token);
void handleCpuType(const TrkResult &result);
void handleCreateProcess(const TrkResult &result);
void handleClearBreakpoint(const TrkResult &result);
void handleSignalContinue(const TrkResult &result);
void handleStop(const TrkResult &result);
void handleSupportMask(const TrkResult &result);
void handleTrkVersions(const TrkResult &result);
void handleDisconnect(const TrkResult &result);
void handleAndReportCreateProcess(const TrkResult &result);
void handleAndReportReadRegisters(const TrkResult &result);
QByteArray memoryReadLogMessage(uint addr, uint len, const QByteArray &ba) const;
QByteArray trkContinueMessage();
QByteArray trkReadRegisterMessage();
QByteArray trkReadMemoryMessage(uint addr, uint len);
QByteArray trkBreakpointMessage(uint addr, uint len, bool armMode = true);
void handleAndReportSetBreakpoint(const TrkResult &result);
void handleReadMemoryBuffered(const TrkResult &result);
void handleReadMemoryUnbuffered(const TrkResult &result);
void handleStepRange(const TrkResult &result);
void handleReadRegisters(const TrkResult &result);
void reportReadMemoryBuffered(const TrkResult &result);
void reportToGdb(const TrkResult &result);
void readMemory(uint addr, uint len);
void interruptInferior();
trk::TrkDevice m_trkDevice;
//
// Gdb
//
struct GdbCommand
{
GdbCommand() : flags(0), callback(GdbCallback()), callbackName(0) {}
int flags;
GdbCallback callback;
const char *callbackName;
QString command;
QVariant cookie;
//QTime postTime;
};
void sendGdbMessage(const QString &msg,
GdbCallback callback = GdbCallback(),
const QVariant &cookie = QVariant());
Q_SLOT void handleGdbConnection();
Q_SLOT void readGdbServerCommand();
void readGdbResponse();
void handleGdbServerCommand(const QByteArray &cmd);
void sendGdbServerMessage(const QByteArray &msg,
const QByteArray &logNote = QByteArray());
void sendGdbServerMessageAfterTrkResponse(const QByteArray &msg,
const QByteArray &logNote = QByteArray());
void sendGdbServerAck();
bool sendGdbServerPacket(const QByteArray &packet, bool doFlush);
Q_SLOT void handleGdbError(QProcess::ProcessError error);
Q_SLOT void handleGdbFinished(int exitCode, QProcess::ExitStatus exitStatus);
Q_SLOT void handleGdbStarted();
Q_SLOT void handleGdbStateChanged(QProcess::ProcessState newState);
void logMessage(const QString &msg); // triggers output() if m_verbose
Q_SLOT void trkLogMessage(const QString &msg);
QTcpServer m_gdbServer;
QPointer<QTcpSocket> m_gdbConnection;
QByteArray m_gdbReadBuffer;
bool m_gdbAckMode;
QHash<int, GdbCommand> m_gdbCookieForToken;
//
// Rfcomm
//
Q_SLOT void handleRfcommReadyReadStandardError();
Q_SLOT void handleRfcommReadyReadStandardOutput();
Q_SLOT void handleRfcommError(QProcess::ProcessError error);
Q_SLOT void handleRfcommFinished(int exitCode, QProcess::ExitStatus exitStatus);
Q_SLOT void handleRfcommStarted();
Q_SLOT void handleRfcommStateChanged(QProcess::ProcessState newState);
// Debuggee state
Q_SLOT void executeCommand(const QString &msg);
trk::Session m_session; // global-ish data (process id, target information)
trk::Snapshot m_snapshot; // local-ish data (memory and registers)
int m_verbose;
bool m_serialFrame;
bool m_bufferedMemoryRead;
};
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGER_SYMBIANADAPTER_H

View File

@@ -0,0 +1,64 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (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 http://qt.nokia.com/contact.
**
**************************************************************************/
#define QT_NO_CAST_FROM_ASCII
#include "gdb/gdbengine.h"
#include "symbianadapter.h"
#include "debuggermanager.h"
//#include "debuggerdialogs.h"
#include <utils/qtcassert.h>
#include <texteditor/itexteditor.h>
#include <coreplugin/icore.h>
#include <coreplugin/dialogs/ioptionspage.h>
#include <QtCore/QDebug>
namespace Debugger {
namespace Internal {
IDebuggerEngine *createSymbianEngine(DebuggerManager *parent,
QList<Core::IOptionsPage*> *opts)
{
Q_UNUSED(opts);
//opts->push_back(new GdbOptionsPage);
SymbianAdapter *adapter = new SymbianAdapter;
GdbEngine *engine = new GdbEngine(parent, adapter);
QObject::connect(adapter, SIGNAL(output(QString)),
parent, SLOT(showDebuggerOutput(QString)));
return engine;
}
} // namespace Internal
} // namespace Debugger

View File

@@ -27,7 +27,7 @@
**
**************************************************************************/
#include "trkdevicex.h"
#include "trkclient.h"
#include "trkutils.h"
#include <QtCore/QString>
@@ -35,7 +35,6 @@
#include <QtCore/QQueue>
#include <QtCore/QHash>
#include <QtCore/QMap>
#include <QtCore/QSharedPointer>
#ifdef Q_OS_WIN
# include <windows.h>
@@ -117,14 +116,12 @@ struct TrkMessage
QByteArray data;
QVariant cookie;
Callback callback;
bool invokeOnNAK;
};
TrkMessage::TrkMessage(byte c, byte t, Callback cb) :
code(c),
token(t),
callback(cb),
invokeOnNAK(false)
callback(cb)
{
}
@@ -144,8 +141,7 @@ public:
// Enqueue messages.
void queueTrkMessage(byte code, Callback callback,
const QByteArray &data, const QVariant &cookie,
bool invokeOnNAK);
const QByteArray &data, const QVariant &cookie);
void queueTrkInitialPing();
// Call this from the device read notification with the results.
@@ -184,14 +180,13 @@ byte TrkWriteQueue::nextTrkWriteToken()
}
void TrkWriteQueue::queueTrkMessage(byte code, Callback callback,
const QByteArray &data, const QVariant &cookie, bool invokeOnNAK)
const QByteArray &data, const QVariant &cookie)
{
const byte token = code == TRK_WRITE_QUEUE_NOOP_CODE ?
byte(0) : nextTrkWriteToken();
TrkMessage msg(code, token, callback);
msg.data = data;
msg.cookie = cookie;
msg.invokeOnNAK = invokeOnNAK;
trkWriteQueue.append(msg);
}
@@ -233,16 +228,14 @@ void TrkWriteQueue::notifyWriteResult(bool ok)
void TrkWriteQueue::slotHandleResult(const TrkResult &result)
{
trkWriteBusy = false;
if (result.code != TrkNotifyAck && result.code != TrkNotifyNak)
return;
//if (result.code != TrkNotifyAck && result.code != TrkNotifyNak)
// return;
// Find which request the message belongs to and invoke callback
// if ACK or on NAK if desired.
const TokenMessageMap::iterator it = writtenTrkMessages.find(result.token);
if (it == writtenTrkMessages.end())
return;
const bool invokeCB = it.value().callback
&& (result.code == TrkNotifyAck || it.value().invokeOnNAK);
const bool invokeCB = it.value().callback;
if (invokeCB) {
TrkResult result1 = result;
result1.cookie = it.value().cookie;
@@ -257,8 +250,18 @@ void TrkWriteQueue::queueTrkInitialPing()
trkWriteQueue.append(TrkMessage(0, 0));
}
struct TrkDevicePrivate {
///////////////////////////////////////////////////////////////////////
//
// TrkDevicePrivate
//
///////////////////////////////////////////////////////////////////////
struct TrkDevicePrivate
{
TrkDevicePrivate();
TrkWriteQueue queue;
#ifdef Q_OS_WIN
HANDLE hdevice;
#else
@@ -298,11 +301,13 @@ TrkDevicePrivate::TrkDevicePrivate() :
TrkDevice::TrkDevice(QObject *parent) :
QObject(parent),
d(new TrkDevicePrivate),
qd(new TrkWriteQueue)
d(new TrkDevicePrivate)
{}
TrkDevice::~TrkDevice()
{
connect(this, SIGNAL(messageReceived(trk::TrkResult)),
this, SLOT(slotHandleResult(trk::TrkResult)));
close();
delete d;
}
bool TrkDevice::open(const QString &port, QString *errorMessage)
@@ -355,14 +360,6 @@ bool TrkDevice::open(const QString &port, QString *errorMessage)
#endif
}
TrkDevice::~TrkDevice()
{
close();
delete d;
delete qd;
}
void TrkDevice::close()
{
if (!isOpen())
@@ -492,7 +489,7 @@ void TrkDevice::tryTrkRead()
while (extractResult(&d->trkReadBuffer, d->serialFrame, &r, &rawData)) {
//if (verbose())
// logMessage("Read TrkResult " + r.data.toHex());
qDebug() << "RECEIVE DATA: " << r.data.toHex();
d->queue.slotHandleResult(r);
emit messageReceived(r);
if (!rawData.isEmpty())
emit rawDataReceived(rawData);
@@ -513,14 +510,14 @@ void TrkDevice::emitError(const QString &s)
}
void TrkDevice::sendTrkMessage(byte code, Callback callback,
const QByteArray &data, const QVariant &cookie, bool invokeOnNAK)
const QByteArray &data, const QVariant &cookie)
{
qd->queueTrkMessage(code, callback, data, cookie, invokeOnNAK);
d->queue.queueTrkMessage(code, callback, data, cookie);
}
void TrkDevice::sendTrkInitialPing()
{
qd->queueTrkInitialPing();
d->queue.queueTrkInitialPing();
}
bool TrkDevice::sendTrkAck(byte token)
@@ -536,10 +533,10 @@ bool TrkDevice::sendTrkAck(byte token)
void TrkDevice::tryTrkWrite()
{
TrkMessage message;
if (!qd->pendingMessage(&message))
if (!d->queue.pendingMessage(&message))
return;
const bool success = trkWriteRawMessage(message);
qd->notifyWriteResult(success);
d->queue.notifyWriteResult(success);
}
bool TrkDevice::trkWriteRawMessage(const TrkMessage &msg)
@@ -554,10 +551,5 @@ bool TrkDevice::trkWriteRawMessage(const TrkMessage &msg)
return rc;
}
void TrkDevice::slotHandleResult(const TrkResult &result)
{
qd->slotHandleResult(result);
}
} // namespace trk

View File

@@ -46,8 +46,6 @@ namespace trk {
struct TrkResult;
struct TrkMessage;
struct TrkDevicePrivate;
class TrkWriteQueue;
struct TrkWriteQueueIODevicePrivate;
/* TrkDevice: Implements a Windows COM or Linux device for
* Trk communications. Provides synchronous write and asynchronous
@@ -106,9 +104,7 @@ public:
void sendTrkMessage(unsigned char code,
Callback callBack = Callback(),
const QByteArray &data = QByteArray(),
const QVariant &cookie = QVariant(),
// Invoke callback on receiving NAK, too.
bool invokeOnNAK = false);
const QVariant &cookie = QVariant());
// Enqeue an initial ping
void sendTrkInitialPing();
@@ -116,15 +112,11 @@ public:
// Send an Ack synchronously, bypassing the queue
bool sendTrkAck(unsigned char token);
private slots:
void slotHandleResult(const trk::TrkResult &);
private:
void tryTrkWrite();
bool trkWriteRawMessage(const TrkMessage &msg);
TrkDevicePrivate *d;
TrkWriteQueue *qd;
};
} // namespace trk

View File

@@ -27,8 +27,8 @@
**
**************************************************************************/
#ifndef _TRK_FUNCTOR_H_
#define _TRK_FUNCTOR_H_
#ifndef DEBUGGER_TRK_FUNCTOR_H
#define DEBUGGER_TRK_FUNCTOR_H
#include <QtGlobal>

View File

@@ -43,6 +43,11 @@ QByteArray hexNumber(uint n, int digits)
return QByteArray(digits - ba.size(), '0') + ba;
}
QByteArray hexxNumber(uint n, int digits)
{
return "0x" + hexNumber(n, digits);
}
TrkResult::TrkResult() :
code(0),
token(0),
@@ -345,5 +350,16 @@ int TrkResult::errorCode() const
return errorCode;
return isNAK ? 0xff : 0;
}
QString TrkResult::errorString() const
{
// NAK means always error, else data sized 1 with a non-null element
if (code == 0xff)
return "NAK";
if (data.size() < 1)
return "Unknown error packet";
return errorMessage(data.at(0));
}
} // namespace trk

View File

@@ -144,7 +144,7 @@ struct Session
uint tid;
uint codeseg;
uint dataseg;
QHash<uint, uint> tokenToBreakpointIndex;
QHash<uint, uint> addressToBP;
// Gdb request
uint currentThread;
@@ -178,6 +178,7 @@ struct TrkResult
QString toString() const;
// 0 for no error.
int errorCode() const;
QString errorString() const;
byte code;
byte token;
@@ -193,9 +194,9 @@ ushort isValidTrkResult(const QByteArray &buffer, bool serialFrame);
bool extractResult(QByteArray *buffer, bool serialFrame, TrkResult *r, QByteArray *rawData = 0);
QByteArray errorMessage(byte code);
QByteArray hexNumber(uint n, int digits = 0);
QByteArray hexxNumber(uint n, int digits = 0); // prepends '0x', too
uint swapEndian(uint in);
} // namespace trk
#endif // DEBUGGER_TRK_UTILS

View File

@@ -220,7 +220,7 @@ void TcfEngine::exitDebugger()
qq->notifyInferiorExited();
}
bool TcfEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
void TcfEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
{
qq->notifyInferiorRunningRequested();
const int pos = sp->remoteChannel.indexOf(QLatin1Char(':'));
@@ -228,7 +228,7 @@ bool TcfEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
const quint16 port = sp->remoteChannel.mid(pos + 1).toInt();
//QTimer::singleShot(0, this, SLOT(runInferior()));
m_socket->connectToHost(host, port);
return true;
emit startSuccessful();
}
void TcfEngine::continueInferior()

View File

@@ -82,7 +82,7 @@ private:
void shutdown();
void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
bool startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
void startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
void exitDebugger();
void continueInferior();

View File

@@ -1,4 +1,4 @@
<plugin name="Designer" version="1.2.80" compatVersion="1.2.80">
<plugin name="Designer" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,8 +19,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Qt Designer integration.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
<!-- For compiling with CPP support enabled -->
<dependency name="CppEditor" version="1.2.80"/>
<dependency name="CppEditor" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="DuiEditor" version="1.2.80" compatVersion="1.2.80">
<plugin name="DuiEditor" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,7 +19,7 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Editor for DUI.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
<dependency name="TextEditor" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="FakeVim" version="1.2.80" compatVersion="1.2.80">
<plugin name="FakeVim" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,9 +19,9 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>VI-style keyboard navigation.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="CppEditor" version="1.2.80"/><!-- Plugin adds items to the editor's context menu -->
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="Core" version="1.2.80"/>
<dependency name="CppEditor" version="1.2.91"/><!-- Plugin adds items to the editor's context menu -->
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="ProjectExplorer" version="1.2.91"/>
<dependency name="Core" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="Find" version="1.2.80" compatVersion="1.2.80">
<plugin name="Find" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,6 +19,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Provides the find widget and the hooks for find implementations.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -125,7 +125,7 @@ QString BaseTextFind::completedFindString() const
return cursor.selectedText();
}
bool BaseTextFind::findIncremental(const QString &txt, IFindSupport::FindFlags findFlags)
IFindSupport::Result BaseTextFind::findIncremental(const QString &txt, IFindSupport::FindFlags findFlags)
{
QTextCursor cursor = textCursor();
if (m_incrementalStartPos < 0)
@@ -137,15 +137,15 @@ bool BaseTextFind::findIncremental(const QString &txt, IFindSupport::FindFlags f
emit highlightAll(txt, findFlags);
else
emit highlightAll(QString(), 0);
return found;
return found ? Found : NotFound;
}
bool BaseTextFind::findStep(const QString &txt, IFindSupport::FindFlags findFlags)
IFindSupport::Result BaseTextFind::findStep(const QString &txt, IFindSupport::FindFlags findFlags)
{
bool found = find(txt, findFlags, textCursor());
if (found)
m_incrementalStartPos = textCursor().selectionStart();
return found;
return found ? Found : NotFound;
}
namespace {

View File

@@ -53,8 +53,8 @@ public:
QString currentFindString() const;
QString completedFindString() const;
bool findIncremental(const QString &txt, IFindSupport::FindFlags findFlags);
bool findStep(const QString &txt, IFindSupport::FindFlags findFlags);
Result findIncremental(const QString &txt, IFindSupport::FindFlags findFlags);
Result findStep(const QString &txt, IFindSupport::FindFlags findFlags);
bool replaceStep(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags);
int replaceAll(const QString &before, const QString &after,

View File

@@ -106,15 +106,15 @@ void CurrentDocumentFind::highlightAll(const QString &txt, IFindSupport::FindFla
m_currentFind->highlightAll(txt, findFlags);
}
bool CurrentDocumentFind::findIncremental(const QString &txt, IFindSupport::FindFlags findFlags)
IFindSupport::Result CurrentDocumentFind::findIncremental(const QString &txt, IFindSupport::FindFlags findFlags)
{
QTC_ASSERT(m_currentFind, return false);
QTC_ASSERT(m_currentFind, return IFindSupport::NotFound);
return m_currentFind->findIncremental(txt, findFlags);
}
bool CurrentDocumentFind::findStep(const QString &txt, IFindSupport::FindFlags findFlags)
IFindSupport::Result CurrentDocumentFind::findStep(const QString &txt, IFindSupport::FindFlags findFlags)
{
QTC_ASSERT(m_currentFind, return false);
QTC_ASSERT(m_currentFind, return IFindSupport::NotFound);
return m_currentFind->findStep(txt, findFlags);
}

View File

@@ -55,8 +55,8 @@ public:
bool isEnabled() const;
bool candidateIsEnabled() const;
void highlightAll(const QString &txt, IFindSupport::FindFlags findFlags);
bool findIncremental(const QString &txt, IFindSupport::FindFlags findFlags);
bool findStep(const QString &txt, IFindSupport::FindFlags findFlags);
IFindSupport::Result findIncremental(const QString &txt, IFindSupport::FindFlags findFlags);
IFindSupport::Result findStep(const QString &txt, IFindSupport::FindFlags findFlags);
bool replaceStep(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags);
int replaceAll(const QString &before, const QString &after,

View File

@@ -69,7 +69,8 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
m_replaceNextAction(0),
m_casesensitiveIcon(":/find/images/casesensitively.png"),
m_regexpIcon(":/find/images/regexp.png"),
m_wholewordsIcon(":/find/images/wholewords.png")
m_wholewordsIcon(":/find/images/wholewords.png"),
m_findIncrementalTimer(this), m_findStepTimer(this)
{
//setup ui
m_ui.setupUi(this);
@@ -215,6 +216,12 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
connect(m_currentDocumentFind, SIGNAL(candidateChanged()), this, SLOT(adaptToCandidate()));
connect(m_currentDocumentFind, SIGNAL(changed()), this, SLOT(updateToolBar()));
updateToolBar();
m_findIncrementalTimer.setSingleShot(true);
m_findStepTimer.setSingleShot(true);
connect(&m_findIncrementalTimer, SIGNAL(timeout()),
this, SLOT(invokeFindIncremental()));
connect(&m_findStepTimer, SIGNAL(timeout()), this, SLOT(invokeFindStep()));
}
FindToolBar::~FindToolBar()
@@ -373,17 +380,27 @@ void FindToolBar::selectFindText()
void FindToolBar::invokeFindStep()
{
m_findStepTimer.stop();
m_findIncrementalTimer.stop();
if (m_currentDocumentFind->isEnabled()) {
m_plugin->updateFindCompletion(getFindText());
m_currentDocumentFind->findStep(getFindText(), effectiveFindFlags());
IFindSupport::Result result =
m_currentDocumentFind->findStep(getFindText(), effectiveFindFlags());
if (result == IFindSupport::NotYetFound)
m_findStepTimer.start(50);
}
}
void FindToolBar::invokeFindIncremental()
{
m_findIncrementalTimer.stop();
m_findStepTimer.stop();
if (m_currentDocumentFind->isEnabled()) {
QString text = getFindText();
m_currentDocumentFind->findIncremental(text, effectiveFindFlags());
IFindSupport::Result result =
m_currentDocumentFind->findIncremental(text, effectiveFindFlags());
if (result == IFindSupport::NotYetFound)
m_findIncrementalTimer.start(50);
if (text.isEmpty())
m_currentDocumentFind->clearResults();
}
@@ -421,6 +438,8 @@ void FindToolBar::invokeReplaceAll()
void FindToolBar::invokeResetIncrementalSearch()
{
m_findIncrementalTimer.stop();
m_findStepTimer.stop();
if (m_currentDocumentFind->isEnabled())
m_currentDocumentFind->resetIncrementalSearch();
}

View File

@@ -37,6 +37,8 @@
#include <coreplugin/findplaceholder.h>
#include <utils/styledbar.h>
#include <QtCore/QTimer>
#include <QtGui/QStringListModel>
#include <QtGui/QWidget>
#include <QtGui/QLabel>
@@ -124,6 +126,9 @@ private:
QPixmap m_casesensitiveIcon;
QPixmap m_regexpIcon;
QPixmap m_wholewordsIcon;
QTimer m_findIncrementalTimer;
QTimer m_findStepTimer;
};
} // namespace Internal

View File

@@ -50,6 +50,8 @@ public:
};
Q_DECLARE_FLAGS(FindFlags, FindFlag)
enum Result { Found, NotFound, NotYetFound };
IFindSupport() : QObject(0) {}
virtual ~IFindSupport() {}
@@ -61,8 +63,8 @@ public:
virtual QString completedFindString() const = 0;
virtual void highlightAll(const QString &txt, FindFlags findFlags);
virtual bool findIncremental(const QString &txt, FindFlags findFlags) = 0;
virtual bool findStep(const QString &txt, FindFlags findFlags) = 0;
virtual Result findIncremental(const QString &txt, FindFlags findFlags) = 0;
virtual Result findStep(const QString &txt, FindFlags findFlags) = 0;
virtual bool replaceStep(const QString &before, const QString &after,
FindFlags findFlags) = 0;
virtual int replaceAll(const QString &before, const QString &after,

View File

@@ -1,4 +1,4 @@
<plugin name="GenericProjectManager" version="1.2.80" compatVersion="1.2.80">
<plugin name="GenericProjectManager" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,9 +19,9 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Generic support</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="CppTools" version="1.2.80"/>
<dependency name="CppEditor" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="ProjectExplorer" version="1.2.91"/>
<dependency name="CppTools" version="1.2.91"/>
<dependency name="CppEditor" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="ScmGit" version="1.2.80" compatVersion="1.2.80">
<plugin name="ScmGit" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,9 +19,9 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Git integration.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="Core" version="1.2.80"/>
<dependency name="VCSBase" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="ProjectExplorer" version="1.2.91"/>
<dependency name="Core" version="1.2.91"/>
<dependency name="VCSBase" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="HelloWorld" version="1.2.80" compatVersion="1.2.80">
<plugin name="HelloWorld" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,6 +19,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Hello World sample plugin.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="Help" version="1.2.80" compatVersion="1.2.80">
<plugin name="Help" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,8 +19,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Help system.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="Find" version="1.2.80"/>
<dependency name="QuickOpen" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
<dependency name="Find" version="1.2.91"/>
<dependency name="QuickOpen" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -72,17 +72,19 @@ QString HelpFindSupport::completedFindString() const
return QString();
}
bool HelpFindSupport::findIncremental(const QString &txt, Find::IFindSupport::FindFlags findFlags)
Find::IFindSupport::Result HelpFindSupport::findIncremental(const QString &txt, Find::IFindSupport::FindFlags findFlags)
{
QTC_ASSERT(m_centralWidget, return false);
QTC_ASSERT(m_centralWidget, return NotFound);
findFlags &= ~Find::IFindSupport::FindBackward;
return m_centralWidget->find(txt, Find::IFindSupport::textDocumentFlagsForFindFlags(findFlags), true);
return m_centralWidget->find(txt, Find::IFindSupport::textDocumentFlagsForFindFlags(findFlags), true)
? Found : NotFound;
}
bool HelpFindSupport::findStep(const QString &txt, Find::IFindSupport::FindFlags findFlags)
Find::IFindSupport::Result HelpFindSupport::findStep(const QString &txt, Find::IFindSupport::FindFlags findFlags)
{
QTC_ASSERT(m_centralWidget, return false);
return m_centralWidget->find(txt, Find::IFindSupport::textDocumentFlagsForFindFlags(findFlags), false);
QTC_ASSERT(m_centralWidget, return NotFound);
return m_centralWidget->find(txt, Find::IFindSupport::textDocumentFlagsForFindFlags(findFlags), false)
? Found : NotFound;
}
HelpViewerFindSupport::HelpViewerFindSupport(HelpViewer *viewer)
@@ -106,17 +108,17 @@ QString HelpViewerFindSupport::currentFindString() const
#endif
}
bool HelpViewerFindSupport::findIncremental(const QString &txt, Find::IFindSupport::FindFlags findFlags)
Find::IFindSupport::Result HelpViewerFindSupport::findIncremental(const QString &txt, Find::IFindSupport::FindFlags findFlags)
{
QTC_ASSERT(m_viewer, return false);
QTC_ASSERT(m_viewer, return NotFound);
findFlags &= ~Find::IFindSupport::FindBackward;
return find(txt, findFlags, true);
return find(txt, findFlags, true) ? Found : NotFound;
}
bool HelpViewerFindSupport::findStep(const QString &txt, Find::IFindSupport::FindFlags findFlags)
Find::IFindSupport::Result HelpViewerFindSupport::findStep(const QString &txt, Find::IFindSupport::FindFlags findFlags)
{
QTC_ASSERT(m_viewer, return false);
return find(txt, findFlags, false);
QTC_ASSERT(m_viewer, return NotFound);
return find(txt, findFlags, false) ? Found : NotFound;
}
bool HelpViewerFindSupport::find(const QString &txt, Find::IFindSupport::FindFlags findFlags, bool incremental)

View File

@@ -57,8 +57,8 @@ public:
QString currentFindString() const;
QString completedFindString() const;
bool findIncremental(const QString &txt, Find::IFindSupport::FindFlags findFlags);
bool findStep(const QString &txt, Find::IFindSupport::FindFlags findFlags);
Result findIncremental(const QString &txt, Find::IFindSupport::FindFlags findFlags);
Result findStep(const QString &txt, Find::IFindSupport::FindFlags findFlags);
bool replaceStep(const QString &, const QString &,
Find::IFindSupport::FindFlags ) { return false; }
int replaceAll(const QString &, const QString &,
@@ -84,8 +84,8 @@ public:
QString currentFindString() const;
QString completedFindString() const { return QString(); }
bool findIncremental(const QString &txt, Find::IFindSupport::FindFlags findFlags);
bool findStep(const QString &txt, Find::IFindSupport::FindFlags findFlags);
Result findIncremental(const QString &txt, Find::IFindSupport::FindFlags findFlags);
Result findStep(const QString &txt, Find::IFindSupport::FindFlags findFlags);
bool replaceStep(const QString &, const QString &,
Find::IFindSupport::FindFlags ) { return false; }
int replaceAll(const QString &, const QString &,

View File

@@ -1,4 +1,4 @@
<plugin name="Perforce" version="1.2.80" compatVersion="1.2.80">
<plugin name="Perforce" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,9 +19,9 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Perforce integration.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="Core" version="1.2.80"/>
<dependency name="VCSBase" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="ProjectExplorer" version="1.2.91"/>
<dependency name="Core" version="1.2.91"/>
<dependency name="VCSBase" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="ProjectExplorer" version="1.2.80" compatVersion="1.2.80">
<plugin name="ProjectExplorer" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,9 +19,9 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>ProjectExplorer framework that can be extended with different kind of project types.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="Find" version="1.2.80"/>
<dependency name="QuickOpen" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
<dependency name="Find" version="1.2.91"/>
<dependency name="QuickOpen" version="1.2.91"/>
<dependency name="TextEditor" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="QmlProjectManager" version="1.2.80" compatVersion="1.2.80">
<plugin name="QmlProjectManager" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,10 +19,10 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Qml support</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="CppTools" version="1.2.80"/>
<dependency name="CppEditor" version="1.2.80"/>
<dependency name="Help" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="ProjectExplorer" version="1.2.91"/>
<dependency name="CppTools" version="1.2.91"/>
<dependency name="CppEditor" version="1.2.91"/>
<dependency name="Help" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="Qt4ProjectManager" version="1.2.80" compatVersion="1.2.80">
<plugin name="Qt4ProjectManager" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,11 +19,11 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Provides project type for Qt 4 pro files and tools.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="CppTools" version="1.2.80"/>
<dependency name="CppEditor" version="1.2.80"/>
<dependency name="Help" version="1.2.80"/>
<dependency name="Designer" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="ProjectExplorer" version="1.2.91"/>
<dependency name="CppTools" version="1.2.91"/>
<dependency name="CppEditor" version="1.2.91"/>
<dependency name="Help" version="1.2.91"/>
<dependency name="Designer" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -537,36 +537,34 @@ S60DeviceRunControl::S60DeviceRunControl(QSharedPointer<RunConfiguration> runCon
this, SLOT(signsisProcessFailed()));
connect(m_signsis, SIGNAL(finished(int,QProcess::ExitStatus)),
this, SLOT(signsisProcessFinished()));
Qt4Project *project = qobject_cast<Qt4Project *>(runConfiguration->project());
QTC_ASSERT(project, return);
m_serialPortName = runConfiguration->serialPortName();
m_serialPortFriendlyName = S60Manager::instance()->serialDeviceLister()->friendlyNameForPort(m_serialPortName);
m_targetName = runConfiguration->targetName();
m_baseFileName = runConfiguration->basePackageFilePath();
m_workingDirectory = QFileInfo(m_baseFileName).absolutePath();
m_qtDir = project->qtVersion(project->activeBuildConfiguration())->versionInfo().value("QT_INSTALL_DATA");
m_useCustomSignature = (runConfiguration->signingMode() == S60DeviceRunConfiguration::SignCustom);
m_customSignaturePath = runConfiguration->customSignaturePath();
m_customKeyPath = runConfiguration->customKeyPath();
m_toolsDirectory = S60Manager::instance()->deviceForQtVersion(
project->qtVersion(project->activeBuildConfiguration())).toolsRoot
+ "/epoc32/tools";
m_executableFileName = lsFile(runConfiguration->executableFileName());
const QString makesisTool = m_toolsDirectory + "/makesis.exe";
const QString packageFile = QFileInfo(runConfiguration->packageFileName()).fileName();
}
void S60DeviceRunControl::start()
{
QSharedPointer<S60DeviceRunConfiguration> rc = runConfiguration().objectCast<S60DeviceRunConfiguration>();
QTC_ASSERT(!rc.isNull(), return);
Qt4Project *project = qobject_cast<Qt4Project *>(rc->project());
QTC_ASSERT(project, return);
m_serialPortName = rc->serialPortName();
m_serialPortFriendlyName = S60Manager::instance()->serialDeviceLister()->friendlyNameForPort(m_serialPortName);
m_targetName = rc->targetName();
m_baseFileName = rc->basePackageFilePath();
m_workingDirectory = QFileInfo(m_baseFileName).absolutePath();
m_qtDir = project->qtVersion(project->activeBuildConfiguration())->versionInfo().value("QT_INSTALL_DATA");
m_useCustomSignature = (rc->signingMode() == S60DeviceRunConfiguration::SignCustom);
m_customSignaturePath = rc->customSignaturePath();
m_customKeyPath = rc->customKeyPath();
emit started();
emit addToOutputWindow(this, tr("Creating %1.sisx ...").arg(QDir::toNativeSeparators(m_baseFileName)));
emit addToOutputWindow(this, tr("Executable file: %1").arg(lsFile(rc->executableFileName())));
emit addToOutputWindow(this, tr("Executable file: %1").arg(m_executableFileName));
m_toolsDirectory = S60Manager::instance()->deviceForQtVersion(
project->qtVersion(project->activeBuildConfiguration())).toolsRoot
+ "/epoc32/tools";
const QString makesisTool = m_toolsDirectory + "/makesis.exe";
const QString packageFile = QFileInfo(rc->packageFileName()).fileName();
m_makesis->setWorkingDirectory(m_workingDirectory);
emit addToOutputWindow(this, tr("%1 %2").arg(QDir::toNativeSeparators(makesisTool), packageFile));

View File

@@ -176,6 +176,7 @@ private:
QString m_baseFileName;
QString m_workingDirectory;
QString m_toolsDirectory;
QString m_executableFileName;
QString m_qtDir;
bool m_useCustomSignature;
QString m_customSignaturePath;

View File

@@ -325,7 +325,7 @@ static inline QString msgHtmlHelperToolTip(const QFileInfo &fi)
return QtOptionsPageWidget::tr("<html><body><table><tr><td>File:</td><td><pre>%1</pre></td></tr>"
"<tr><td>Last&nbsp;modified:</td><td>%2</td></tr>"
"<tr><td>Size:</td><td>%3 Bytes</td></tr></table></body></html>").
arg(fi.absoluteFilePath()).
arg(QDir::toNativeSeparators(fi.absoluteFilePath())).
arg(fi.lastModified().toString(Qt::SystemLocaleLongDate)).
arg(fi.size());
}

View File

@@ -1244,7 +1244,7 @@ QStringList QtVersion::debuggingHelperLibraryLocations() const
{
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
if (qtInstallData.isEmpty())
QString::null;
return QStringList();
return DebuggingHelperLibrary::debuggingHelperLibraryLocations(qtInstallData);
}

View File

@@ -1,4 +1,4 @@
<plugin name="QtScriptEditor" version="1.2.80" compatVersion="1.2.80">
<plugin name="QtScriptEditor" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,7 +19,7 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Editor for QtScript.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
<dependency name="TextEditor" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="QuickOpen" version="1.2.80" compatVersion="1.2.80">
<plugin name="QuickOpen" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,6 +19,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Provides the Locator widget and the hooks for QuickOpen filter implementations.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="RegExp" version="1.2.80" compatVersion="1.2.80">
<plugin name="RegExp" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,6 +19,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Regular Expression test widget.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="ResourceEditor" version="1.2.80" compatVersion="1.2.80">
<plugin name="ResourceEditor" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,6 +19,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Editor for qrc files.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="Snippets" version="1.2.80" compatVersion="1.2.80">
<plugin name="Snippets" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,8 +19,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Code snippet plugin.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="ProjectExplorer" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="Subversion" version="1.2.80" compatVersion="1.2.80">
<plugin name="Subversion" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,9 +19,9 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Subversion integration.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="Core" version="1.2.80"/>
<dependency name="VCSBase" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="ProjectExplorer" version="1.2.91"/>
<dependency name="Core" version="1.2.91"/>
<dependency name="VCSBase" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="TextEditor" version="1.2.80" compatVersion="1.2.80">
<plugin name="TextEditor" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,8 +19,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Text editor framework and the implementation of the basic text editor.</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="Find" version="1.2.80"/>
<dependency name="QuickOpen" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
<dependency name="Find" version="1.2.91"/>
<dependency name="QuickOpen" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -93,7 +93,7 @@ bool BaseTextDocument::save(const QString &fileName)
cursor.beginEditBlock();
if (m_storageSettings.m_cleanWhitespace)
cleanWhitespace(cursor, m_storageSettings.m_inEntireDocument);
cleanWhitespace(cursor, m_storageSettings.m_cleanIndentation, m_storageSettings.m_inEntireDocument);
if (m_storageSettings.m_addFinalNewLine)
ensureFinalNewLine(cursor);
cursor.endEditBlock();
@@ -301,23 +301,28 @@ void BaseTextDocument::setSyntaxHighlighter(QSyntaxHighlighter *highlighter)
void BaseTextDocument::cleanWhitespace()
void BaseTextDocument::cleanWhitespace(const QTextCursor &cursor)
{
QTextCursor cursor(m_document);
cursor.beginEditBlock();
cleanWhitespace(cursor, true);
if (m_storageSettings.m_addFinalNewLine)
ensureFinalNewLine(cursor);
cursor.endEditBlock();
bool hasSelection = cursor.hasSelection();
QTextCursor copyCursor = cursor;
copyCursor.beginEditBlock();
cleanWhitespace(copyCursor, true, true);
if (!hasSelection)
ensureFinalNewLine(copyCursor);
copyCursor.endEditBlock();
}
void BaseTextDocument::cleanWhitespace(QTextCursor& cursor, bool inEntireDocument)
void BaseTextDocument::cleanWhitespace(QTextCursor& cursor, bool cleanIndentation, bool inEntireDocument)
{
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(m_document->documentLayout());
QTextBlock block = m_document->firstBlock();
while (block.isValid()) {
QTextBlock block = m_document->findBlock(cursor.selectionStart());
QTextBlock end;
if (cursor.hasSelection())
end = m_document->findBlock(cursor.selectionEnd()-1).next();
while (block.isValid() && block != end) {
if (inEntireDocument || block.revision() > documentLayout->lastSaveRevision) {
@@ -327,7 +332,7 @@ void BaseTextDocument::cleanWhitespace(QTextCursor& cursor, bool inEntireDocumen
cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, trailing);
cursor.removeSelectedText();
}
if (m_storageSettings.m_cleanIndentation && !m_tabSettings.isIndentationClean(blockText)) {
if (cleanIndentation && !m_tabSettings.isIndentationClean(blockText)) {
cursor.setPosition(block.position());
int firstNonSpace = m_tabSettings.firstNonSpace(blockText);
if (firstNonSpace == blockText.length()) {

View File

@@ -110,7 +110,7 @@ public:
void reload(QTextCodec *codec);
void cleanWhitespace();
void cleanWhitespace(const QTextCursor &cursor);
signals:
void titleChanged(QString title);
@@ -146,7 +146,7 @@ private:
bool m_hasDecodingError;
QByteArray m_decodingErrorSample;
void cleanWhitespace(QTextCursor& cursor, bool onlyInModifiedLines);
void cleanWhitespace(QTextCursor& cursor, bool cleanIndentation, bool inEntireDocument);
void ensureFinalNewLine(QTextCursor& cursor);
};

View File

@@ -833,7 +833,7 @@ void BaseTextEditor::moveLineUpDown(bool up)
void BaseTextEditor::cleanWhitespace()
{
d->m_document->cleanWhitespace();
d->m_document->cleanWhitespace(textCursor());
}
void BaseTextEditor::keyPressEvent(QKeyEvent *e)
@@ -887,13 +887,18 @@ void BaseTextEditor::keyPressEvent(QKeyEvent *e)
QTextCursor cursor = textCursor();
if (d->m_inBlockSelectionMode)
cursor.clearSelection();
if (d->m_document->tabSettings().m_autoIndent) {
const TabSettings &ts = d->m_document->tabSettings();
if (ts.m_autoIndent) {
cursor.beginEditBlock();
cursor.insertBlock();
indent(document(), cursor, QChar::Null);
cursor.endEditBlock();
} else {
cursor.beginEditBlock();
QString previousBlockText = cursor.block().text();
cursor.insertBlock();
cursor.insertText(ts.indentationString(previousBlockText));
cursor.endEditBlock();
}
e->accept();
setTextCursor(cursor);
@@ -3189,17 +3194,14 @@ void BaseTextEditor::handleBackspaceKey()
continue;
previousIndent = tabSettings.columnAt(previousNonEmptyBlockText,
tabSettings.firstNonSpace(previousNonEmptyBlockText));
if (previousIndent < indent)
if (previousIndent < indent) {
cursor.beginEditBlock();
cursor.setPosition(currentBlock.position(), QTextCursor::KeepAnchor);
cursor.insertText(tabSettings.indentationString(previousNonEmptyBlockText));
cursor.endEditBlock();
break;
}
}
if (previousIndent >= indent)
previousIndent = 0;
cursor.beginEditBlock();
cursor.setPosition(currentBlock.position(), QTextCursor::KeepAnchor);
cursor.insertText(tabSettings.indentationString(0, previousIndent));
cursor.endEditBlock();
}
void BaseTextEditor::wheelEvent(QWheelEvent *e)

View File

@@ -156,7 +156,17 @@ bool CompletionWidget::event(QEvent *e)
closeList(currentIndex());
return true;
case Qt::Key_Up:
if (currentIndex().row() == 0) {
setCurrentIndex(model()->index(model()->rowCount()-1, 0));
return true;
}
forwardKeys = false;
break;
case Qt::Key_Down:
if (currentIndex().row() == model()->rowCount()-1) {
setCurrentIndex(model()->index(0, 0));
return true;
}
case Qt::Key_Enter:
case Qt::Key_PageDown:
case Qt::Key_PageUp:

View File

@@ -110,6 +110,18 @@ int TabSettings::firstNonSpace(const QString &text) const
return i;
}
QString TabSettings::indentationString(const QString &text) const
{
return text.left(firstNonSpace(text));
}
int TabSettings::indentationColumn(const QString &text) const
{
return columnAt(text, firstNonSpace(text));
}
int TabSettings::trailingWhitespaces(const QString &text) const
{
int i = 0;
@@ -225,7 +237,7 @@ void TabSettings::indentLine(QTextBlock block, int newIndent) const
const int oldBlockLength = text.size();
// Quickly check whether indenting is required.
if (oldBlockLength == 0 && newIndent == 0)
if (indentationColumn(text) == newIndent)
return;
const QString indentString = indentationString(0, newIndent);
@@ -234,12 +246,6 @@ void TabSettings::indentLine(QTextBlock block, int newIndent) const
if (oldBlockLength == indentString.length() && text == indentString)
return;
if (oldBlockLength > indentString.length() &&
text.startsWith(indentString) &&
!text.at(indentString.length()).isSpace()) {
return;
}
QTextCursor cursor(block);
cursor.beginEditBlock();
cursor.movePosition(QTextCursor::StartOfBlock);

View File

@@ -63,6 +63,8 @@ struct TEXTEDITOR_EXPORT TabSettings
int spacesLeftFromPosition(const QString &text, int position) const;
int indentedColumn(int column, bool doIndent = true) const;
QString indentationString(int startColumn, int targetColumn) const;
QString indentationString(const QString &text) const;
int indentationColumn(const QString &text) const;
void indentLine(QTextBlock block, int newIndent) const;

View File

@@ -1,4 +1,4 @@
<plugin name="VCSBase" version="1.2.80" compatVersion="1.2.80">
<plugin name="VCSBase" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,8 +19,8 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Version Control System Base Plugin</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="TextEditor" version="1.2.80"/>
<dependency name="ProjectExplorer" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
<dependency name="TextEditor" version="1.2.91"/>
<dependency name="ProjectExplorer" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1,4 +1,4 @@
<plugin name="Welcome" version="1.2.80" compatVersion="1.2.80">
<plugin name="Welcome" version="1.2.91" compatVersion="1.2.91">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
@@ -19,6 +19,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Default Welcome Screen Plugin</description>
<url>http://qt.nokia.com</url>
<dependencyList>
<dependency name="Core" version="1.2.80"/>
<dependency name="Core" version="1.2.91"/>
</dependencyList>
</plugin>

View File

@@ -1139,10 +1139,11 @@ ProItem::ProItemReturn ProFileEvaluator::Private::visitBeginProFile(ProFile * pr
}
if (!qmake_cache.isEmpty()) {
qmake_cache = QDir::cleanPath(qmake_cache);
if (evaluateFileInto(qmake_cache, &m_option->cache_valuemap, 0)) {
QHash<QString, QStringList> cache_valuemap;
if (evaluateFileInto(qmake_cache, &cache_valuemap, 0)) {
m_option->cachefile = qmake_cache;
if (m_option->qmakespec.isEmpty()) {
const QStringList &vals = m_option->cache_valuemap.value(QLatin1String("QMAKESPEC"));
const QStringList &vals = cache_valuemap.value(QLatin1String("QMAKESPEC"));
if (!vals.isEmpty())
m_option->qmakespec = vals.first();
}
@@ -1196,8 +1197,9 @@ ProItem::ProItemReturn ProFileEvaluator::Private::visitBeginProFile(ProFile * pr
if (!evaluateFileInto(spec,
&m_option->base_valuemap, &m_option->base_functions)) {
errorMessage(format("Could not read qmake configuration file %1").arg(spec));
} else {
evaluateFileInto(qmake_cache, &m_option->base_valuemap, 0);
} else if (!m_option->cachefile.isEmpty()) {
evaluateFileInto(m_option->cachefile,
&m_option->base_valuemap, &m_option->base_functions);
}
}

View File

@@ -88,8 +88,7 @@ public:
friend class ProFileEvaluator;
friend class ProFileEvaluator::Private;
static QString field_sep; // Just a cache for quick construction
QHash<QString, QStringList> cache_valuemap; // Cached results of .qmake.cache
QHash<QString, QStringList> base_valuemap; // ~ and qmake.conf and default_pre.prf
QHash<QString, QStringList> base_valuemap; // Cached results of qmake.conf, .qmake.cache & default_pre.prf
FunctionDefs base_functions;
QStringList feature_roots;
};

View File

@@ -1,14 +1,20 @@
TEMPLATE = app
DEBUGGERHOME = ../../../src/plugins/debugger/symbian
INCLUDEPATH *= $$DEBUGGERHOME
UTILSDIR = ../../../src/libs
QT = core network
win32:CONFIG+=console
HEADERS += trkutils.h \
trkfunctor.h \
trkdevice.h \
HEADERS += \
$$DEBUGGERHOME/trkutils.h \
$$DEBUGGERHOME/trkfunctor.h \
$$PWD/trkdevice.h \
SOURCES += \
adapter.cpp \
trkutils.cpp \
trkdevice.cpp
$$DEBUGGERHOME/trkutils.cpp \
$$PWD/trkdevice.cpp \
$$PWD/adapter.cpp \

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,23 @@
TEMPLATE = app
DEBUGGERHOME = ../../../src/plugins/debugger/symbian
INCLUDEPATH *= $$DEBUGGERHOME
DEFINES += STANDALONE_RUNNER
QT += network
win32:CONFIG+=console
HEADERS += \
trkutils.h \
trkdevicex.h \
$$DEBUGGERHOME/../gdb/gdbprocessbase.h \
$$DEBUGGERHOME/trkutils.h \
$$DEBUGGERHOME/trkclient.h \
$$DEBUGGERHOME/symbianadapter.h \
SOURCES += \
runner.cpp \
trkutils.cpp \
trkdevicex.cpp \
$$DEBUGGERHOME/trkutils.cpp \
$$DEBUGGERHOME/trkclient.cpp \
$$DEBUGGERHOME/symbianadapter.cpp \
$$PWD/runner.cpp \

View File

@@ -1,9 +1,15 @@
DEFINES += DEBUG_TRK=0
INCLUDEPATH *= $$PWD
SOURCES += $$PWD/launcher.cpp \
$$PWD/trkutils.cpp \
$$PWD/trkdevice.cpp
HEADERS += $$PWD/trkutils.h \
$$PWD/trkfunctor.h \
DEBUGGERHOME = ../../../src/plugins/debugger/symbian
INCLUDEPATH *= $$PWD $$DEBUGGERHOME
SOURCES += \
$$DEBUGGERHOME/trkutils.cpp \
$$PWD/trkdevice.cpp \
$$PWD/launcher.cpp \
HEADERS += \
$$DEBUGGERHOME/trkutils.h \
$$DEBUGGERHOME/trkfunctor.h \
$$PWD/trkdevice.h \
$$PWD/launcher.h

View File

@@ -1,12 +1,17 @@
TEMPLATE = app
DEBUGGERHOME = ../../../src/plugins/debugger/symbian
QT = core network
win32:CONFIG+=console
INCLUDEPATH *= $$DEBUGGERHOME
HEADERS += \
trkutils.h
$$DEBUGGERHOME/trkutils.h
SOURCES += \
trkutils.cpp \
trkserver.cpp
$$DEBUGGERHOME/trkutils.cpp \
$$PWD/trkserver.cpp