Commit 4e21b188 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

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

parents e561e4a5 29c073b2
......@@ -54,6 +54,11 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &categoryId,
: QDialog(parent), m_applied(false)
{
setupUi(this);
#ifdef Q_OS_MAC
setWindowTitle(tr("Preferences"));
#else
setWindowTitle(tr("Options"));
#endif
QString initialCategory = categoryId;
QString initialPage = pageId;
if (initialCategory.isEmpty() && initialPage.isEmpty()) {
......
......@@ -81,7 +81,8 @@ MemoryViewAgent::MemoryViewAgent(DebuggerManager *manager, const QString &addr)
MemoryViewAgent::~MemoryViewAgent()
{
m_editor->deleteLater();
if (m_editor)
m_editor->deleteLater();
}
void MemoryViewAgent::init(quint64 addr)
......@@ -101,13 +102,15 @@ void MemoryViewAgent::init(quint64 addr)
void MemoryViewAgent::fetchLazyData(quint64 block, bool sync)
{
Q_UNUSED(sync); // FIXME: needed support for incremental searching
m_engine->fetchMemory(this, BinBlockSize * block, BinBlockSize);
if (m_engine)
m_engine->fetchMemory(this, BinBlockSize * block, BinBlockSize);
}
void MemoryViewAgent::addLazyData(quint64 addr, const QByteArray &ba)
{
QMetaObject::invokeMethod(m_editor->widget(), "addLazyData",
Q_ARG(quint64, addr / BinBlockSize), Q_ARG(QByteArray, ba));
if (m_editor && m_editor->widget())
QMetaObject::invokeMethod(m_editor->widget(), "addLazyData",
Q_ARG(quint64, addr / BinBlockSize), Q_ARG(QByteArray, ba));
}
......@@ -206,6 +209,9 @@ void DisassemblerViewAgent::setContents(const QString &contents)
using namespace Core;
using namespace TextEditor;
if (!d->editor)
return;
QPlainTextEdit *plainTextEdit = 0;
EditorManager *editorManager = EditorManager::instance();
if (!d->editor) {
......
include(../../shared/trk/trk.pri)
include(../../../shared/trk/trk.pri)
HEADERS += \
$$PWD/abstractgdbadapter.h \
......
......@@ -2684,7 +2684,7 @@ void GdbEngine::reloadRegisters()
if (m_gdbAdapter->isAdapter()) {
// FIXME: remove that special case. This is only to prevent
// gdb from asking for the values of the fixed point registers
postCommand(_("-data-list-register-values x 1 2 3 4 5 6 7 8 9 "
postCommand(_("-data-list-register-values x 0 1 2 3 4 5 6 7 8 9 "
"10 11 12 13 14 15 25"),
Discardable, CB(handleRegisterListValues));
} else {
......
This diff is collapsed.
TEMPLATE = app
DEBUGGERHOME = ../../../src/plugins/debugger/gdb
INCLUDEPATH *= $$DEBUGGERHOME
UTILSDIR = ../../../src/libs
QT = core network
win32:CONFIG+=console
HEADERS += \
$$DEBUGGERHOME/trkutils.h \
$$DEBUGGERHOME/callback.h \
$$PWD/trkdevice.h \
SOURCES += \
$$DEBUGGERHOME/trkutils.cpp \
$$PWD/trkdevice.cpp \
$$PWD/adapter.cpp \
TEMPLATE = app
TRK_DIR=../../../src/shared/trk
include($$TRK_DIR/trk.pri)
DEBUGGERHOME = ../../../src/plugins/debugger/gdb
INCLUDEPATH *= $$TRK_DIR
INCLUDEPATH *= $$DEBUGGERHOME
DEFINES += STANDALONE_RUNNER
......@@ -11,13 +14,9 @@ QT += network
win32:CONFIG+=console
HEADERS += \
$$DEBUGGERHOME/../gdb/abstractgdbadapter.h \
$$DEBUGGERHOME/trkutils.h \
$$DEBUGGERHOME/trkclient.h \
$$DEBUGGERHOME/abstractgdbadapter.h \
$$DEBUGGERHOME/trkgdbadapter.h \
SOURCES += \
$$DEBUGGERHOME/trkutils.cpp \
$$DEBUGGERHOME/trkclient.cpp \
$$DEBUGGERHOME/trkgdbadapter.cpp \
$$PWD/runner.cpp \
TEMPLATE = subdirs
SUBDIRS = trkserver adapter swapendian runner.pro trklauncher.pro
SUBDIRS = trkserver swapendian runner.pro
trkserver.file = trkserver.pro
adapter.file = adapter.pro
swapendian.file = swapendian.pro
DEFINES += DEBUG_TRK=0
DEBUGGERHOME = ../../../src/plugins/debugger/gdb
TRK_DIR = ../../../src/plugins/debugger/gdb
INCLUDEPATH *= $$PWD $$DEBUGGERHOME
INCLUDEPATH *= $$PWD $$TRK_DIR
SOURCES += \
$$DEBUGGERHOME/trkutils.cpp \
$$TRK_DIR/trkutils.cpp \
$$PWD/trkdevice.cpp \
$$PWD/launcher.cpp \
HEADERS += \
$$DEBUGGERHOME/trkutils.h \
$$DEBUGGERHOME/callback.h \
$$TRK_DIR/trkutils.h \
$$TRK_DIR/callback.h \
$$PWD/trkdevice.h \
$$PWD/launcher.h
......@@ -27,7 +27,7 @@
**
**************************************************************************/
#include "trkdevice.h"
#include "trkolddevice.h"
#include "trkutils.h"
#include <QtCore/QString>
......@@ -55,7 +55,7 @@ enum { TimerInterval = 100 };
#ifdef Q_OS_WIN
// Format windows error from GetLastError() value: TODO: Use the one provided by the utisl lib.
QString winErrorMessage(unsigned long error)
static QString winErrorMessage(unsigned long error)
{
QString rc = QString::fromLatin1("#%1: ").arg(error);
ushort *lpMsgBuf;
......@@ -73,7 +73,7 @@ QString winErrorMessage(unsigned long error)
}
// Non-blocking replacement for win-api ReadFile function
BOOL WINAPI TryReadFile(HANDLE hFile,
static BOOL WINAPI TryReadFile(HANDLE hFile,
LPVOID lpBuffer,
DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead,
......@@ -96,7 +96,7 @@ BOOL WINAPI TryReadFile(HANDLE hFile,
}
#endif
namespace trk {
namespace trkold {
struct TrkDevicePrivate {
TrkDevicePrivate();
......@@ -291,7 +291,7 @@ void TrkDevice::tryTrkRead()
logMessage("Read" + d->trkReadBuffer.toHex());
if (!totalCharsRead)
return;
const ushort len = isValidTrkResult(d->trkReadBuffer, d->serialFrame);
const ushort len = trk::isValidTrkResult(d->trkReadBuffer, d->serialFrame);
if (!len) {
const QString msg = QString::fromLatin1("Partial message: %1").arg(stringFromArray(d->trkReadBuffer));
emitError(msg);
......@@ -305,7 +305,7 @@ void TrkDevice::tryTrkRead()
if (verbose())
logMessage("READ " + data.toHex());
d->trkReadBuffer.append(data);
const ushort len = isValidTrkResult(d->trkReadBuffer, d->serialFrame);
const ushort len = trk::isValidTrkResult(d->trkReadBuffer, d->serialFrame);
if (!len) {
if (d->trkReadBuffer.size() > 10) {
const QString msg = QString::fromLatin1("Unable to extract message from '%1' '%2'").
......@@ -315,7 +315,7 @@ void TrkDevice::tryTrkRead()
return;
}
#endif // Q_OS_WIN
TrkResult r;
trk::TrkResult r;
QByteArray rawData;
while (extractResult(&d->trkReadBuffer, d->serialFrame, &r, &rawData)) {
if (verbose())
......@@ -340,7 +340,7 @@ void TrkDevice::emitError(const QString &s)
/* A message to be send to TRK, triggering a callback on receipt
* of the answer. */
typedef Debugger::Callback<const TrkResult &> TrkCallback;
typedef trk::Callback<const trk::TrkResult &> TrkCallback;
struct TrkMessage {
explicit TrkMessage(unsigned char code = 0u,
unsigned char token = 0u,
......@@ -380,7 +380,7 @@ public:
void queueTrkInitialPing();
// Call this from the device read notification with the results.
void slotHandleResult(const TrkResult &result);
void slotHandleResult(const trk::TrkResult &result);
// This can be called periodically in a timer to retrieve
// the pending messages to be sent.
......@@ -439,7 +439,7 @@ bool TrkWriteQueue::pendingMessage(SharedPointerTrkMessage *message)
if (trkWriteQueue.front()->code == TRK_WRITE_QUEUE_NOOP_CODE) {
const SharedPointerTrkMessage noopMessage = trkWriteQueue.dequeue();
if (noopMessage->callback) {
TrkResult result;
trk::TrkResult result;
result.code = noopMessage->code;
result.token = noopMessage->token;
result.data = noopMessage->data;
......@@ -458,17 +458,17 @@ bool TrkWriteQueue::pendingMessage(SharedPointerTrkMessage *message)
void TrkWriteQueue::notifyWriteResult(bool ok)
{
// On success, dequeue message and await result
if (ok) {
if (ok) {
const SharedPointerTrkMessage firstMsg = trkWriteQueue.dequeue();
writtenTrkMessages.insert(firstMsg->token, firstMsg);
trkWriteBusy = true;
}
}
void TrkWriteQueue::slotHandleResult(const TrkResult &result)
void TrkWriteQueue::slotHandleResult(const trk::TrkResult &result)
{
trkWriteBusy = false;
if (result.code != TrkNotifyAck && result.code != TrkNotifyNak)
if (result.code != trk::TrkNotifyAck && result.code != trk::TrkNotifyNak)
return;
// Find which request the message belongs to and invoke callback
// if ACK or on NAK if desired.
......@@ -476,10 +476,10 @@ void TrkWriteQueue::slotHandleResult(const TrkResult &result)
if (it == writtenTrkMessages.end())
return;
const bool invokeCB = it.value()->callback
&& (result.code == TrkNotifyAck || it.value()->invokeOnNAK);
&& (result.code == trk::TrkNotifyAck || it.value()->invokeOnNAK);
if (invokeCB) {
TrkResult result1 = result;
trk::TrkResult result1 = result;
result1.cookie = it.value()->cookie;
it.value()->callback(result1);
}
......@@ -545,9 +545,9 @@ void TrkWriteQueueDevice::tryTrkWrite()
bool TrkWriteQueueDevice::trkWriteRawMessage(const TrkMessage &msg)
{
const QByteArray ba = frameMessage(msg.code, msg.token, msg.data, serialFrame());
const QByteArray ba = trk::frameMessage(msg.code, msg.token, msg.data, serialFrame());
if (verbose())
logMessage("WRITE: " + stringFromArray(ba));
logMessage("WRITE: " + trk::stringFromArray(ba));
QString errorMessage;
const bool rc = write(ba, &errorMessage);
if (!rc)
......@@ -561,7 +561,7 @@ void TrkWriteQueueDevice::timerEvent(QTimerEvent *ev)
TrkDevice::timerEvent(ev);
}
void TrkWriteQueueDevice::slotHandleResult(const TrkResult &result)
void TrkWriteQueueDevice::slotHandleResult(const trk::TrkResult &result)
{
qd->slotHandleResult(result);
}
......@@ -657,9 +657,9 @@ void TrkWriteQueueIODevice::tryTrkWrite()
bool TrkWriteQueueIODevice::trkWriteRawMessage(const TrkMessage &msg)
{
const QByteArray ba = frameMessage(msg.code, msg.token, msg.data, serialFrame());
const QByteArray ba = trk::frameMessage(msg.code, msg.token, msg.data, serialFrame());
if (verbose())
logMessage("WRITE: " + stringFromArray(ba));
logMessage("WRITE: " + trk::stringFromArray(ba));
const bool ok = d->device->write(ba) != -1;
if (!ok) {
const QString msg = QString::fromLatin1("Unable to write %1 bytes: %2:").arg(ba.size()).arg(d->device->errorString());
......@@ -677,9 +677,9 @@ void TrkWriteQueueIODevice::tryTrkRead()
//if (verbose())
logMessage("READ " + newData.toHex());
d->readBuffer.append(newData);
TrkResult r;
trk::TrkResult r;
QByteArray rawData;
while (extractResult(&(d->readBuffer), d->serialFrame, &r, &rawData)) {
while (trk::extractResult(&(d->readBuffer), d->serialFrame, &r, &rawData)) {
d->queue.slotHandleResult(r);
emit messageReceived(r);
if (!rawData.isEmpty())
......@@ -687,4 +687,4 @@ void TrkWriteQueueIODevice::tryTrkRead()
}
}
} // namespace tr
} // namespace trkold
......@@ -27,8 +27,8 @@
**
**************************************************************************/
#ifndef TRKDEVICE_H
#define TRKDEVICE_H
#ifndef TRKOLDDEVICE_H
#define TRKOLDDEVICE_H
#include "callback.h"
......@@ -41,9 +41,13 @@ QT_BEGIN_NAMESPACE
class QIODevice;
QT_END_NAMESPACE
namespace trk {
struct TrkResult;
}
namespace trkold {
struct TrkResult;
struct TrkMessage;
struct TrkDevicePrivate;
class TrkWriteQueue;
......@@ -85,7 +89,7 @@ signals:
void rawDataReceived(const QByteArray &data);
void error(const QString &msg);
void logMessage(const QString &msg);
protected:
void emitError(const QString &msg);
virtual void timerEvent(QTimerEvent *ev);
......@@ -112,7 +116,7 @@ public:
virtual ~TrkWriteQueueDevice();
// Construct as 'TrkWriteQueueDevice::TrkCallback(instance, &Class::method);'
typedef Debugger::Callback<const TrkResult &> TrkCallback;
typedef trk::Callback<const trk::TrkResult &> TrkCallback;
// Enqueue a message with a notification callback.
void sendTrkMessage(unsigned char code,
......@@ -155,7 +159,7 @@ class TrkWriteQueueIODevice : public QObject
Q_PROPERTY(bool serialFrame READ serialFrame WRITE setSerialFrame)
Q_PROPERTY(bool verbose READ verbose WRITE setVerbose)
public:
typedef Debugger::Callback<const TrkResult &> TrkCallback;
typedef trk::Callback<const trk::TrkResult &> TrkCallback;
explicit TrkWriteQueueIODevice(const QSharedPointer<QIODevice> &device,
QObject *parent = 0);
......@@ -186,13 +190,13 @@ protected:
virtual void timerEvent(QTimerEvent *ev);
private:
void tryTrkRead();
void tryTrkRead();
void tryTrkWrite();
bool trkWriteRawMessage(const TrkMessage &msg);
TrkWriteQueueIODevicePrivate *d;
};
} // namespace trk
} // namespace trkold
#endif // TRKDEVICE_H
#endif // TRKOLDDEVICE_H
TEMPLATE = app
DEBUGGERHOME = ../../../src/plugins/debugger/gdb
include(../../../src/shared/trk/trk.pri)
QT = core network
win32:CONFIG+=console
INCLUDEPATH *= $$DEBUGGERHOME
HEADERS += \
$$DEBUGGERHOME/trkutils.h
SOURCES += \
$$DEBUGGERHOME/trkutils.cpp \
$$PWD/trkserver.cpp
TEMPLATE = app
QT = core
include($$PWD/trklauncher.pri)
include(../../../src/shared/trk/trk.pri)
win32:CONFIG += console
SOURCES += main_launcher.cpp
SOURCES += main.cpp
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment