Commit 1b77161e authored by hjk's avatar hjk

debugger: clean up verbosity settings in trk adapter

parent 7215c212
......@@ -151,6 +151,13 @@ DebuggerSettings *DebuggerSettings::instance()
item->setDefaultValue(false);
instance->insertItem(LogTimeStamps, item);
item = new SavedAction(instance);
item->setText(tr("Verbose Log"));
item->setSettingsKey(debugModeGroup, QLatin1String("VerboseLog"));
item->setCheckable(true);
item->setDefaultValue(false);
instance->insertItem(VerboseLog, item);
item = new SavedAction(instance);
item->setText(tr("Operate by instruction"));
item->setCheckable(true);
......
......@@ -77,6 +77,7 @@ enum DebuggerActionCode
AutoQuit,
LockView,
LogTimeStamps,
VerboseLog,
OperateByInstruction,
AutoDerefPointers,
......
......@@ -172,6 +172,7 @@ public:
theDebuggerAction(ExecuteCommand)->setData(textCursor().block().text());
menu->addAction(theDebuggerAction(ExecuteCommand));
menu->addAction(theDebuggerAction(LogTimeStamps));
menu->addAction(theDebuggerAction(VerboseLog));
menu->addSeparator();
menu->addAction(theDebuggerAction(SettingsDialog));
menu->exec(ev->globalPos());
......
......@@ -367,6 +367,7 @@ QWidget *CommonOptionsPage::createPage(QWidget *parent)
m_group.insert(theDebuggerAction(ShowStdNamespace), 0);
m_group.insert(theDebuggerAction(ShowQtNamespace), 0);
m_group.insert(theDebuggerAction(LogTimeStamps), 0);
m_group.insert(theDebuggerAction(VerboseLog), 0);
m_group.insert(theDebuggerAction(UsePreciseBreakpoints), 0);
#ifdef USE_REVERSE_DEBUGGING
......
......@@ -33,6 +33,7 @@
#include "s60debuggerbluetoothstarter.h"
#include "bluetoothlistener_gui.h"
#include "debuggeractions.h"
#include "debuggerstringutils.h"
#ifndef STANDALONE_RUNNER
#include "gdbengine.h"
......@@ -212,14 +213,6 @@ TrkGdbAdapter::TrkGdbAdapter(GdbEngine *engine, const TrkOptionsPtr &options) :
m_bufferedMemoryRead = false;
m_bufferedMemoryRead = true;
const QByteArray trkVerbose = qgetenv("QTC_TRK_VERBOSE");
if (!trkVerbose.isEmpty()) {
bool ok;
m_verbose = trkVerbose.toInt(&ok);
if (!ok)
m_verbose = 1;
}
m_gdbServer = 0;
m_gdbConnection = 0;
m_snapshot.reset();
......@@ -235,11 +228,13 @@ TrkGdbAdapter::TrkGdbAdapter(GdbEngine *engine, const TrkOptionsPtr &options) :
connect(m_trkDevice.data(), SIGNAL(error(QString)),
this, SLOT(handleTrkError(QString)));
m_trkDevice->setVerbose(m_verbose);
setVerbose(theDebuggerBoolSetting(VerboseLog));
m_trkDevice->setSerialFrame(effectiveTrkDeviceType() != TrkOptions::BlueTooth);
connect(m_trkDevice.data(), SIGNAL(logMessage(QString)),
this, SLOT(trkLogMessage(QString)));
connect(theDebuggerAction(VerboseLog), SIGNAL(valueChanged(QVariant)),
this, SLOT(setVerbose(QVariant)));
}
TrkGdbAdapter::~TrkGdbAdapter()
......@@ -248,6 +243,17 @@ TrkGdbAdapter::~TrkGdbAdapter()
logMessage("Shutting down.\n");
}
void TrkGdbAdapter::setVerbose(const QVariant &value)
{
setVerbose(value.toInt());
}
void TrkGdbAdapter::setVerbose(int verbose)
{
m_verbose = verbose;
m_trkDevice->setVerbose(m_verbose);
}
QString TrkGdbAdapter::effectiveTrkDevice() const
{
if (!m_overrideTrkDevice.isEmpty())
......
......@@ -140,7 +140,8 @@ public:
QString gdbServerName() const { return m_gdbServerName; }
QString gdbServerIP() const;
uint gdbServerPort() const;
void setVerbose(int verbose) { m_verbose = verbose; }
Q_SLOT void setVerbose(const QVariant &value);
void setVerbose(int verbose);
void setBufferedMemoryRead(bool b) { m_bufferedMemoryRead = b; }
trk::Session &session() { return m_session; }
......
......@@ -1031,7 +1031,7 @@ void TrkDevice::setVerbose(int b)
void TrkDevice::slotMessageReceived(const trk::TrkResult &result, const QByteArray &rawData)
{
d->writerThread->slotHandleResult(result);
if (d->verbose)
if (d->verbose > 1)
qDebug() << "Received: " << result.toString();
emit messageReceived(result);
if (!rawData.isEmpty())
......
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