Cdb: Setup symbol paths before attaching to a process

Change-Id: I075661ac95da3937dae8c918b83fcc4449d9b56e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2016-10-18 08:43:03 +02:00
parent b652889e4a
commit 3c10e586e7

View File

@@ -547,6 +547,15 @@ bool CdbEngine::launchCDB(const DebuggerRunParameters &sp, QString *errorMessage
if (!sourcePaths.isEmpty()) if (!sourcePaths.isEmpty())
arguments << "-srcpath" << sourcePaths.join(';'); arguments << "-srcpath" << sourcePaths.join(';');
QStringList symbolPaths = stringListSetting(CdbSymbolPaths);
QString symbolPath = sp.inferior.environment.value("_NT_ALT_SYMBOL_PATH");
if (!symbolPath.isEmpty())
symbolPaths += symbolPath;
symbolPath = sp.inferior.environment.value("_NT_SYMBOL_PATH");
if (!symbolPath.isEmpty())
symbolPaths += symbolPath;
arguments << "-y" << (symbolPaths.isEmpty() ? "\"\"" : symbolPaths.join(';'));
// Compile argument string preserving quotes // Compile argument string preserving quotes
QString nativeArguments = expand(stringSetting(CdbAdditionalArguments)); QString nativeArguments = expand(stringSetting(CdbAdditionalArguments));
switch (sp.startMode) { switch (sp.startMode) {
@@ -640,17 +649,6 @@ void CdbEngine::setupInferior()
[this, id](const DebuggerResponse &r) { handleBreakInsert(r, id); }}); [this, id](const DebuggerResponse &r) { handleBreakInsert(r, id); }});
} }
// setting up symbol search path
QStringList symbolPaths = stringListSetting(CdbSymbolPaths);
const QProcessEnvironment &env = m_process.processEnvironment();
QString symbolPath = env.value("_NT_ALT_SYMBOL_PATH");
if (!symbolPath.isEmpty())
symbolPaths += symbolPath;
symbolPath = env.value("_NT_SYMBOL_PATH");
if (!symbolPath.isEmpty())
symbolPaths += symbolPath;
runCommand({".sympath \"" + symbolPaths.join(';') + '"', NoFlags});
runCommand({"sxn 0x4000001f", NoFlags}); // Do not break on WowX86 exceptions. runCommand({"sxn 0x4000001f", NoFlags}); // Do not break on WowX86 exceptions.
runCommand({"sxn ibp", NoFlags}); // Do not break on initial breakpoints. runCommand({"sxn ibp", NoFlags}); // Do not break on initial breakpoints.
runCommand({".asm source_line", NoFlags}); // Source line in assembly runCommand({".asm source_line", NoFlags}); // Source line in assembly