forked from qt-creator/qt-creator
Debugger: Transform DebuggerRunParameters::debugger
Task-number: QTCREATORBUG-29168 Change-Id: I2b2463c08c18c4e7c05168738addb7d80b062b9e Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -295,14 +295,14 @@ void CdbEngine::setupEngine()
|
|||||||
// Determine binary (force MSVC), extension lib name and path to use
|
// Determine binary (force MSVC), extension lib name and path to use
|
||||||
// The extension is passed as relative name with the path variable set
|
// The extension is passed as relative name with the path variable set
|
||||||
//(does not work with absolute path names)
|
//(does not work with absolute path names)
|
||||||
if (sp.debugger.command.isEmpty()) {
|
if (sp.debugger().command.isEmpty()) {
|
||||||
handleSetupFailure(Tr::tr("There is no CDB executable specified."));
|
handleSetupFailure(Tr::tr("There is no CDB executable specified."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cdbIs64Bit = true;
|
bool cdbIs64Bit = true;
|
||||||
bool cdbIsArm = false;
|
bool cdbIsArm = false;
|
||||||
Abis abisOfCdb = Abi::abisOfBinary(sp.debugger.command.executable());
|
Abis abisOfCdb = Abi::abisOfBinary(sp.debugger().command.executable());
|
||||||
if (abisOfCdb.size() == 1) {
|
if (abisOfCdb.size() == 1) {
|
||||||
Abi abi = abisOfCdb.at(0);
|
Abi abi = abisOfCdb.at(0);
|
||||||
cdbIs64Bit = abi.wordWidth() == 64;
|
cdbIs64Bit = abi.wordWidth() == 64;
|
||||||
@@ -327,7 +327,7 @@ void CdbEngine::setupEngine()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Prepare command line.
|
// Prepare command line.
|
||||||
CommandLine debugger{sp.debugger.command};
|
CommandLine debugger{sp.debugger().command};
|
||||||
|
|
||||||
m_extensionFileName = extensionFi.fileName();
|
m_extensionFileName = extensionFi.fileName();
|
||||||
const bool isRemote = sp.startMode() == AttachToRemoteServer;
|
const bool isRemote = sp.startMode() == AttachToRemoteServer;
|
||||||
@@ -421,7 +421,7 @@ void CdbEngine::setupEngine()
|
|||||||
void CdbEngine::processStarted()
|
void CdbEngine::processStarted()
|
||||||
{
|
{
|
||||||
const qint64 pid = m_process.processId();
|
const qint64 pid = m_process.processId();
|
||||||
const FilePath execPath = runParameters().debugger.command.executable();
|
const FilePath execPath = runParameters().debugger().command.executable();
|
||||||
showMessage(QString("%1 running as %2").arg(execPath.toUserOutput()).arg(pid), LogMisc);
|
showMessage(QString("%1 running as %2").arg(execPath.toUserOutput()).arg(pid), LogMisc);
|
||||||
m_hasDebuggee = true;
|
m_hasDebuggee = true;
|
||||||
m_initialSessionIdleHandled = false;
|
m_initialSessionIdleHandled = false;
|
||||||
|
@@ -57,9 +57,9 @@ public:
|
|||||||
void start() override
|
void start() override
|
||||||
{
|
{
|
||||||
m_proc.setProcessMode(ProcessMode::Writer);
|
m_proc.setProcessMode(ProcessMode::Writer);
|
||||||
if (m_runParameters.debugger.workingDirectory.isDir())
|
if (m_runParameters.debugger().workingDirectory.isDir())
|
||||||
m_proc.setWorkingDirectory(m_runParameters.debugger.workingDirectory);
|
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();
|
||||||
}
|
}
|
||||||
@@ -138,7 +138,7 @@ void GdbDapEngine::setupEngine()
|
|||||||
QTC_ASSERT(state() == EngineSetupRequested, qCDebug(logCategory()) << state());
|
QTC_ASSERT(state() == EngineSetupRequested, qCDebug(logCategory()) << state());
|
||||||
|
|
||||||
const DebuggerRunParameters &rp = runParameters();
|
const DebuggerRunParameters &rp = runParameters();
|
||||||
CommandLine cmd{rp.debugger.command.executable(), {"-i", "dap"}};
|
CommandLine cmd{rp.debugger().command.executable(), {"-i", "dap"}};
|
||||||
|
|
||||||
if (runParameters().isLocalAttachEngine())
|
if (runParameters().isLocalAttachEngine())
|
||||||
cmd.addArgs({"-p", QString::number(rp.attachPid().pid())});
|
cmd.addArgs({"-p", QString::number(rp.attachPid().pid())});
|
||||||
|
@@ -61,9 +61,9 @@ public:
|
|||||||
void start() override
|
void start() override
|
||||||
{
|
{
|
||||||
m_proc.setProcessMode(ProcessMode::Writer);
|
m_proc.setProcessMode(ProcessMode::Writer);
|
||||||
if (m_runParameters.debugger.workingDirectory.isDir())
|
if (m_runParameters.debugger().workingDirectory.isDir())
|
||||||
m_proc.setWorkingDirectory(m_runParameters.debugger.workingDirectory);
|
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();
|
||||||
}
|
}
|
||||||
@@ -207,7 +207,7 @@ void LldbDapEngine::setupEngine()
|
|||||||
QTC_ASSERT(state() == EngineSetupRequested, qCDebug(logCategory()) << state());
|
QTC_ASSERT(state() == EngineSetupRequested, qCDebug(logCategory()) << state());
|
||||||
|
|
||||||
const DebuggerRunParameters &rp = runParameters();
|
const DebuggerRunParameters &rp = runParameters();
|
||||||
CommandLine cmd{rp.debugger.command.executable()};
|
CommandLine cmd{rp.debugger().command.executable()};
|
||||||
|
|
||||||
IDataProvider *dataProvider = new ProcessDataProvider(rp, cmd, this);
|
IDataProvider *dataProvider = new ProcessDataProvider(rp, cmd, this);
|
||||||
m_dapClient = new LldbDapClient(dataProvider, this);
|
m_dapClient = new LldbDapClient(dataProvider, this);
|
||||||
|
@@ -80,7 +80,7 @@ public:
|
|||||||
|
|
||||||
void start() override
|
void start() override
|
||||||
{
|
{
|
||||||
Environment env = m_runParameters.debugger.environment;
|
Environment env = m_runParameters.debugger().environment;
|
||||||
const FilePath debugPyDir = packageDir(m_cmd.executable(), "debugpy");
|
const FilePath debugPyDir = packageDir(m_cmd.executable(), "debugpy");
|
||||||
if (QTC_GUARD(debugPyDir.isSameDevice(m_cmd.executable()))) {
|
if (QTC_GUARD(debugPyDir.isSameDevice(m_cmd.executable()))) {
|
||||||
env.appendOrSet("PYTHONPATH", debugPyDir.path());
|
env.appendOrSet("PYTHONPATH", debugPyDir.path());
|
||||||
|
@@ -112,7 +112,7 @@ QDebug operator<<(QDebug str, const DebuggerRunParameters &rp)
|
|||||||
<< " coreFile=" << rp.coreFile()
|
<< " coreFile=" << rp.coreFile()
|
||||||
<< " processArgs=" << rp.inferior().command.arguments()
|
<< " processArgs=" << rp.inferior().command.arguments()
|
||||||
<< " inferior environment=<" << rp.inferior().environment.toStringList().size() << " variables>"
|
<< " inferior environment=<" << rp.inferior().environment.toStringList().size() << " variables>"
|
||||||
<< " debugger environment=<" << rp.debugger.environment.toStringList().size() << " variables>"
|
<< " debugger environment=<" << rp.debugger().environment.toStringList().size() << " variables>"
|
||||||
<< " workingDir=" << rp.inferior().workingDirectory
|
<< " workingDir=" << rp.inferior().workingDirectory
|
||||||
<< " attachPID=" << rp.attachPid().pid()
|
<< " attachPID=" << rp.attachPid().pid()
|
||||||
<< " remoteChannel=" << rp.remoteChannel()
|
<< " remoteChannel=" << rp.remoteChannel()
|
||||||
@@ -138,7 +138,7 @@ DebuggerRunParameters DebuggerRunParameters::fromRunControl(ProjectExplorer::Run
|
|||||||
|
|
||||||
params.setSysRoot(SysRootKitAspect::sysRoot(kit));
|
params.setSysRoot(SysRootKitAspect::sysRoot(kit));
|
||||||
params.macroExpander = runControl->macroExpander();
|
params.macroExpander = runControl->macroExpander();
|
||||||
params.debugger = DebuggerKitAspect::runnable(kit);
|
params.m_debugger = DebuggerKitAspect::runnable(kit);
|
||||||
params.m_cppEngineType = DebuggerKitAspect::engineType(kit);
|
params.m_cppEngineType = DebuggerKitAspect::engineType(kit);
|
||||||
params.m_version = DebuggerKitAspect::version(kit);
|
params.m_version = DebuggerKitAspect::version(kit);
|
||||||
|
|
||||||
@@ -173,13 +173,13 @@ DebuggerRunParameters DebuggerRunParameters::fromRunControl(ProjectExplorer::Run
|
|||||||
|
|
||||||
const QString envBinary = qtcEnvironmentVariable("QTC_DEBUGGER_PATH");
|
const QString envBinary = qtcEnvironmentVariable("QTC_DEBUGGER_PATH");
|
||||||
if (!envBinary.isEmpty())
|
if (!envBinary.isEmpty())
|
||||||
params.debugger.command.setExecutable(FilePath::fromString(envBinary));
|
params.m_debugger.command.setExecutable(FilePath::fromString(envBinary));
|
||||||
|
|
||||||
if (Project *project = runControl->project()) {
|
if (Project *project = runControl->project()) {
|
||||||
params.projectSourceDirectory = project->projectDirectory();
|
params.projectSourceDirectory = project->projectDirectory();
|
||||||
params.projectSourceFiles = project->files(Project::SourceFiles);
|
params.projectSourceFiles = project->files(Project::SourceFiles);
|
||||||
} else {
|
} else {
|
||||||
params.projectSourceDirectory = params.debugger.command.executable().parentDir();
|
params.projectSourceDirectory = params.debugger().command.executable().parentDir();
|
||||||
params.projectSourceFiles.clear();
|
params.projectSourceFiles.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,13 +214,13 @@ Result DebuggerRunParameters::fixupParameters(ProjectExplorer::RunControl *runCo
|
|||||||
|
|
||||||
// Set a Qt Creator-specific environment variable, to able to check for it in debugger
|
// Set a Qt Creator-specific environment variable, to able to check for it in debugger
|
||||||
// scripts.
|
// scripts.
|
||||||
debugger.environment.set("QTC_DEBUGGER_PROCESS", "1");
|
m_debugger.environment.set("QTC_DEBUGGER_PROCESS", "1");
|
||||||
|
|
||||||
// Copy over DYLD_IMAGE_SUFFIX etc
|
// Copy over DYLD_IMAGE_SUFFIX etc
|
||||||
for (const auto &var :
|
for (const auto &var :
|
||||||
QStringList({"DYLD_IMAGE_SUFFIX", "DYLD_LIBRARY_PATH", "DYLD_FRAMEWORK_PATH"}))
|
QStringList({"DYLD_IMAGE_SUFFIX", "DYLD_LIBRARY_PATH", "DYLD_FRAMEWORK_PATH"}))
|
||||||
if (m_inferior.environment.hasKey(var))
|
if (m_inferior.environment.hasKey(var))
|
||||||
debugger.environment.set(var, m_inferior.environment.expandedValueForKey(var));
|
m_debugger.environment.set(var, m_inferior.environment.expandedValueForKey(var));
|
||||||
|
|
||||||
// validate debugger if C++ debugging is enabled
|
// validate debugger if C++ debugging is enabled
|
||||||
if (!validationErrors.isEmpty())
|
if (!validationErrors.isEmpty())
|
||||||
@@ -2905,8 +2905,8 @@ QString DebuggerEngine::formatStartParameters() const
|
|||||||
if (!rp.inferior().workingDirectory.isEmpty())
|
if (!rp.inferior().workingDirectory.isEmpty())
|
||||||
str << "Directory: " << rp.inferior().workingDirectory.toUserOutput() << '\n';
|
str << "Directory: " << rp.inferior().workingDirectory.toUserOutput() << '\n';
|
||||||
}
|
}
|
||||||
if (!rp.debugger.command.isEmpty())
|
if (!rp.debugger().command.isEmpty())
|
||||||
str << "Debugger: " << rp.debugger.command.toUserOutput() << '\n';
|
str << "Debugger: " << rp.debugger().command.toUserOutput() << '\n';
|
||||||
if (!rp.coreFile().isEmpty())
|
if (!rp.coreFile().isEmpty())
|
||||||
str << "Core: " << rp.coreFile().toUserOutput() << '\n';
|
str << "Core: " << rp.coreFile().toUserOutput() << '\n';
|
||||||
if (rp.attachPid().isValid())
|
if (rp.attachPid().isValid())
|
||||||
|
@@ -194,7 +194,8 @@ public:
|
|||||||
|
|
||||||
bool runAsRoot() const { return m_runAsRoot; }
|
bool runAsRoot() const { return m_runAsRoot; }
|
||||||
|
|
||||||
Utils::ProcessRunData debugger;
|
Utils::ProcessRunData debugger() const { return m_debugger; };
|
||||||
|
|
||||||
Utils::FilePath overrideStartScript; // Used in attach to core and remote debugging
|
Utils::FilePath overrideStartScript; // Used in attach to core and remote debugging
|
||||||
QString startMessage; // First status message shown.
|
QString startMessage; // First status message shown.
|
||||||
Utils::FilePath debugInfoLocation; // Gdb "set-debug-file-directory".
|
Utils::FilePath debugInfoLocation; // Gdb "set-debug-file-directory".
|
||||||
@@ -298,6 +299,8 @@ private:
|
|||||||
bool m_multiProcess = false; // Whether to set detach-on-fork off.
|
bool m_multiProcess = false; // Whether to set detach-on-fork off.
|
||||||
bool m_useTerminal = false;
|
bool m_useTerminal = false;
|
||||||
bool m_runAsRoot = false;
|
bool m_runAsRoot = false;
|
||||||
|
|
||||||
|
Utils::ProcessRunData m_debugger;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
@@ -135,7 +135,7 @@ void DebuggerRunTool::addQmlServerInferiorCommandLineArgumentIfNeeded()
|
|||||||
|
|
||||||
void DebuggerRunTool::modifyDebuggerEnvironment(const EnvironmentItems &items)
|
void DebuggerRunTool::modifyDebuggerEnvironment(const EnvironmentItems &items)
|
||||||
{
|
{
|
||||||
m_runParameters.debugger.environment.modify(items);
|
m_runParameters.debugger().environment.modify(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerRunTool::setCrashParameter(const QString &event)
|
void DebuggerRunTool::setCrashParameter(const QString &event)
|
||||||
@@ -302,7 +302,7 @@ void DebuggerRunTool::continueAfterTerminalStart()
|
|||||||
|
|
||||||
if (m_runParameters.cppEngineType() == CdbEngineType
|
if (m_runParameters.cppEngineType() == CdbEngineType
|
||||||
&& Utils::is64BitWindowsBinary(m_runParameters.inferior().command.executable())
|
&& Utils::is64BitWindowsBinary(m_runParameters.inferior().command.executable())
|
||||||
&& !Utils::is64BitWindowsBinary(m_runParameters.debugger.command.executable())) {
|
&& !Utils::is64BitWindowsBinary(m_runParameters.debugger().command.executable())) {
|
||||||
reportFailure(
|
reportFailure(
|
||||||
Tr::tr(
|
Tr::tr(
|
||||||
"%1 is a 64 bit executable which can not be debugged by a 32 bit Debugger.\n"
|
"%1 is a 64 bit executable which can not be debugged by a 32 bit Debugger.\n"
|
||||||
|
@@ -693,7 +693,7 @@ void GdbEngine::interruptInferior()
|
|||||||
notifyInferiorStopFailed();
|
notifyInferiorStopFailed();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
signalOperation->setDebuggerCommand(runParameters().debugger.command.executable());
|
signalOperation->setDebuggerCommand(runParameters().debugger().command.executable());
|
||||||
signalOperation->interruptProcess(inferiorPid());
|
signalOperation->interruptProcess(inferiorPid());
|
||||||
} else {
|
} else {
|
||||||
interruptInferior2();
|
interruptInferior2();
|
||||||
@@ -3831,7 +3831,7 @@ void GdbEngine::setupEngine()
|
|||||||
if (isRemoteEngine())
|
if (isRemoteEngine())
|
||||||
m_gdbProc.setUseCtrlCStub(rp.useCtrlCStub()); // This is only set for QNX
|
m_gdbProc.setUseCtrlCStub(rp.useCtrlCStub()); // This is only set for QNX
|
||||||
|
|
||||||
CommandLine gdbCommand = rp.debugger.command;
|
CommandLine gdbCommand = rp.debugger().command;
|
||||||
if (usesOutputCollector()) {
|
if (usesOutputCollector()) {
|
||||||
if (!m_outputCollector.listen()) {
|
if (!m_outputCollector.listen()) {
|
||||||
handleAdapterStartFailed(Tr::tr("Cannot set up communication with child process: %1")
|
handleAdapterStartFailed(Tr::tr("Cannot set up communication with child process: %1")
|
||||||
@@ -3849,7 +3849,7 @@ void GdbEngine::setupEngine()
|
|||||||
|
|
||||||
m_expectTerminalTrap = usesTerminal();
|
m_expectTerminalTrap = usesTerminal();
|
||||||
|
|
||||||
if (rp.debugger.command.isEmpty()) {
|
if (rp.debugger().command.isEmpty()) {
|
||||||
handleGdbStartFailed();
|
handleGdbStartFailed();
|
||||||
handleAdapterStartFailed(
|
handleAdapterStartFailed(
|
||||||
msgNoGdbBinaryForToolchain(rp.toolChainAbi),
|
msgNoGdbBinaryForToolchain(rp.toolChainAbi),
|
||||||
@@ -3862,7 +3862,7 @@ void GdbEngine::setupEngine()
|
|||||||
gdbCommand.addArg("-n");
|
gdbCommand.addArg("-n");
|
||||||
|
|
||||||
// This is filled in DebuggerKitAspect::runnable
|
// This is filled in DebuggerKitAspect::runnable
|
||||||
Environment gdbEnv = rp.debugger.environment;
|
Environment gdbEnv = rp.debugger().environment;
|
||||||
gdbEnv.setupEnglishOutput();
|
gdbEnv.setupEnglishOutput();
|
||||||
if (rp.runAsRoot())
|
if (rp.runAsRoot())
|
||||||
RunControl::provideAskPassEntry(gdbEnv);
|
RunControl::provideAskPassEntry(gdbEnv);
|
||||||
@@ -3871,8 +3871,8 @@ void GdbEngine::setupEngine()
|
|||||||
showMessage("STARTING " + gdbCommand.toUserOutput());
|
showMessage("STARTING " + gdbCommand.toUserOutput());
|
||||||
|
|
||||||
m_gdbProc.setCommand(gdbCommand);
|
m_gdbProc.setCommand(gdbCommand);
|
||||||
if (rp.debugger.workingDirectory.isDir())
|
if (rp.debugger().workingDirectory.isDir())
|
||||||
m_gdbProc.setWorkingDirectory(rp.debugger.workingDirectory);
|
m_gdbProc.setWorkingDirectory(rp.debugger().workingDirectory);
|
||||||
m_gdbProc.setEnvironment(gdbEnv);
|
m_gdbProc.setEnvironment(gdbEnv);
|
||||||
m_gdbProc.start();
|
m_gdbProc.start();
|
||||||
}
|
}
|
||||||
@@ -3996,7 +3996,7 @@ void GdbEngine::handleGdbStarted()
|
|||||||
// runCommand({"set inferior-tty " + QString::fromUtf8(terminal()->slaveDevice())});
|
// runCommand({"set inferior-tty " + QString::fromUtf8(terminal()->slaveDevice())});
|
||||||
|
|
||||||
const FilePath dumperPath = ICore::resourcePath("debugger");
|
const FilePath dumperPath = ICore::resourcePath("debugger");
|
||||||
if (!rp.debugger.command.executable().isLocal()) {
|
if (!rp.debugger().command.executable().isLocal()) {
|
||||||
// Gdb itself running remotely.
|
// Gdb itself running remotely.
|
||||||
const FilePath loadOrderFile = dumperPath / "loadorder.txt";
|
const FilePath loadOrderFile = dumperPath / "loadorder.txt";
|
||||||
const expected_str<QByteArray> toLoad = loadOrderFile.fileContents();
|
const expected_str<QByteArray> toLoad = loadOrderFile.fileContents();
|
||||||
@@ -4043,7 +4043,7 @@ void GdbEngine::handleGdbStarted()
|
|||||||
} else {
|
} else {
|
||||||
// Gdb on local host
|
// Gdb on local host
|
||||||
// This is useful (only) in custom gdb builds that did not run 'make install'
|
// This is useful (only) in custom gdb builds that did not run 'make install'
|
||||||
const FilePath uninstalledData = rp.debugger.command.executable().parentDir()
|
const FilePath uninstalledData = rp.debugger().command.executable().parentDir()
|
||||||
/ "data-directory/python";
|
/ "data-directory/python";
|
||||||
if (uninstalledData.exists())
|
if (uninstalledData.exists())
|
||||||
runCommand({"python sys.path.append('" + uninstalledData.path() + "')"});
|
runCommand({"python sys.path.append('" + uninstalledData.path() + "')"});
|
||||||
@@ -4104,7 +4104,7 @@ void GdbEngine::setEnvironmentVariables()
|
|||||||
&& str.compare("path", Qt::CaseInsensitive) == 0;
|
&& str.compare("path", Qt::CaseInsensitive) == 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
Environment baseEnv = runParameters().debugger.environment;
|
Environment baseEnv = runParameters().debugger().environment;
|
||||||
Environment runEnv = runParameters().inferior().environment;
|
Environment runEnv = runParameters().inferior().environment;
|
||||||
const EnvironmentItems items = baseEnv.diff(runEnv);
|
const EnvironmentItems items = baseEnv.diff(runEnv);
|
||||||
for (const EnvironmentItem &item : items) {
|
for (const EnvironmentItem &item : items) {
|
||||||
@@ -4139,7 +4139,7 @@ void GdbEngine::handleGdbDone()
|
|||||||
.arg(wd.toUserOutput());
|
.arg(wd.toUserOutput());
|
||||||
} else {
|
} else {
|
||||||
msg = RunWorker::userMessageForProcessError(QProcess::FailedToStart,
|
msg = RunWorker::userMessageForProcessError(QProcess::FailedToStart,
|
||||||
runParameters().debugger.command.executable());
|
runParameters().debugger().command.executable());
|
||||||
}
|
}
|
||||||
handleAdapterStartFailed(msg);
|
handleAdapterStartFailed(msg);
|
||||||
return;
|
return;
|
||||||
@@ -4148,7 +4148,7 @@ void GdbEngine::handleGdbDone()
|
|||||||
const QProcess::ProcessError error = m_gdbProc.error();
|
const QProcess::ProcessError error = m_gdbProc.error();
|
||||||
if (error != QProcess::UnknownError) {
|
if (error != QProcess::UnknownError) {
|
||||||
QString msg = RunWorker::userMessageForProcessError(error,
|
QString msg = RunWorker::userMessageForProcessError(error,
|
||||||
runParameters().debugger.command.executable());
|
runParameters().debugger().command.executable());
|
||||||
const QString errorString = m_gdbProc.errorString();
|
const QString errorString = m_gdbProc.errorString();
|
||||||
if (!errorString.isEmpty())
|
if (!errorString.isEmpty())
|
||||||
msg += '\n' + errorString;
|
msg += '\n' + errorString;
|
||||||
@@ -4404,7 +4404,7 @@ bool GdbEngine::isTermEngine() const
|
|||||||
|
|
||||||
bool GdbEngine::usesOutputCollector() const
|
bool GdbEngine::usesOutputCollector() const
|
||||||
{
|
{
|
||||||
return isPlainEngine() && runParameters().debugger.command.executable().isLocal();
|
return isPlainEngine() && runParameters().debugger().command.executable().isLocal();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbEngine::claimInitialBreakpoints()
|
void GdbEngine::claimInitialBreakpoints()
|
||||||
@@ -4524,7 +4524,7 @@ void GdbEngine::setupInferior()
|
|||||||
FilePath executable = rp.inferior().command.executable();
|
FilePath executable = rp.inferior().command.executable();
|
||||||
|
|
||||||
if (executable.isEmpty()) {
|
if (executable.isEmpty()) {
|
||||||
CoreInfo cinfo = CoreInfo::readExecutableNameFromCore(rp.debugger, rp.coreFile());
|
CoreInfo cinfo = CoreInfo::readExecutableNameFromCore(rp.debugger(), rp.coreFile());
|
||||||
|
|
||||||
if (!cinfo.isCore) {
|
if (!cinfo.isCore) {
|
||||||
AsynchronousMessageBox::warning(Tr::tr("Error Loading Core File"),
|
AsynchronousMessageBox::warning(Tr::tr("Error Loading Core File"),
|
||||||
|
@@ -180,10 +180,10 @@ void LldbEngine::setupEngine()
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||||
|
|
||||||
const FilePath lldbCmd = runParameters().debugger.command.executable();
|
const FilePath lldbCmd = runParameters().debugger().command.executable();
|
||||||
|
|
||||||
showMessage("STARTING LLDB: " + lldbCmd.toUserOutput());
|
showMessage("STARTING LLDB: " + lldbCmd.toUserOutput());
|
||||||
Environment environment = runParameters().debugger.environment;
|
Environment environment = runParameters().debugger().environment;
|
||||||
environment.set("QT_CREATOR_LLDB_PROCESS", "1");
|
environment.set("QT_CREATOR_LLDB_PROCESS", "1");
|
||||||
environment.set("PYTHONUNBUFFERED", "1"); // avoid flushing problem on macOS
|
environment.set("PYTHONUNBUFFERED", "1"); // avoid flushing problem on macOS
|
||||||
const bool ndkPythonEnvTweaked = DebuggerItem::addAndroidLldbPythonEnv(lldbCmd, environment);
|
const bool ndkPythonEnvTweaked = DebuggerItem::addAndroidLldbPythonEnv(lldbCmd, environment);
|
||||||
@@ -210,8 +210,8 @@ void LldbEngine::setupEngine()
|
|||||||
|
|
||||||
m_lldbProc.setEnvironment(environment);
|
m_lldbProc.setEnvironment(environment);
|
||||||
|
|
||||||
if (runParameters().debugger.workingDirectory.isDir())
|
if (runParameters().debugger().workingDirectory.isDir())
|
||||||
m_lldbProc.setWorkingDirectory(runParameters().debugger.workingDirectory);
|
m_lldbProc.setWorkingDirectory(runParameters().debugger().workingDirectory);
|
||||||
|
|
||||||
m_lldbProc.setCommand(CommandLine(lldbCmd));
|
m_lldbProc.setCommand(CommandLine(lldbCmd));
|
||||||
|
|
||||||
@@ -799,7 +799,7 @@ void LldbEngine::handleLldbDone()
|
|||||||
notifyEngineSetupFailed();
|
notifyEngineSetupFailed();
|
||||||
showMessage("ADAPTER START FAILED");
|
showMessage("ADAPTER START FAILED");
|
||||||
ICore::showWarningWithOptions(adapterStartFailed(), Tr::tr("Unable to start LLDB \"%1\": %2")
|
ICore::showWarningWithOptions(adapterStartFailed(), Tr::tr("Unable to start LLDB \"%1\": %2")
|
||||||
.arg(runParameters().debugger.command.executable().toUserOutput(),
|
.arg(runParameters().debugger().command.executable().toUserOutput(),
|
||||||
m_lldbProc.errorString()));
|
m_lldbProc.errorString()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -833,7 +833,7 @@ QString LldbEngine::errorMessage(QProcess::ProcessError error) const
|
|||||||
return Tr::tr("The LLDB process failed to start. Either the "
|
return Tr::tr("The LLDB process failed to start. Either the "
|
||||||
"invoked program \"%1\" is missing, or you may have insufficient "
|
"invoked program \"%1\" is missing, or you may have insufficient "
|
||||||
"permissions to invoke the program.")
|
"permissions to invoke the program.")
|
||||||
.arg(runParameters().debugger.command.executable().toUserOutput());
|
.arg(runParameters().debugger().command.executable().toUserOutput());
|
||||||
case QProcess::Crashed:
|
case QProcess::Crashed:
|
||||||
return Tr::tr("The LLDB process crashed some time after starting "
|
return Tr::tr("The LLDB process crashed some time after starting "
|
||||||
"successfully.");
|
"successfully.");
|
||||||
|
@@ -122,7 +122,7 @@ void PdbEngine::setupEngine()
|
|||||||
arguments.removeFirst(); // file added by run config
|
arguments.removeFirst(); // file added by run config
|
||||||
cmd.addArgs(arguments);
|
cmd.addArgs(arguments);
|
||||||
showMessage("STARTING " + cmd.toUserOutput());
|
showMessage("STARTING " + cmd.toUserOutput());
|
||||||
m_proc.setEnvironment(runParameters().debugger.environment);
|
m_proc.setEnvironment(runParameters().debugger().environment);
|
||||||
m_proc.setCommand(cmd);
|
m_proc.setCommand(cmd);
|
||||||
m_proc.start();
|
m_proc.start();
|
||||||
}
|
}
|
||||||
|
@@ -74,7 +74,7 @@ StackFrame StackFrame::parseFrame(const GdbMi &frameMi, const DebuggerRunParamet
|
|||||||
frame.level = frameMi["level"].data();
|
frame.level = frameMi["level"].data();
|
||||||
frame.function = frameMi["function"].data();
|
frame.function = frameMi["function"].data();
|
||||||
frame.module = frameMi["module"].data();
|
frame.module = frameMi["module"].data();
|
||||||
const FilePath debugger = rp.debugger.command.executable();
|
const FilePath debugger = rp.debugger().command.executable();
|
||||||
const FilePath onDevicePath = debugger.withNewPath(frameMi["file"].data()).cleanPath();
|
const FilePath onDevicePath = debugger.withNewPath(frameMi["file"].data()).cleanPath();
|
||||||
frame.file = onDevicePath.localSource().value_or(onDevicePath);
|
frame.file = onDevicePath.localSource().value_or(onDevicePath);
|
||||||
frame.line = frameMi["line"].toInt();
|
frame.line = frameMi["line"].toInt();
|
||||||
|
@@ -88,16 +88,16 @@ void UvscEngine::setupEngine()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for valid uVision executable.
|
// Check for valid uVision executable.
|
||||||
if (rp.debugger.command.isEmpty()) {
|
if (rp.debugger().command.isEmpty()) {
|
||||||
handleSetupFailure(Tr::tr("Internal error: No uVision executable specified."));
|
handleSetupFailure(Tr::tr("Internal error: No uVision executable specified."));
|
||||||
return;
|
return;
|
||||||
} else if (!rp.debugger.command.executable().exists()) {
|
} else if (!rp.debugger().command.executable().exists()) {
|
||||||
handleSetupFailure(Tr::tr("Internal error: The specified uVision executable does not exist."));
|
handleSetupFailure(Tr::tr("Internal error: The specified uVision executable does not exist."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
showMessage("UVSC: RESOLVING LIBRARY SYMBOLS...");
|
showMessage("UVSC: RESOLVING LIBRARY SYMBOLS...");
|
||||||
m_client.reset(new UvscClient(rp.debugger.command.executable().parentDir().toUrlishString()));
|
m_client.reset(new UvscClient(rp.debugger().command.executable().parentDir().toUrlishString()));
|
||||||
if (m_client->error() != UvscClient::NoError) {
|
if (m_client->error() != UvscClient::NoError) {
|
||||||
handleSetupFailure(Tr::tr("Internal error: Cannot resolve the library: %1.")
|
handleSetupFailure(Tr::tr("Internal error: Cannot resolve the library: %1.")
|
||||||
.arg(m_client->errorString()));
|
.arg(m_client->errorString()));
|
||||||
|
Reference in New Issue
Block a user