From af8c8d4e0cf95fda58124f0bac7804212c67c8db Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 14 Jul 2014 15:04:47 +0300 Subject: [PATCH] Debugger: Only update executable from core file when needed Conditions: 1. Not empty. It erases the existing executable for no reason. 2. Not Windows -> Windows doesn't produce core dumps, so the path inside it is unlikely to match anything on the host. Change-Id: Ib3cd1ae278d8bc9f6ad326821319ca3deda44800 Reviewed-by: Thomas Otto Reviewed-by: hjk --- src/plugins/debugger/loadcoredialog.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/plugins/debugger/loadcoredialog.cpp b/src/plugins/debugger/loadcoredialog.cpp index 30f33bcf4db..0f89a87b3ed 100644 --- a/src/plugins/debugger/loadcoredialog.cpp +++ b/src/plugins/debugger/loadcoredialog.cpp @@ -321,12 +321,15 @@ bool AttachCoreDialog::useLocalCoreFile() const void AttachCoreDialog::coreFileChanged(const QString &core) { - Kit *k = d->kitChooser->currentKit(); - QTC_ASSERT(k, return); - FileName cmd = DebuggerKitInformation::debuggerCommand(k); - bool isCore = false; - QString exe = readExecutableNameFromCore(cmd.toString(), core, &isCore); - d->localExecFileName->setFileName(FileName::fromString(exe)); + if (!Utils::HostOsInfo::isWindowsHost()) { + Kit *k = d->kitChooser->currentKit(); + QTC_ASSERT(k, return); + FileName cmd = DebuggerKitInformation::debuggerCommand(k); + bool isCore = false; + const QString exe = readExecutableNameFromCore(cmd.toString(), core, &isCore); + if (!exe.isEmpty()) + d->localExecFileName->setFileName(FileName::fromString(exe)); + } changed(); }