2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-06-16 17:03:43 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-06-16 17:03:43 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-06-16 17:03:43 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2011-06-16 17:03:43 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2011-06-16 17:03:43 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2012-07-25 17:41:01 +02:00
|
|
|
|
2011-06-16 17:03:43 +02:00
|
|
|
#include "remotelinuxdebugsupport.h"
|
|
|
|
|
|
2017-05-04 12:12:27 +02:00
|
|
|
#include "remotelinuxcustomrunconfiguration.h"
|
2011-08-02 12:20:16 +02:00
|
|
|
#include "remotelinuxrunconfiguration.h"
|
2011-06-16 17:03:43 +02:00
|
|
|
|
|
|
|
|
using namespace Debugger;
|
|
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
|
|
|
|
|
namespace RemoteLinux {
|
2011-08-02 12:20:16 +02:00
|
|
|
|
2017-05-09 10:25:11 +02:00
|
|
|
LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(RunControl *runControl)
|
2017-05-04 12:12:27 +02:00
|
|
|
: DebuggerRunTool(runControl)
|
2011-08-02 12:20:16 +02:00
|
|
|
{
|
2017-06-23 13:31:31 +02:00
|
|
|
setDisplayName("LinuxDeviceDebugSupport");
|
2017-05-09 10:25:11 +02:00
|
|
|
|
2017-07-07 09:46:22 +02:00
|
|
|
m_portsGatherer = new GdbServerPortsGatherer(runControl);
|
|
|
|
|
m_portsGatherer->setUseGdbServer(isCppDebugging());
|
|
|
|
|
m_portsGatherer->setUseQmlServer(isQmlDebugging());
|
2017-05-09 10:25:11 +02:00
|
|
|
|
2017-07-07 09:46:22 +02:00
|
|
|
auto gdbServer = new GdbServerRunner(runControl, m_portsGatherer);
|
2017-08-08 14:09:50 +02:00
|
|
|
gdbServer->addStartDependency(m_portsGatherer);
|
2017-05-09 10:25:11 +02:00
|
|
|
|
2017-08-08 14:09:50 +02:00
|
|
|
addStartDependency(gdbServer);
|
2017-05-09 10:25:11 +02:00
|
|
|
|
2017-08-24 15:46:23 +02:00
|
|
|
setStartMode(AttachToRemoteServer);
|
|
|
|
|
setCloseMode(KillAndExitMonitorAtClose);
|
|
|
|
|
setUseExtendedRemote(true);
|
|
|
|
|
|
2017-06-23 13:31:31 +02:00
|
|
|
RunConfiguration *runConfig = runControl->runConfiguration();
|
|
|
|
|
if (auto rlrc = qobject_cast<RemoteLinuxRunConfiguration *>(runConfig))
|
2017-08-24 15:46:23 +02:00
|
|
|
setSymbolFile(rlrc->localExecutableFilePath());
|
2017-06-23 13:31:31 +02:00
|
|
|
else if (auto rlrc = qobject_cast<Internal::RemoteLinuxCustomRunConfiguration *>(runConfig))
|
2017-08-24 15:46:23 +02:00
|
|
|
setSymbolFile(rlrc->localExecutableFilePath());
|
2017-05-09 10:25:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LinuxDeviceDebugSupport::start()
|
|
|
|
|
{
|
2017-08-24 15:46:23 +02:00
|
|
|
setGdbServerChannel(m_portsGatherer->gdbServerChannel());
|
|
|
|
|
setQmlServer(m_portsGatherer->qmlServer());
|
|
|
|
|
addQmlServerInferiorCommandLineArgumentIfNeeded();
|
2011-06-16 17:03:43 +02:00
|
|
|
|
2017-05-09 10:25:11 +02:00
|
|
|
DebuggerRunTool::start();
|
2011-06-16 17:03:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace RemoteLinux
|