forked from qt-creator/qt-creator
DAP: Fix launch of an application without run parameters
Now dap gdb debugger takes into account "Command line arguments:". Change-Id: I5e7630a56a0851e7a0b8356129eb250bb29d5893 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -58,10 +58,13 @@ void DapClient::sendInitialize()
|
|||||||
postRequest("initialize", QJsonObject{{"clientID", "QtCreator"}, {"clientName", "QtCreator"}});
|
postRequest("initialize", QJsonObject{{"clientID", "QtCreator"}, {"clientName", "QtCreator"}});
|
||||||
}
|
}
|
||||||
|
|
||||||
void DapClient::sendLaunch(const Utils::FilePath &executable)
|
void DapClient::sendLaunch(const Utils::CommandLine &command)
|
||||||
{
|
{
|
||||||
postRequest("launch",
|
postRequest("launch",
|
||||||
QJsonObject{{"noDebug", false}, {"program", executable.path()}, {"__restart", ""}});
|
QJsonObject{{"noDebug", false},
|
||||||
|
{"program", command.executable().path()},
|
||||||
|
{"args", command.arguments()},
|
||||||
|
{"__restart", ""}});
|
||||||
}
|
}
|
||||||
|
|
||||||
void DapClient::sendAttach()
|
void DapClient::sendAttach()
|
||||||
|
@@ -80,7 +80,7 @@ public:
|
|||||||
|
|
||||||
virtual void sendInitialize();
|
virtual void sendInitialize();
|
||||||
|
|
||||||
void sendLaunch(const Utils::FilePath &executable);
|
void sendLaunch(const Utils::CommandLine &command);
|
||||||
void sendAttach();
|
void sendAttach();
|
||||||
void sendConfigurationDone();
|
void sendConfigurationDone();
|
||||||
|
|
||||||
|
@@ -195,7 +195,7 @@ void DapEngine::handleDapInitialize()
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(state() == EngineRunRequested, qCDebug(logCategory()) << state());
|
QTC_ASSERT(state() == EngineRunRequested, qCDebug(logCategory()) << state());
|
||||||
|
|
||||||
m_dapClient->sendLaunch(runParameters().inferior.command.executable());
|
m_dapClient->sendLaunch(runParameters().inferior.command);
|
||||||
|
|
||||||
qCDebug(logCategory()) << "handleDapLaunch";
|
qCDebug(logCategory()) << "handleDapLaunch";
|
||||||
}
|
}
|
||||||
|
@@ -55,6 +55,8 @@ public:
|
|||||||
void start() override
|
void start() override
|
||||||
{
|
{
|
||||||
m_proc.setProcessMode(ProcessMode::Writer);
|
m_proc.setProcessMode(ProcessMode::Writer);
|
||||||
|
if (m_runParameters.debugger.workingDirectory.isDir())
|
||||||
|
m_proc.setWorkingDirectory(m_runParameters.debugger.workingDirectory);
|
||||||
m_proc.setEnvironment(m_runParameters.debugger.environment);
|
m_proc.setEnvironment(m_runParameters.debugger.environment);
|
||||||
m_proc.setCommand(m_cmd);
|
m_proc.setCommand(m_cmd);
|
||||||
m_proc.start();
|
m_proc.start();
|
||||||
|
Reference in New Issue
Block a user