forked from qt-creator/qt-creator
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:
@@ -369,7 +369,7 @@ void CdbEngine::setupEngine()
|
|||||||
case AttachToCrashedProcess:
|
case AttachToCrashedProcess:
|
||||||
debugger.addArgs({"-p", QString::number(sp.attachPid().pid())});
|
debugger.addArgs({"-p", QString::number(sp.attachPid().pid())});
|
||||||
if (sp.startMode() == AttachToCrashedProcess) {
|
if (sp.startMode() == AttachToCrashedProcess) {
|
||||||
debugger.addArgs({"-e", sp.crashParameter, "-g"});
|
debugger.addArgs({"-e", sp.crashParameter(), "-g"});
|
||||||
} else {
|
} else {
|
||||||
// TODO: Dead branch?
|
// TODO: Dead branch?
|
||||||
if (usesTerminal())
|
if (usesTerminal())
|
||||||
|
@@ -188,7 +188,7 @@ DebuggerRunParameters DebuggerRunParameters::fromRunControl(ProjectExplorer::Run
|
|||||||
bool ok = false;
|
bool ok = false;
|
||||||
const int nativeMixedOverride = qtcEnvironmentVariableIntValue("QTC_DEBUGGER_NATIVE_MIXED", &ok);
|
const int nativeMixedOverride = qtcEnvironmentVariableIntValue("QTC_DEBUGGER_NATIVE_MIXED", &ok);
|
||||||
if (ok)
|
if (ok)
|
||||||
params.nativeMixedEnabled = bool(nativeMixedOverride);
|
params.m_nativeMixedEnabled = bool(nativeMixedOverride);
|
||||||
|
|
||||||
if (QtSupport::QtVersion *baseQtVersion = QtSupport::QtKitAspect::qtVersion(kit)) {
|
if (QtSupport::QtVersion *baseQtVersion = QtSupport::QtKitAspect::qtVersion(kit)) {
|
||||||
const QVersionNumber qtVersion = baseQtVersion->qtVersion();
|
const QVersionNumber qtVersion = baseQtVersion->qtVersion();
|
||||||
@@ -256,7 +256,7 @@ Result DebuggerRunParameters::fixupParameters(ProjectExplorer::RunControl *runCo
|
|||||||
if (m_isQmlDebugging) {
|
if (m_isQmlDebugging) {
|
||||||
QmlDebugServicesPreset service;
|
QmlDebugServicesPreset service;
|
||||||
if (isCppDebugging()) {
|
if (isCppDebugging()) {
|
||||||
if (nativeMixedEnabled) {
|
if (m_nativeMixedEnabled) {
|
||||||
service = QmlNativeDebuggerServices;
|
service = QmlNativeDebuggerServices;
|
||||||
} else {
|
} else {
|
||||||
service = QmlDebuggerServices;
|
service = QmlDebuggerServices;
|
||||||
@@ -265,7 +265,7 @@ Result DebuggerRunParameters::fixupParameters(ProjectExplorer::RunControl *runCo
|
|||||||
service = QmlDebuggerServices;
|
service = QmlDebuggerServices;
|
||||||
}
|
}
|
||||||
if (m_startMode != AttachToLocalProcess && m_startMode != AttachToCrashedProcess) {
|
if (m_startMode != AttachToLocalProcess && m_startMode != AttachToCrashedProcess) {
|
||||||
const QString qmlarg = isCppDebugging() && nativeMixedEnabled
|
const QString qmlarg = isCppDebugging() && m_nativeMixedEnabled
|
||||||
? qmlDebugNativeArguments(service, false)
|
? qmlDebugNativeArguments(service, false)
|
||||||
: qmlDebugTcpArguments(service, m_qmlServer);
|
: qmlDebugTcpArguments(service, m_qmlServer);
|
||||||
m_inferior.command.addArg(qmlarg);
|
m_inferior.command.addArg(qmlarg);
|
||||||
@@ -341,7 +341,7 @@ bool DebuggerRunParameters::isCppDebugging() const
|
|||||||
|
|
||||||
bool DebuggerRunParameters::isNativeMixedDebugging() const
|
bool DebuggerRunParameters::isNativeMixedDebugging() const
|
||||||
{
|
{
|
||||||
return nativeMixedEnabled && isCppDebugging() && m_isQmlDebugging;
|
return m_nativeMixedEnabled && isCppDebugging() && m_isQmlDebugging;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -2910,7 +2910,7 @@ QString DebuggerEngine::formatStartParameters() const
|
|||||||
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())
|
||||||
str << "PID: " << rp.attachPid().pid() << ' ' << rp.crashParameter << '\n';
|
str << "PID: " << rp.attachPid().pid() << ' ' << rp.crashParameter() << '\n';
|
||||||
if (!rp.projectSourceDirectory().isEmpty()) {
|
if (!rp.projectSourceDirectory().isEmpty()) {
|
||||||
str << "Project: " << rp.projectSourceDirectory().toUserOutput() << '\n';
|
str << "Project: " << rp.projectSourceDirectory().toUserOutput() << '\n';
|
||||||
str << "Additional Search Directories:";
|
str << "Additional Search Directories:";
|
||||||
|
@@ -227,10 +227,8 @@ public:
|
|||||||
void setMainScript(const Utils::FilePath &path) { m_mainScript = path; }
|
void setMainScript(const Utils::FilePath &path) { m_mainScript = path; }
|
||||||
Utils::FilePath mainScript() const { return m_mainScript; }
|
Utils::FilePath mainScript() const { return m_mainScript; }
|
||||||
|
|
||||||
// Used by AttachCrashedExternal.
|
void setCrashParameter(const QString &event) { m_crashParameter = event; }
|
||||||
QString crashParameter;
|
QString crashParameter() const { return m_crashParameter; }
|
||||||
|
|
||||||
bool nativeMixedEnabled = false;
|
|
||||||
|
|
||||||
bool isCppDebugging() const;
|
bool isCppDebugging() const;
|
||||||
bool isNativeMixedDebugging() const;
|
bool isNativeMixedDebugging() const;
|
||||||
@@ -330,6 +328,9 @@ private:
|
|||||||
|
|
||||||
Utils::FilePath m_interpreter; // Used by Script debugging
|
Utils::FilePath m_interpreter; // Used by Script debugging
|
||||||
Utils::FilePath m_mainScript; // Used by Script debugging
|
Utils::FilePath m_mainScript; // Used by Script debugging
|
||||||
|
|
||||||
|
QString m_crashParameter; // Used by AttachCrashedExternal.
|
||||||
|
bool m_nativeMixedEnabled = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
@@ -1441,7 +1441,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
|
|||||||
auto debugger = new DebuggerRunTool(runControl);
|
auto debugger = new DebuggerRunTool(runControl);
|
||||||
DebuggerRunParameters &rp = debugger->runParameters();
|
DebuggerRunParameters &rp = debugger->runParameters();
|
||||||
rp.setStartMode(AttachToCrashedProcess);
|
rp.setStartMode(AttachToCrashedProcess);
|
||||||
debugger->setCrashParameter(it->section(':', 0, 0));
|
rp.setCrashParameter(it->section(':', 0, 0));
|
||||||
rp.setAttachPid(pid);
|
rp.setAttachPid(pid);
|
||||||
rp.setDisplayName(Tr::tr("Crashed process %1").arg(pid));
|
rp.setDisplayName(Tr::tr("Crashed process %1").arg(pid));
|
||||||
rp.setStartMessage(Tr::tr("Attaching to crashed process %1").arg(pid));
|
rp.setStartMessage(Tr::tr("Attaching to crashed process %1").arg(pid));
|
||||||
|
@@ -118,11 +118,6 @@ void DebuggerRunTool::modifyDebuggerEnvironment(const EnvironmentItems &items)
|
|||||||
m_runParameters.debugger().environment.modify(items);
|
m_runParameters.debugger().environment.modify(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerRunTool::setCrashParameter(const QString &event)
|
|
||||||
{
|
|
||||||
m_runParameters.crashParameter = event;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebuggerRunTool::start()
|
void DebuggerRunTool::start()
|
||||||
{
|
{
|
||||||
startCoreFileSetupIfNeededAndContinueStartup();
|
startCoreFileSetupIfNeededAndContinueStartup();
|
||||||
|
@@ -30,8 +30,6 @@ public:
|
|||||||
void start() override;
|
void start() override;
|
||||||
void stop() override;
|
void stop() override;
|
||||||
|
|
||||||
void setCrashParameter(const QString &event);
|
|
||||||
|
|
||||||
void setUseDebugServer(Utils::ProcessHandle attachPid, bool essential, bool useMulti);
|
void setUseDebugServer(Utils::ProcessHandle attachPid, bool essential, bool useMulti);
|
||||||
|
|
||||||
void setTestCase(int testCase);
|
void setTestCase(int testCase);
|
||||||
|
Reference in New Issue
Block a user