forked from qt-creator/qt-creator
Debugger: Use a StandardRunnable for the debugger process
One step further to separate the debugger environment from the inferior environment and to make it possible to configure a working directory. Guessing one from the inferior's working directory is not always a good idea. Change-Id: I33d139c0f228ec0870556b82bc6aecca0a8e62d6 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
#include <utils/environment.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/macroexpander.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -244,6 +245,18 @@ const DebuggerItem *DebuggerKitInformation::debugger(const Kit *kit)
|
||||
return DebuggerItemManager::findById(id);
|
||||
}
|
||||
|
||||
StandardRunnable DebuggerKitInformation::runnable(const Kit *kit)
|
||||
{
|
||||
StandardRunnable runnable;
|
||||
if (const DebuggerItem *item = debugger(kit)) {
|
||||
runnable.executable = item->command().toString();
|
||||
runnable.workingDirectory = item->workingDirectory().toString();
|
||||
runnable.environment = Utils::Environment::systemEnvironment();
|
||||
runnable.environment.set("LC_NUMERIC", "C");
|
||||
}
|
||||
return runnable;
|
||||
}
|
||||
|
||||
bool DebuggerKitInformation::isValidDebugger(const Kit *k)
|
||||
{
|
||||
return debuggerConfigurationErrors(k) == 0;
|
||||
@@ -326,14 +339,6 @@ KitInformation::ItemList DebuggerKitInformation::toUserOutput(const Kit *k) cons
|
||||
return ItemList() << qMakePair(tr("Debugger"), displayString(k));
|
||||
}
|
||||
|
||||
FileName DebuggerKitInformation::debuggerCommand(const Kit *k)
|
||||
{
|
||||
const DebuggerItem *item = debugger(k);
|
||||
if (item)
|
||||
return item->command();
|
||||
return FileName();
|
||||
}
|
||||
|
||||
DebuggerEngineType DebuggerKitInformation::engineType(const Kit *k)
|
||||
{
|
||||
const DebuggerItem *item = debugger(k);
|
||||
|
||||
Reference in New Issue
Block a user