Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
8ff48088
Commit
8ff48088
authored
Mar 18, 2011
by
Friedemann Kleint
Browse files
Debugger: Always add Qt install source mappings for gdb.
As it fails for MinGW. Task-number: QTCREATORBUG-4132 Reviewed-by: hjk
parent
d87f0382
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggerplugin.cpp
View file @
8ff48088
...
...
@@ -2377,6 +2377,8 @@ static QString formatStartParameters(DebuggerStartParameters &sp)
str
<<
" (built: "
<<
QDir
::
toNativeSeparators
(
sp
.
projectBuildDir
)
<<
')'
;
str
<<
'\n'
;
}
if
(
!
sp
.
qtInstallPath
.
isEmpty
())
str
<<
"Qt: "
<<
QDir
::
toNativeSeparators
(
sp
.
qtInstallPath
)
<<
'\n'
;
if
(
!
sp
.
qmlServerAddress
.
isEmpty
())
str
<<
"QML server: "
<<
sp
.
qmlServerAddress
<<
':'
<<
sp
.
qmlServerPort
<<
'\n'
;
if
(
!
sp
.
remoteChannel
.
isEmpty
())
{
...
...
src/plugins/debugger/debuggerrunner.cpp
View file @
8ff48088
...
...
@@ -64,6 +64,7 @@
#include
<utils/fancymainwindow.h>
#include
<utils/qtcprocess.h>
#include
<coreplugin/icore.h>
#include
<utils/buildablehelperlibrary.h>
#include
<QtCore/QDir>
#include
<QtCore/QDebug>
...
...
@@ -684,6 +685,11 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
sp
.
dumperLibraryLocations
=
rc
->
dumperLibraryLocations
();
if
(
const
ProjectExplorer
::
Target
*
target
=
runConfiguration
->
target
())
{
if
(
QByteArray
(
target
->
metaObject
()
->
className
()).
contains
(
"Qt4"
))
{
const
QString
qmake
=
Utils
::
BuildableHelperLibrary
::
findSystemQt
(
sp
.
environment
);
if
(
!
qmake
.
isEmpty
())
sp
.
qtInstallPath
=
findQtInstallPath
(
qmake
);
}
if
(
const
ProjectExplorer
::
Project
*
project
=
target
->
project
())
{
sp
.
projectDir
=
project
->
projectDirectory
();
if
(
const
ProjectExplorer
::
BuildConfiguration
*
buildConfig
=
target
->
activeBuildConfiguration
())
{
...
...
src/plugins/debugger/debuggersourcepathmappingwidget.cpp
View file @
8ff48088
...
...
@@ -374,5 +374,24 @@ void DebuggerSourcePathMappingWidget::slotEditTargetFieldChanged()
}
}
/* Merge settings for an installed Qt (unless another setting
* is already in the map. */
DebuggerSourcePathMappingWidget
::
SourcePathMap
DebuggerSourcePathMappingWidget
::
mergePlatformQtPath
(
const
QString
&
qtInstallPath
,
const
SourcePathMap
&
in
)
{
SourcePathMap
rc
=
in
;
const
size_t
buildPathCount
=
sizeof
(
qtBuildPaths
)
/
sizeof
(
const
char
*
);
if
(
qtInstallPath
.
isEmpty
()
||
buildPathCount
==
0
)
return
rc
;
for
(
size_t
i
=
0
;
i
<
buildPathCount
;
i
++
)
{
const
QString
buildPath
=
QString
::
fromLatin1
(
qtBuildPaths
[
i
]);
if
(
!
rc
.
contains
(
buildPath
))
// Do not overwrite user settings.
rc
.
insert
(
buildPath
,
qtInstallPath
);
}
return
rc
;
}
}
// namespace Internal
}
// namespace Debugger
src/plugins/debugger/debuggersourcepathmappingwidget.h
View file @
8ff48088
...
...
@@ -66,6 +66,11 @@ public:
SourcePathMap
sourcePathMap
()
const
;
void
setSourcePathMap
(
const
SourcePathMap
&
);
/* Merge settings for an installed Qt (unless another setting
* is already in the map. */
static
SourcePathMap
mergePlatformQtPath
(
const
QString
&
qtInstallPath
,
const
SourcePathMap
&
in
);
signals:
private
slots
:
...
...
src/plugins/debugger/debuggerstartparameters.h
View file @
8ff48088
...
...
@@ -96,6 +96,7 @@ public:
QString
projectBuildDir
;
QString
projectDir
;
QString
qtInstallPath
;
// Used by remote debugging.
QString
remoteChannel
;
QString
remoteArchitecture
;
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
8ff48088
...
...
@@ -67,6 +67,7 @@
#include
"stackhandler.h"
#include
"threadshandler.h"
#include
"watchhandler.h"
#include
"debuggersourcepathmappingwidget.h"
#ifdef Q_OS_WIN
# include "dbgwinutils.h"
...
...
@@ -4614,14 +4615,18 @@ void GdbEngine::notifyInferiorSetupFailed()
void
GdbEngine
::
handleInferiorPrepared
()
{
typedef
GlobalDebuggerOptions
::
SourcePathMap
SourcePathMap
;
typedef
SourcePathMap
::
const_iterator
SourcePathMapIterator
;
QTC_ASSERT
(
state
()
==
InferiorSetupRequested
,
qDebug
()
<<
state
());
// Apply source path mappings from global options.
const
QSharedPointer
<
GlobalDebuggerOptions
>
globalOptions
=
debuggerCore
()
->
globalDebuggerOptions
();
if
(
!
globalOptions
->
sourcePathMap
.
isEmpty
())
{
typedef
GlobalDebuggerOptions
::
SourcePathMap
::
const_iterator
SourcePathMapIterator
;
const
SourcePathMapIterator
cend
=
globalOptions
->
sourcePathMap
.
constEnd
();
for
(
SourcePathMapIterator
it
=
globalOptions
->
sourcePathMap
.
constBegin
();
it
!=
cend
;
++
it
)
{
const
SourcePathMap
sourcePathMap
=
DebuggerSourcePathMappingWidget
::
mergePlatformQtPath
(
startParameters
().
qtInstallPath
,
debuggerCore
()
->
globalDebuggerOptions
()
->
sourcePathMap
);
if
(
!
sourcePathMap
.
isEmpty
())
{
const
SourcePathMapIterator
cend
=
sourcePathMap
.
constEnd
();
for
(
SourcePathMapIterator
it
=
sourcePathMap
.
constBegin
();
it
!=
cend
;
++
it
)
{
QByteArray
command
=
"set substitute-path "
;
command
+=
it
.
key
().
toLocal8Bit
();
command
+=
' '
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment