forked from qt-creator/qt-creator
Debugger: Add an macro expander for debugger engine type
Change-Id: Ib16f3b410ea83f6a4687b03677c51fbec26165d7 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -32,8 +32,9 @@
|
|||||||
#include "debuggeritemmanager.h"
|
#include "debuggeritemmanager.h"
|
||||||
#include "debuggerkitconfigwidget.h"
|
#include "debuggerkitconfigwidget.h"
|
||||||
|
|
||||||
#include "projectexplorer/toolchain.h"
|
#include <projectexplorer/toolchain.h>
|
||||||
#include "projectexplorer/projectexplorerconstants.h"
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
#include <projectexplorer/kitinformationmacroexpander.h>
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -299,6 +300,20 @@ KitConfigWidget *DebuggerKitInformation::createConfigWidget(Kit *k) const
|
|||||||
return new Internal::DebuggerKitConfigWidget(k, this);
|
return new Internal::DebuggerKitConfigWidget(k, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AbstractMacroExpander *DebuggerKitInformation::createMacroExpander(const Kit *k) const
|
||||||
|
{
|
||||||
|
return new MacroExpander([k, this](const QString &name, QString *ret) -> bool {
|
||||||
|
const DebuggerItem *item = DebuggerKitInformation::debugger(k);
|
||||||
|
|
||||||
|
if (name == QLatin1String("Debugger:engineType")) {
|
||||||
|
*ret = item ? item->engineTypeName() : tr("none");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
KitInformation::ItemList DebuggerKitInformation::toUserOutput(const Kit *k) const
|
KitInformation::ItemList DebuggerKitInformation::toUserOutput(const Kit *k) const
|
||||||
{
|
{
|
||||||
return ItemList() << qMakePair(tr("Debugger"), displayString(k));
|
return ItemList() << qMakePair(tr("Debugger"), displayString(k));
|
||||||
|
@@ -62,6 +62,7 @@ public:
|
|||||||
static bool isValidDebugger(const ProjectExplorer::Kit *k);
|
static bool isValidDebugger(const ProjectExplorer::Kit *k);
|
||||||
|
|
||||||
ProjectExplorer::KitConfigWidget *createConfigWidget(ProjectExplorer::Kit *k) const;
|
ProjectExplorer::KitConfigWidget *createConfigWidget(ProjectExplorer::Kit *k) const;
|
||||||
|
Utils::AbstractMacroExpander *createMacroExpander(const ProjectExplorer::Kit *k) const;
|
||||||
|
|
||||||
ItemList toUserOutput(const ProjectExplorer::Kit *k) const;
|
ItemList toUserOutput(const ProjectExplorer::Kit *k) const;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user