forked from qt-creator/qt-creator
Debugger: Pass command line parameters with LLDB
Change-Id: Id25155688e0e9bbe0d45cde20563929b7370695d Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <texteditor/itexteditor.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
@@ -198,10 +199,19 @@ void LldbEngine::startLldb()
|
||||
void LldbEngine::setupInferior()
|
||||
{
|
||||
const DebuggerStartParameters &sp = startParameters();
|
||||
|
||||
QString executable;
|
||||
QStringList args;
|
||||
Utils::QtcProcess::prepareCommand(QFileInfo(sp.executable).absoluteFilePath(),
|
||||
sp.processArgs, &executable, &args);
|
||||
|
||||
Command cmd("setupInferior");
|
||||
cmd.arg("executable", QFileInfo(sp.executable).absoluteFilePath());
|
||||
cmd.arg("executable", executable);
|
||||
cmd.arg("startMode", sp.startMode); // directly relying on this is brittle wrt. insertions, so check it here
|
||||
cmd.arg("processArgs", sp.processArgs);
|
||||
cmd.beginList("processArgs");
|
||||
foreach (const QString &arg, args)
|
||||
cmd.arg(arg.toUtf8().toHex());
|
||||
cmd.endList();
|
||||
|
||||
// it is better not to check the start mode on the python sid (as we would have to duplicate the
|
||||
// enum values), and thus we assume that if the sp.attachPID is valid we really have to attach
|
||||
@@ -1289,6 +1299,14 @@ const LldbEngine::Command &LldbEngine::Command::arg(const char *name, const char
|
||||
return *this;
|
||||
}
|
||||
|
||||
const LldbEngine::Command &LldbEngine::Command::arg(const char *value) const
|
||||
{
|
||||
args.append("\"");
|
||||
args.append(value);
|
||||
args.append("\",");
|
||||
return *this;
|
||||
}
|
||||
|
||||
const LldbEngine::Command &LldbEngine::Command::beginList(const char *name) const
|
||||
{
|
||||
if (name) {
|
||||
|
||||
Reference in New Issue
Block a user