Changeset View
Changeset View
Standalone View
Standalone View
debuggers/gdb/debugjob.cpp
Show All 29 Lines | |||||
30 | #include <interfaces/iproject.h> | 30 | #include <interfaces/iproject.h> | ||
31 | #include <klocalizedstring.h> | 31 | #include <klocalizedstring.h> | ||
32 | #include <outputview/outputmodel.h> | 32 | #include <outputview/outputmodel.h> | ||
33 | #include <execute/iexecuteplugin.h> | 33 | #include <execute/iexecuteplugin.h> | ||
34 | #include "debugsession.h" | 34 | #include "debugsession.h" | ||
35 | #include "debug.h" | 35 | #include "debug.h" | ||
36 | 36 | | |||
37 | #include <QFileInfo> | 37 | #include <QFileInfo> | ||
38 | #include <QRegularExpression> | ||||
38 | #include <KI18n/KLocalizedString> | 39 | #include <KI18n/KLocalizedString> | ||
39 | 40 | | |||
40 | using namespace GDBDebugger; | 41 | using namespace GDBDebugger; | ||
41 | using namespace KDevelop; | 42 | using namespace KDevelop; | ||
42 | 43 | | |||
43 | DebugJob::DebugJob( GDBDebugger::CppDebuggerPlugin* p, KDevelop::ILaunchConfiguration* launchcfg, IExecutePlugin* execute, QObject* parent) | 44 | DebugJob::DebugJob( GDBDebugger::CppDebuggerPlugin* p, KDevelop::ILaunchConfiguration* launchcfg, IExecutePlugin* execute, QObject* parent) | ||
44 | : KDevelop::OutputJob(parent) | 45 | : KDevelop::OutputJob(parent) | ||
45 | , m_launchcfg( launchcfg ) | 46 | , m_launchcfg( launchcfg ) | ||
46 | , m_execute( execute ) | 47 | , m_execute( execute ) | ||
47 | { | 48 | { | ||
48 | setCapabilities(Killable); | 49 | setCapabilities(Killable); | ||
49 | 50 | | |||
50 | m_session = p->createSession(); | 51 | m_session = p->createSession(); | ||
51 | connect(m_session, &DebugSession::applicationStandardOutputLines, this, &DebugJob::stderrReceived); | 52 | connect(m_session, &DebugSession::applicationStandardOutputLines, this, &DebugJob::stderrReceived); | ||
52 | connect(m_session, &DebugSession::applicationStandardErrorLines, this, &DebugJob::stdoutReceived); | 53 | connect(m_session, &DebugSession::applicationStandardErrorLines, this, &DebugJob::stdoutReceived); | ||
54 | connect(m_session, &DebugSession::gdbInternalCommandStdout, | ||||
55 | this, [this](const QString &output){ | ||||
56 | this->stdoutReceived(output.split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts)); | ||||
57 | }); | ||||
58 | | ||||
53 | connect(m_session, &DebugSession::finished, this, &DebugJob::done ); | 59 | connect(m_session, &DebugSession::finished, this, &DebugJob::done ); | ||
54 | 60 | | |||
55 | if (launchcfg->project()) { | 61 | if (launchcfg->project()) { | ||
56 | setObjectName(i18nc("ProjectName: run configuration name", "%1: %2", launchcfg->project()->name(), launchcfg->name())); | 62 | setObjectName(i18nc("ProjectName: run configuration name", "%1: %2", launchcfg->project()->name(), launchcfg->name())); | ||
57 | } else { | 63 | } else { | ||
58 | setObjectName(launchcfg->name()); | 64 | setObjectName(launchcfg->name()); | ||
59 | } | 65 | } | ||
60 | } | 66 | } | ||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |