forked from qt-creator/qt-creator
DAP: Add CMake debug to the debug panel
This commit introduces the capability to initiate CMake Debug sessions directly from the debug panel in the QtCretor. Change-Id: I00245e0e14aded378e881c4049cdc41dd1fbd00e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -122,8 +122,9 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList &
|
||||
m_process->setWorkingDirectory(buildDirectory);
|
||||
m_process->setEnvironment(parameters.environment);
|
||||
|
||||
m_process->setStdOutLineCallback([](const QString &s) {
|
||||
m_process->setStdOutLineCallback([this](const QString &s) {
|
||||
BuildSystem::appendBuildSystemOutput(stripTrailingNewline(s));
|
||||
emit stdOutReady(s);
|
||||
});
|
||||
|
||||
m_process->setStdErrLineCallback([this](const QString &s) {
|
||||
@@ -139,19 +140,6 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList &
|
||||
commandLine.addArgs({"-S", sourceDirectory.path(), "-B", buildDirectory.path()});
|
||||
commandLine.addArgs(arguments);
|
||||
|
||||
if (qEnvironmentVariableIsSet("QTC_USE_CMAKE_DEBUGGER")) {
|
||||
FilePath file = FilePath::fromString("/tmp/cmake-dap.sock");
|
||||
file.removeFile();
|
||||
commandLine.addArgs({"--debugger", "--debugger-pipe=/tmp/cmake-dap.sock"});
|
||||
connect(m_process.get(), &Process::started, this, [this, cmakeExecutable] {
|
||||
QMetaObject::invokeMethod(debuggerPlugin(),
|
||||
"attachToProcess",
|
||||
Qt::QueuedConnection,
|
||||
Q_ARG(qint64, m_process->processId()),
|
||||
Q_ARG(const Utils::FilePath &, cmakeExecutable));
|
||||
});
|
||||
}
|
||||
|
||||
TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
|
||||
|
||||
BuildSystem::startNewBuildSystemOutput(::CMakeProjectManager::Tr::tr("Running %1 in %2.")
|
||||
|
||||
Reference in New Issue
Block a user