forked from qt-creator/qt-creator
Support multiple instances listening for debug output...
... only not simultaneously Task-number: QTCREATORBUG-3443 Change-Id: Ie88ee305a1ad134d81a19cece42f7fd81fc08f16 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
349f415067
commit
f99e2570fb
@@ -33,6 +33,7 @@
|
|||||||
#include "projectexplorersettings.h"
|
#include "projectexplorersettings.h"
|
||||||
#include "runconfiguration.h"
|
#include "runconfiguration.h"
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
|
#include "windebuginterface.h"
|
||||||
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
@@ -203,6 +204,11 @@ AppOutputPane::AppOutputPane() :
|
|||||||
this, SLOT(aboutToUnloadSession()));
|
this, SLOT(aboutToUnloadSession()));
|
||||||
connect(ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
|
connect(ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
|
||||||
this, SLOT(updateFromSettings()));
|
this, SLOT(updateFromSettings()));
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
connect(this, &AppOutputPane::allRunControlsFinished,
|
||||||
|
WinDebugInterface::instance(), &WinDebugInterface::stop);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
AppOutputPane::~AppOutputPane()
|
AppOutputPane::~AppOutputPane()
|
||||||
|
@@ -56,20 +56,25 @@ WinDebugInterface *WinDebugInterface::instance()
|
|||||||
return m_instance;
|
return m_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WinDebugInterface::stop()
|
||||||
|
{
|
||||||
|
if (!m_waitHandles[TerminateEventHandle])
|
||||||
|
return false;
|
||||||
|
SetEvent(m_waitHandles[TerminateEventHandle]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
WinDebugInterface::WinDebugInterface(QObject *parent) :
|
WinDebugInterface::WinDebugInterface(QObject *parent) :
|
||||||
QThread(parent)
|
QThread(parent)
|
||||||
{
|
{
|
||||||
m_instance = this;
|
m_instance = this;
|
||||||
setObjectName(QLatin1String("WinDebugInterfaceThread"));
|
setObjectName(QLatin1String("WinDebugInterfaceThread"));
|
||||||
start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WinDebugInterface::~WinDebugInterface()
|
WinDebugInterface::~WinDebugInterface()
|
||||||
{
|
{
|
||||||
if (m_waitHandles[TerminateEventHandle]) {
|
if (stop())
|
||||||
SetEvent(m_waitHandles[TerminateEventHandle]);
|
|
||||||
wait(500);
|
wait(500);
|
||||||
}
|
|
||||||
m_instance = 0;
|
m_instance = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,6 +46,8 @@ public:
|
|||||||
|
|
||||||
static WinDebugInterface *instance();
|
static WinDebugInterface *instance();
|
||||||
|
|
||||||
|
bool stop();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void debugOutput(qint64 pid, const QString &message);
|
void debugOutput(qint64 pid, const QString &message);
|
||||||
void cannotRetrieveDebugOutput();
|
void cannotRetrieveDebugOutput();
|
||||||
|
Reference in New Issue
Block a user