forked from qt-creator/qt-creator
Debugger: Expand target mapping only when required
Store the unexpanded string in settings and expand on execution. Change-Id: Ib3160a548b7501b22d120629a6376e2252df32e5 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
04f8c0946f
commit
2df4667620
@@ -256,7 +256,7 @@ void CdbEngine::init()
|
|||||||
if (!sourcePathMap.isEmpty()) {
|
if (!sourcePathMap.isEmpty()) {
|
||||||
for (auto it = sourcePathMap.constBegin(), cend = sourcePathMap.constEnd(); it != cend; ++it) {
|
for (auto it = sourcePathMap.constBegin(), cend = sourcePathMap.constEnd(); it != cend; ++it) {
|
||||||
m_sourcePathMappings.push_back({QDir::toNativeSeparators(it.key()),
|
m_sourcePathMappings.push_back({QDir::toNativeSeparators(it.key()),
|
||||||
QDir::toNativeSeparators(it.value())});
|
QDir::toNativeSeparators(expand(it.value()))});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update source path maps from debugger start params
|
// update source path maps from debugger start params
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ QString DebuggerSourcePathMappingWidget::editSourceField() const
|
|||||||
|
|
||||||
QString DebuggerSourcePathMappingWidget::editTargetField() const
|
QString DebuggerSourcePathMappingWidget::editTargetField() const
|
||||||
{
|
{
|
||||||
return m_targetChooser->path();
|
return m_targetChooser->rawPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerSourcePathMappingWidget::setEditFieldMapping(const Mapping &m)
|
void DebuggerSourcePathMappingWidget::setEditFieldMapping(const Mapping &m)
|
||||||
|
|||||||
@@ -61,7 +61,6 @@
|
|||||||
#include <app/app_version.h>
|
#include <app/app_version.h>
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/macroexpander.h>
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/savedaction.h>
|
#include <utils/savedaction.h>
|
||||||
@@ -3651,7 +3650,7 @@ void GdbEngine::setupEngine()
|
|||||||
for (auto it = completeSourcePathMap.constBegin(), cend = completeSourcePathMap.constEnd();
|
for (auto it = completeSourcePathMap.constBegin(), cend = completeSourcePathMap.constEnd();
|
||||||
it != cend;
|
it != cend;
|
||||||
++it) {
|
++it) {
|
||||||
runCommand({"set substitute-path " + it.key() + " " + it.value()});
|
runCommand({"set substitute-path " + it.key() + " " + expand(it.value())});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spaces just will not work.
|
// Spaces just will not work.
|
||||||
|
|||||||
@@ -263,7 +263,8 @@ void LldbEngine::setupEngine()
|
|||||||
for (auto it = sourcePathMap.constBegin(), cend = sourcePathMap.constEnd();
|
for (auto it = sourcePathMap.constBegin(), cend = sourcePathMap.constEnd();
|
||||||
it != cend;
|
it != cend;
|
||||||
++it) {
|
++it) {
|
||||||
executeDebuggerCommand("settings append target.source-map " + it.key() + ' ' + it.value());
|
executeDebuggerCommand(
|
||||||
|
"settings append target.source-map " + it.key() + ' ' + expand(it.value()));
|
||||||
}
|
}
|
||||||
|
|
||||||
DebuggerCommand cmd2("setupInferior");
|
DebuggerCommand cmd2("setupInferior");
|
||||||
|
|||||||
Reference in New Issue
Block a user