Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
fa6fbcc8
Commit
fa6fbcc8
authored
Feb 23, 2011
by
Friedemann Kleint
Browse files
Debugger: Choose right binary for CDB/gdb.
parent
e95bda96
Changes
3
Show whitespace changes
Inline
Side-by-side
src/plugins/debugger/cdb/cdbengine.cpp
View file @
fa6fbcc8
...
...
@@ -634,10 +634,15 @@ bool CdbEngine::launchCDB(const DebuggerStartParameters &sp, QString *errorMessa
qDebug
(
"launchCDB startMode=%d"
,
sp
.
startMode
);
const
QChar
blank
(
QLatin1Char
(
' '
));
// Start engine which will run until initial breakpoint:
// Determine extension lib name and path to use
// Determine
binary (force MSVC),
extension lib name and path to use
// The extension is passed as relative name with the path variable set
//(does not work with absolute path names)
const
QString
executable
=
debuggerCore
()
->
debuggerForAbi
(
sp
.
toolChainAbi
);
ProjectExplorer
::
Abi
abi
=
sp
.
toolChainAbi
;
if
(
abi
.
osFlavor
()
==
ProjectExplorer
::
Abi
::
UNKNOWN_OSFLAVOUR
||
abi
.
osFlavor
()
==
ProjectExplorer
::
Abi
::
Windows_msys
)
abi
=
ProjectExplorer
::
Abi
(
abi
.
architecture
(),
abi
.
os
(),
ProjectExplorer
::
Abi
::
Windows_msvc
,
abi
.
binaryFormat
(),
abi
.
wordWidth
());
const
QString
executable
=
debuggerCore
()
->
debuggerForAbi
(
abi
);
if
(
executable
.
isEmpty
())
{
*
errorMessage
=
tr
(
"There is no CDB executable specified."
);
return
false
;
...
...
src/plugins/debugger/debuggerrunner.cpp
View file @
fa6fbcc8
...
...
@@ -222,16 +222,21 @@ DebuggerEngineType DebuggerRunControlPrivate::engineForMode
static
DebuggerEngineType
engineForToolChain
(
const
Abi
&
toolChain
)
{
if
(
toolChain
.
binaryFormat
()
==
Abi
::
Format_ELF
||
toolChain
.
binaryFormat
()
==
Abi
::
Format_Mach_O
||
(
toolChain
.
binaryFormat
()
==
Abi
::
Format_PE
&&
toolChain
.
osFlavor
()
==
Abi
::
Windows_msys
))
{
switch
(
toolChain
.
binaryFormat
())
{
case
Abi
::
Format_ELF
:
case
Abi
::
Format_Mach_O
:
#ifdef WITH_LLDB
// lldb override
if
(
Core
::
ICore
::
instance
()
->
settings
()
->
value
(
"LLDB/enabled"
).
toBool
())
return
LldbEngineType
;
#endif
return
GdbEngineType
;
}
else
if
(
toolChain
.
binaryFormat
()
==
Abi
::
Format_PE
&&
toolChain
.
osFlavor
()
!=
Abi
::
Windows_msys
)
{
case
Abi
::
Format_PE
:
if
(
toolChain
.
osFlavor
()
==
Abi
::
Windows_msys
)
return
GdbEngineType
;
return
CdbEngineType
;
default:
break
;
}
return
NoEngineType
;
}
...
...
@@ -280,9 +285,10 @@ DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration,
if
(
sp
.
processArgs
.
startsWith
(
__
(
"@tcf@ "
)))
engineType
=
GdbEngineType
;
if
(
engineType
==
NoEngineType
&&
sp
.
startMode
!=
AttachToRemote
&&
!
sp
.
executable
.
isEmpty
())
// Override CDB by gdb if no PDB sections are found in executable
// (pending proper MinGW/MSys detection).
if
((
engineType
==
NoEngineType
||
engineType
==
CdbEngineType
)
&&
sp
.
startMode
!=
AttachToRemote
&&
!
sp
.
executable
.
isEmpty
())
engineType
=
d
->
engineForExecutable
(
enabledEngineTypes
,
sp
.
executable
);
if
(
engineType
==
NoEngineType
)
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
fa6fbcc8
...
...
@@ -4207,8 +4207,17 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb,
const
DebuggerStartParameters
&
sp
=
startParameters
();
m_gdb
=
QString
::
fromLocal8Bit
(
qgetenv
(
"QTC_DEBUGGER_PATH"
));
if
(
m_gdb
.
isEmpty
()
&&
sp
.
startMode
!=
StartRemoteGdb
)
m_gdb
=
debuggerCore
()
->
debuggerForAbi
(
startParameters
().
toolChainAbi
);
if
(
m_gdb
.
isEmpty
()
&&
sp
.
startMode
!=
StartRemoteGdb
)
{
// We want the MinGW gdb also in case we got started using some compatible ABI.
ProjectExplorer
::
Abi
abi
=
startParameters
().
toolChainAbi
;
if
(
abi
.
os
()
==
ProjectExplorer
::
Abi
::
Windows
)
{
if
(
abi
.
osFlavor
()
==
ProjectExplorer
::
Abi
::
UNKNOWN_OSFLAVOUR
||
abi
.
osFlavor
()
==
ProjectExplorer
::
Abi
::
Windows_msvc
)
abi
=
ProjectExplorer
::
Abi
(
abi
.
architecture
(),
abi
.
os
(),
ProjectExplorer
::
Abi
::
Windows_msys
,
abi
.
binaryFormat
(),
abi
.
wordWidth
());
}
m_gdb
=
debuggerCore
()
->
debuggerForAbi
(
abi
);
}
if
(
m_gdb
.
isEmpty
())
m_gdb
=
gdb
;
if
(
m_gdb
.
isEmpty
())
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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