aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/debugger/debuggerengine.cpp12
-rw-r--r--src/plugins/debugger/debuggersourcepathmappingwidget.cpp5
2 files changed, 15 insertions, 2 deletions
diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp
index 7c86043dd9c..840d640430f 100644
--- a/src/plugins/debugger/debuggerengine.cpp
+++ b/src/plugins/debugger/debuggerengine.cpp
@@ -1830,9 +1830,17 @@ void DebuggerEngine::validateExecutable(DebuggerStartParameters *sp)
bool hasEmbeddedInfo = elfData.indexOf(".debug_info") >= 0;
bool hasLink = elfData.indexOf(".gnu_debuglink") >= 0;
if (hasEmbeddedInfo) {
+ QSharedPointer<GlobalDebuggerOptions> options = debuggerCore()->globalDebuggerOptions();
+ SourcePathRegExpMap globalRegExpSourceMap;
+ globalRegExpSourceMap.reserve(options->sourcePathRegExpMap.size());
+ foreach (auto entry, options->sourcePathRegExpMap) {
+ const QString expanded = VariableManager::expandedString(entry.second);
+ if (!expanded.isEmpty())
+ globalRegExpSourceMap.push_back(qMakePair(entry.first, expanded));
+ }
+ if (globalRegExpSourceMap.isEmpty())
+ return;
if (QSharedPointer<Utils::ElfMapper> mapper = reader.readSection(".debug_str")) {
- QSharedPointer<GlobalDebuggerOptions> options = debuggerCore()->globalDebuggerOptions();
- SourcePathRegExpMap globalRegExpSourceMap = options->sourcePathRegExpMap;
const char *str = mapper->start;
const char *limit = str + mapper->fdlen;
while (str < limit) {
diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp
index 34b1ce7277a..04d53bc948c 100644
--- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp
+++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp
@@ -30,7 +30,10 @@
#include "debuggersourcepathmappingwidget.h"
#include "debuggerstartparameters.h"
+#include <coreplugin/variablechooser.h>
+
#include <utils/buildablehelperlibrary.h>
+#include <utils/fancylineedit.h>
#include <utils/pathchooser.h>
#include <utils/qtcassert.h>
#include <utils/synchronousprocess.h>
@@ -205,6 +208,7 @@ DebuggerSourcePathMappingWidget::DebuggerSourcePathMappingWidget(QWidget *parent
m_sourceLineEdit(new QLineEdit(this)),
m_targetChooser(new PathChooser(this))
{
+ (void)new Core::VariableChooser(this);
setTitle(tr("Source Paths Mapping"));
setToolTip(tr("<html><head/><body><p>Mappings of source file folders to "
"be used in the debugger can be entered here.</p>"
@@ -270,6 +274,7 @@ DebuggerSourcePathMappingWidget::DebuggerSourcePathMappingWidget(QWidget *parent
editTargetLabel->setBuddy(m_targetChooser);
m_targetChooser->setToolTip(targetToolTip);
editLayout->addRow(editTargetLabel, m_targetChooser);
+ Core::VariableChooser::addVariableSupport(m_targetChooser->lineEdit());
// Main layout
QVBoxLayout *mainLayout = new QVBoxLayout;