Debugger: Transform a few fields of DebuggerRunParameters

Transform crashParameter and nativeMixedEnabled.

Task-number: QTCREATORBUG-29168
Change-Id: I521a36e4d3897d045465413537af09459324efef
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2025-01-13 17:18:45 +01:00
parent 8bb1fc5764
commit e873f1ccbf
6 changed files with 12 additions and 18 deletions

View File

@@ -369,7 +369,7 @@ void CdbEngine::setupEngine()
case AttachToCrashedProcess:
debugger.addArgs({"-p", QString::number(sp.attachPid().pid())});
if (sp.startMode() == AttachToCrashedProcess) {
debugger.addArgs({"-e", sp.crashParameter, "-g"});
debugger.addArgs({"-e", sp.crashParameter(), "-g"});
} else {
// TODO: Dead branch?
if (usesTerminal())

View File

@@ -188,7 +188,7 @@ DebuggerRunParameters DebuggerRunParameters::fromRunControl(ProjectExplorer::Run
bool ok = false;
const int nativeMixedOverride = qtcEnvironmentVariableIntValue("QTC_DEBUGGER_NATIVE_MIXED", &ok);
if (ok)
params.nativeMixedEnabled = bool(nativeMixedOverride);
params.m_nativeMixedEnabled = bool(nativeMixedOverride);
if (QtSupport::QtVersion *baseQtVersion = QtSupport::QtKitAspect::qtVersion(kit)) {
const QVersionNumber qtVersion = baseQtVersion->qtVersion();
@@ -256,7 +256,7 @@ Result DebuggerRunParameters::fixupParameters(ProjectExplorer::RunControl *runCo
if (m_isQmlDebugging) {
QmlDebugServicesPreset service;
if (isCppDebugging()) {
if (nativeMixedEnabled) {
if (m_nativeMixedEnabled) {
service = QmlNativeDebuggerServices;
} else {
service = QmlDebuggerServices;
@@ -265,7 +265,7 @@ Result DebuggerRunParameters::fixupParameters(ProjectExplorer::RunControl *runCo
service = QmlDebuggerServices;
}
if (m_startMode != AttachToLocalProcess && m_startMode != AttachToCrashedProcess) {
const QString qmlarg = isCppDebugging() && nativeMixedEnabled
const QString qmlarg = isCppDebugging() && m_nativeMixedEnabled
? qmlDebugNativeArguments(service, false)
: qmlDebugTcpArguments(service, m_qmlServer);
m_inferior.command.addArg(qmlarg);
@@ -341,7 +341,7 @@ bool DebuggerRunParameters::isCppDebugging() const
bool DebuggerRunParameters::isNativeMixedDebugging() const
{
return nativeMixedEnabled && isCppDebugging() && m_isQmlDebugging;
return m_nativeMixedEnabled && isCppDebugging() && m_isQmlDebugging;
}
namespace Internal {
@@ -2910,7 +2910,7 @@ QString DebuggerEngine::formatStartParameters() const
if (!rp.coreFile().isEmpty())
str << "Core: " << rp.coreFile().toUserOutput() << '\n';
if (rp.attachPid().isValid())
str << "PID: " << rp.attachPid().pid() << ' ' << rp.crashParameter << '\n';
str << "PID: " << rp.attachPid().pid() << ' ' << rp.crashParameter() << '\n';
if (!rp.projectSourceDirectory().isEmpty()) {
str << "Project: " << rp.projectSourceDirectory().toUserOutput() << '\n';
str << "Additional Search Directories:";

View File

@@ -227,10 +227,8 @@ public:
void setMainScript(const Utils::FilePath &path) { m_mainScript = path; }
Utils::FilePath mainScript() const { return m_mainScript; }
// Used by AttachCrashedExternal.
QString crashParameter;
bool nativeMixedEnabled = false;
void setCrashParameter(const QString &event) { m_crashParameter = event; }
QString crashParameter() const { return m_crashParameter; }
bool isCppDebugging() const;
bool isNativeMixedDebugging() const;
@@ -330,6 +328,9 @@ private:
Utils::FilePath m_interpreter; // Used by Script debugging
Utils::FilePath m_mainScript; // Used by Script debugging
QString m_crashParameter; // Used by AttachCrashedExternal.
bool m_nativeMixedEnabled = false;
};
namespace Internal {

View File

@@ -1441,7 +1441,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
auto debugger = new DebuggerRunTool(runControl);
DebuggerRunParameters &rp = debugger->runParameters();
rp.setStartMode(AttachToCrashedProcess);
debugger->setCrashParameter(it->section(':', 0, 0));
rp.setCrashParameter(it->section(':', 0, 0));
rp.setAttachPid(pid);
rp.setDisplayName(Tr::tr("Crashed process %1").arg(pid));
rp.setStartMessage(Tr::tr("Attaching to crashed process %1").arg(pid));

View File

@@ -118,11 +118,6 @@ void DebuggerRunTool::modifyDebuggerEnvironment(const EnvironmentItems &items)
m_runParameters.debugger().environment.modify(items);
}
void DebuggerRunTool::setCrashParameter(const QString &event)
{
m_runParameters.crashParameter = event;
}
void DebuggerRunTool::start()
{
startCoreFileSetupIfNeededAndContinueStartup();

View File

@@ -30,8 +30,6 @@ public:
void start() override;
void stop() override;
void setCrashParameter(const QString &event);
void setUseDebugServer(Utils::ProcessHandle attachPid, bool essential, bool useMulti);
void setTestCase(int testCase);