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
a8ae618d
Commit
a8ae618d
authored
Feb 23, 2011
by
hjk
Browse files
toolchain: fix enum naming style
Reviewed-By: Tobias Hunger
parent
3331aea7
Changes
24
Hide whitespace changes
Inline
Side-by-side
src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp
View file @
a8ae618d
...
...
@@ -408,10 +408,10 @@ void CMakeRunPage::initializePage()
foreach
(
ProjectExplorer
::
ToolChain
*
tc
,
tcs
)
{
ProjectExplorer
::
Abi
targetAbi
=
tc
->
targetAbi
();
QVariant
tcVariant
=
qVariantFromValue
(
static_cast
<
void
*>
(
tc
));
if
(
targetAbi
.
os
()
==
ProjectExplorer
::
Abi
::
Windows
)
{
if
(
targetAbi
.
osFlavor
()
==
ProjectExplorer
::
Abi
::
Windows
_m
svc
)
if
(
targetAbi
.
os
()
==
ProjectExplorer
::
Abi
::
Windows
OS
)
{
if
(
targetAbi
.
osFlavor
()
==
ProjectExplorer
::
Abi
::
Windows
M
svc
Flavor
)
m_generatorComboBox
->
addItem
(
tr
(
"NMake Generator (%1)"
).
arg
(
tc
->
displayName
()),
tcVariant
);
else
if
(
targetAbi
.
osFlavor
()
==
ProjectExplorer
::
Abi
::
Windows
_msys
)
else
if
(
targetAbi
.
osFlavor
()
==
ProjectExplorer
::
Abi
::
Windows
MSysFlavor
)
m_generatorComboBox
->
addItem
(
tr
(
"MinGW Generator (%1)"
).
arg
(
tc
->
displayName
()),
tcVariant
);
else
continue
;
...
...
@@ -449,8 +449,8 @@ void CMakeRunPage::runCMake()
CMakeManager
*
cmakeManager
=
m_cmakeWizard
->
cmakeManager
();
QString
generator
=
QLatin1String
(
"-GCodeBlocks - Unix Makefiles"
);
if
(
tc
->
targetAbi
().
os
()
==
ProjectExplorer
::
Abi
::
Windows
)
{
if
(
tc
->
targetAbi
().
osFlavor
()
==
ProjectExplorer
::
Abi
::
Windows
_m
svc
)
if
(
tc
->
targetAbi
().
os
()
==
ProjectExplorer
::
Abi
::
Windows
OS
)
{
if
(
tc
->
targetAbi
().
osFlavor
()
==
ProjectExplorer
::
Abi
::
Windows
M
svc
Flavor
)
generator
=
QLatin1String
(
"-GCodeBlocks - NMake Makefiles"
);
else
generator
=
QLatin1String
(
"-GCodeBlocks - MinGW Makefiles"
);
...
...
src/plugins/debugger/cdb/cdbengine.cpp
View file @
a8ae618d
...
...
@@ -299,7 +299,7 @@ static inline bool validMode(DebuggerStartMode sm)
return
true
;
}
static
inline
QString
msgCdbDisabled
(
const
ProjectExplorer
::
Abi
&
abi
)
static
inline
QString
msgCdbDisabled
(
const
Abi
&
abi
)
{
return
CdbEngine
::
tr
(
"The CDB debug engine required for %1 is currently disabled."
).
arg
(
abi
.
toString
());
...
...
@@ -337,11 +337,11 @@ bool isCdbEngineEnabled()
#endif
}
ConfigurationCheck
checkCdbConfiguration
(
const
ProjectExplorer
::
Abi
&
abi
)
ConfigurationCheck
checkCdbConfiguration
(
const
Abi
&
abi
)
{
ConfigurationCheck
check
;
if
(
abi
.
binaryFormat
()
==
ProjectExplorer
::
Abi
::
Format
_PE
&&
abi
.
osFlavor
()
!=
ProjectExplorer
::
Abi
::
Windows
_msys
)
{
if
(
abi
.
binaryFormat
()
==
Abi
::
PE
Format
&&
abi
.
osFlavor
()
!=
Abi
::
Windows
MSysFlavor
)
{
if
(
!
isCdbEngineEnabled
())
{
check
.
errorMessage
=
msgCdbDisabled
(
abi
);
check
.
settingsPage
=
CdbOptionsPage
::
settingsId
();
...
...
@@ -637,11 +637,11 @@ bool CdbEngine::launchCDB(const DebuggerStartParameters &sp, QString *errorMessa
// 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)
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
_m
svc
,
abi
.
binaryFormat
(),
abi
.
wordWidth
());
Abi
abi
=
sp
.
toolChainAbi
;
if
(
abi
.
osFlavor
()
==
Abi
::
UnknownFlavor
||
abi
.
osFlavor
()
==
Abi
::
WindowsMSysFlavor
)
abi
=
Abi
(
abi
.
architecture
(),
abi
.
os
(),
Abi
::
Windows
M
svc
Flavor
,
abi
.
binaryFormat
(),
abi
.
wordWidth
());
const
QString
executable
=
debuggerCore
()
->
debuggerForAbi
(
abi
);
if
(
executable
.
isEmpty
())
{
*
errorMessage
=
tr
(
"There is no CDB executable specified."
);
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
a8ae618d
...
...
@@ -1354,7 +1354,7 @@ void DebuggerPluginPrivate::startExternalApplication()
// Fixme: 1 of 3 testing hacks.
if
(
sp
.
processArgs
.
startsWith
(
__
(
"@tcf@ "
))
||
sp
.
processArgs
.
startsWith
(
__
(
"@sym@ "
)))
// Set up an ARM Symbian Abi
sp
.
toolChainAbi
=
Abi
(
Abi
::
A
RM
,
Abi
::
Symbian
,
Abi
::
Symbian
_d
evice
,
Abi
::
Format
_ELF
,
false
);
sp
.
toolChainAbi
=
Abi
(
Abi
::
A
rmArchitecture
,
Abi
::
Symbian
OS
,
Abi
::
Symbian
D
evice
Flavor
,
Abi
::
Elf
Format
,
false
);
if
(
dlg
.
breakAtMain
())
{
#ifdef Q_OS_WIN
...
...
@@ -1438,9 +1438,9 @@ void DebuggerPluginPrivate::startRemoteCdbSession()
DebuggerStartParameters
sp
;
Abi
hostAbi
=
Abi
::
hostAbi
();
sp
.
toolChainAbi
=
ProjectExplorer
::
Abi
(
hostAbi
.
architecture
(),
ProjectExplorer
::
Abi
::
Windows
,
ProjectExplorer
::
Abi
::
Windows
_m
svc
,
ProjectExplorer
::
Abi
::
Format
_PE
,
ProjectExplorer
::
Abi
::
Windows
OS
,
ProjectExplorer
::
Abi
::
Windows
M
svc
Flavor
,
ProjectExplorer
::
Abi
::
PE
Format
,
true
);
sp
.
startMode
=
AttachToRemote
;
StartRemoteCdbDialog
dlg
(
mainWindow
());
...
...
src/plugins/debugger/debuggerrunner.cpp
View file @
a8ae618d
...
...
@@ -167,9 +167,9 @@ DebuggerEngineType DebuggerRunControlPrivate::engineForExecutable
// executables.
Abi
hostAbi
=
Abi
::
hostAbi
();
ConfigurationCheck
check
=
checkDebugConfiguration
(
Abi
(
hostAbi
.
architecture
(),
Abi
::
Windows
,
Abi
::
Windows
OS
,
hostAbi
.
osFlavor
(),
Abi
::
Format
_PE
,
Abi
::
PE
Format
,
hostAbi
.
wordWidth
()));
if
(
!
check
)
{
m_errorMessage
=
check
.
errorMessage
;
...
...
@@ -224,16 +224,16 @@ DebuggerEngineType DebuggerRunControlPrivate::engineForMode
static
DebuggerEngineType
engineForToolChain
(
const
Abi
&
toolChain
)
{
switch
(
toolChain
.
binaryFormat
())
{
case
Abi
::
Format
_ELF
:
case
Abi
::
Format
_Mach_O
:
case
Abi
::
Elf
Format
:
case
Abi
::
MachO
Format
:
#ifdef WITH_LLDB
// lldb override
if
(
Core
::
ICore
::
instance
()
->
settings
()
->
value
(
"LLDB/enabled"
).
toBool
())
return
LldbEngineType
;
#endif
return
GdbEngineType
;
case
Abi
::
Format
_PE
:
if
(
toolChain
.
osFlavor
()
==
Abi
::
Windows
_msys
)
case
Abi
::
PE
Format
:
if
(
toolChain
.
osFlavor
()
==
Abi
::
Windows
MSysFlavor
)
return
GdbEngineType
;
return
CdbEngineType
;
default:
...
...
@@ -385,9 +385,9 @@ ConfigurationCheck checkDebugConfiguration(const Abi &abi)
if
(
!
(
debuggerCore
()
->
activeLanguages
()
&
CppLanguage
))
return
result
;
if
(
abi
.
binaryFormat
()
==
Abi
::
Format
_ELF
||
abi
.
binaryFormat
()
==
Abi
::
Format
_Mach_O
||
(
abi
.
binaryFormat
()
==
Abi
::
Format
_PE
&&
abi
.
osFlavor
()
==
Abi
::
Windows
_msys
))
{
if
(
abi
.
binaryFormat
()
==
Abi
::
Elf
Format
||
abi
.
binaryFormat
()
==
Abi
::
MachO
Format
||
(
abi
.
binaryFormat
()
==
Abi
::
PE
Format
&&
abi
.
osFlavor
()
==
Abi
::
Windows
MSysFlavor
))
{
if
(
debuggerCore
()
->
debuggerForAbi
(
abi
).
isEmpty
())
{
result
.
errorMessage
=
msgNoBinaryForToolChain
(
abi
);
if
(
!
result
.
errorMessage
.
isEmpty
())
...
...
@@ -395,8 +395,8 @@ ConfigurationCheck checkDebugConfiguration(const Abi &abi)
result
.
errorMessage
+=
QLatin1Char
(
' '
)
+
msgEngineNotAvailable
(
"Gdb"
);
result
.
settingsPage
=
_
(
Constants
::
DEBUGGER_COMMON_SETTINGS_ID
);
}
}
else
if
(
abi
.
binaryFormat
()
==
Abi
::
Format
_PE
&&
abi
.
osFlavor
()
!=
Abi
::
Windows
_msys
)
{
}
else
if
(
abi
.
binaryFormat
()
==
Abi
::
PE
Format
&&
abi
.
osFlavor
()
!=
Abi
::
Windows
MSysFlavor
)
{
result
=
checkCdbConfiguration
(
abi
);
if
(
!
result
)
{
if
(
!
result
.
errorMessage
.
isEmpty
())
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
a8ae618d
...
...
@@ -102,6 +102,8 @@
#endif
#include
<ctype.h>
using
namespace
ProjectExplorer
;
namespace
Debugger
{
namespace
Internal
{
...
...
@@ -1805,7 +1807,7 @@ QString msgNoBinaryForToolChain(const ProjectExplorer::Abi &tc)
AbstractGdbAdapter
*
GdbEngine
::
createAdapter
()
{
const
DebuggerStartParameters
&
sp
=
startParameters
();
if
(
sp
.
toolChainAbi
.
os
()
==
ProjectExplorer
::
Abi
::
Symbian
)
{
if
(
sp
.
toolChainAbi
.
os
()
==
ProjectExplorer
::
Abi
::
Symbian
OS
)
{
// FIXME: 1 of 3 testing hacks.
if
(
sp
.
debugClient
==
DebuggerStartParameters
::
DebugClientCoda
)
return
new
CodaGdbAdapter
(
this
);
...
...
@@ -4208,13 +4210,14 @@ 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
)
{
// 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
());
// We want the MinGW gdb also in case we got started using
// some compatible ABI.
Abi
abi
=
startParameters
().
toolChainAbi
;
if
(
abi
.
os
()
==
Abi
::
WindowsOS
)
{
if
(
abi
.
osFlavor
()
==
Abi
::
UnknownFlavor
||
abi
.
osFlavor
()
==
Abi
::
WindowsMsvcFlavor
)
abi
=
Abi
(
abi
.
architecture
(),
abi
.
os
(),
Abi
::
WindowsMSysFlavor
,
abi
.
binaryFormat
(),
abi
.
wordWidth
());
}
m_gdb
=
debuggerCore
()
->
debuggerForAbi
(
abi
);
}
...
...
src/plugins/debugger/gdb/remotegdbserveradapter.cpp
View file @
a8ae618d
...
...
@@ -77,9 +77,9 @@ RemoteGdbServerAdapter::RemoteGdbServerAdapter(GdbEngine *engine,
AbstractGdbAdapter
::
DumperHandling
RemoteGdbServerAdapter
::
dumperHandling
()
const
{
if
(
m_abi
.
os
()
==
ProjectExplorer
::
Abi
::
Symbian
||
m_abi
.
os
()
==
ProjectExplorer
::
Abi
::
Windows
||
m_abi
.
binaryFormat
()
==
ProjectExplorer
::
Abi
::
Format
_ELF
)
if
(
m_abi
.
os
()
==
ProjectExplorer
::
Abi
::
Symbian
OS
||
m_abi
.
os
()
==
ProjectExplorer
::
Abi
::
Windows
OS
||
m_abi
.
binaryFormat
()
==
ProjectExplorer
::
Abi
::
Elf
Format
)
return
DumperLoadedByGdb
;
return
DumperLoadedByGdbPreload
;
}
...
...
src/plugins/projectexplorer/abi.cpp
View file @
a8ae618d
...
...
@@ -42,113 +42,113 @@
namespace
ProjectExplorer
{
Abi
::
Abi
(
const
Architecture
&
a
,
const
OS
&
o
,
const
OSFlavo
u
r
&
of
,
const
BinaryFormat
&
f
,
unsigned
char
w
)
:
const
OSFlavor
&
of
,
const
BinaryFormat
&
f
,
unsigned
char
w
)
:
m_architecture
(
a
),
m_os
(
o
),
m_osFlavor
(
of
),
m_binaryFormat
(
f
),
m_wordWidth
(
w
)
{
switch
(
m_os
)
{
case
ProjectExplorer
::
Abi
::
U
NKNOWN_
OS
:
m_osFlavor
=
U
NKNOWN_OSFLAVOUR
;
case
ProjectExplorer
::
Abi
::
U
nknown
OS
:
m_osFlavor
=
U
nknownFlavor
;
break
;
case
ProjectExplorer
::
Abi
::
Linux
:
if
(
m_osFlavor
<
Linux_generic
||
m_osFlavor
>
Linux_meego
)
m_osFlavor
=
U
NKNOWN_OSFLAVOUR
;
case
ProjectExplorer
::
Abi
::
Linux
OS
:
if
(
m_osFlavor
<
GenericLinuxFlavor
||
m_osFlavor
>
MeegoLinuxFlavor
)
m_osFlavor
=
U
nknownFlavor
;
break
;
case
ProjectExplorer
::
Abi
::
Mac
:
if
(
m_osFlavor
<
Mac_g
eneric
||
m_osFlavor
>
Mac_g
eneric
)
m_osFlavor
=
U
NKNOWN_OSFLAVOUR
;
case
ProjectExplorer
::
Abi
::
Mac
OS
:
if
(
m_osFlavor
<
G
eneric
MacFlavor
||
m_osFlavor
>
G
eneric
MacFlavor
)
m_osFlavor
=
U
nknownFlavor
;
break
;
case
ProjectExplorer
::
Abi
::
Symbian
:
if
(
m_osFlavor
<
Symbian
_d
evice
||
m_osFlavor
>
Symbian
_e
mulator
)
m_osFlavor
=
U
NKNOWN_OSFLAVOUR
;
case
ProjectExplorer
::
Abi
::
Symbian
OS
:
if
(
m_osFlavor
<
Symbian
D
evice
Flavor
||
m_osFlavor
>
Symbian
E
mulator
Flavor
)
m_osFlavor
=
U
nknownFlavor
;
break
;
case
ProjectExplorer
::
Abi
::
U
NIX
:
if
(
m_osFlavor
<
Unix_generic
||
m_osFlavor
>
Unix_generic
)
m_osFlavor
=
U
NKNOWN_OSFLAVOUR
;
case
ProjectExplorer
::
Abi
::
U
nixOS
:
if
(
m_osFlavor
<
GenericUnixFlavor
||
m_osFlavor
>
GenericUnixFlavor
)
m_osFlavor
=
U
nknownFlavor
;
break
;
case
ProjectExplorer
::
Abi
::
Windows
:
if
(
m_osFlavor
<
Windows
_m
svc
||
m_osFlavor
>
Windows
_ce
)
m_osFlavor
=
U
NKNOWN_OSFLAVOUR
;
case
ProjectExplorer
::
Abi
::
Windows
OS
:
if
(
m_osFlavor
<
Windows
M
svc
Flavor
||
m_osFlavor
>
Windows
CEFlavor
)
m_osFlavor
=
U
nknownFlavor
;
break
;
}
}
Abi
::
Abi
(
const
QString
&
abiString
)
:
m_architecture
(
U
NKNOWN_ARCHITECTURE
),
m_os
(
U
NKNOWN_
OS
),
m_osFlavor
(
U
NKNOWN_OSFLAVOUR
),
m_binaryFormat
(
U
NKNOWN_FORMAT
),
m_wordWidth
(
0
)
m_architecture
(
U
nknownArchitecture
),
m_os
(
U
nknown
OS
),
m_osFlavor
(
U
nknownFlavor
),
m_binaryFormat
(
U
nknownFormat
),
m_wordWidth
(
0
)
{
QStringList
abiParts
=
abiString
.
split
(
QLatin1Char
(
'-'
));
if
(
abiParts
.
count
()
>=
1
)
{
if
(
abiParts
.
at
(
0
)
==
QLatin1String
(
"unknown"
))
m_architecture
=
U
NKNOWN_ARCHITECTURE
;
m_architecture
=
U
nknownArchitecture
;
else
if
(
abiParts
.
at
(
0
)
==
QLatin1String
(
"arm"
))
m_architecture
=
A
RM
;
m_architecture
=
A
rmArchitecture
;
else
if
(
abiParts
.
at
(
0
)
==
QLatin1String
(
"x86"
))
m_architecture
=
x
86
;
m_architecture
=
X
86
Architecture
;
else
if
(
abiParts
.
at
(
0
)
==
QLatin1String
(
"mips"
))
m_architecture
=
Mips
;
m_architecture
=
Mips
Arcitecture
;
else
if
(
abiParts
.
at
(
0
)
==
QLatin1String
(
"ppc"
))
m_architecture
=
PowerPC
;
m_architecture
=
PowerPC
Architecture
;
else
if
(
abiParts
.
at
(
0
)
==
QLatin1String
(
"itanium"
))
m_architecture
=
Itanium
;
m_architecture
=
Itanium
Architecture
;
else
return
;
}
if
(
abiParts
.
count
()
>=
2
)
{
if
(
abiParts
.
at
(
1
)
==
QLatin1String
(
"unknown"
))
m_os
=
U
NKNOWN_
OS
;
m_os
=
U
nknown
OS
;
else
if
(
abiParts
.
at
(
1
)
==
QLatin1String
(
"linux"
))
m_os
=
Linux
;
m_os
=
Linux
OS
;
else
if
(
abiParts
.
at
(
1
)
==
QLatin1String
(
"macos"
))
m_os
=
Mac
;
m_os
=
Mac
OS
;
else
if
(
abiParts
.
at
(
1
)
==
QLatin1String
(
"symbian"
))
m_os
=
Symbian
;
m_os
=
Symbian
OS
;
else
if
(
abiParts
.
at
(
1
)
==
QLatin1String
(
"unix"
))
m_os
=
U
NIX
;
m_os
=
U
nixOS
;
else
if
(
abiParts
.
at
(
1
)
==
QLatin1String
(
"windows"
))
m_os
=
Windows
;
m_os
=
Windows
OS
;
else
return
;
}
if
(
abiParts
.
count
()
>=
3
)
{
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"unknown"
))
m_osFlavor
=
U
NKNOWN_OSFLAVOUR
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"generic"
)
&&
m_os
==
Linux
)
m_osFlavor
=
Linux_generic
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"maemo"
)
&&
m_os
==
Linux
)
m_osFlavor
=
Linux_maemo
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"meego"
)
&&
m_os
==
Linux
)
m_osFlavor
=
Linux_meego
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"generic"
)
&&
m_os
==
Mac
)
m_osFlavor
=
Mac_g
eneric
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"device"
)
&&
m_os
==
Symbian
)
m_osFlavor
=
Symbian
_d
evice
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"emulator"
)
&&
m_os
==
Symbian
)
m_osFlavor
=
Symbian
_e
mulator
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"generic"
)
&&
m_os
==
U
NIX
)
m_osFlavor
=
Unix_generic
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"msvc"
)
&&
m_os
==
Windows
)
m_osFlavor
=
Windows
_m
svc
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"msys"
)
&&
m_os
==
Windows
)
m_osFlavor
=
Windows
_msys
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"ce"
)
&&
m_os
==
Windows
)
m_osFlavor
=
Windows
_ce
;
m_osFlavor
=
U
nknownFlavor
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"generic"
)
&&
m_os
==
Linux
OS
)
m_osFlavor
=
GenericLinuxFlavor
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"maemo"
)
&&
m_os
==
Linux
OS
)
m_osFlavor
=
MaemoLinuxFlavor
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"meego"
)
&&
m_os
==
Linux
OS
)
m_osFlavor
=
MeegoLinuxFlavor
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"generic"
)
&&
m_os
==
Mac
OS
)
m_osFlavor
=
G
eneric
MacFlavor
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"device"
)
&&
m_os
==
Symbian
OS
)
m_osFlavor
=
Symbian
D
evice
Flavor
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"emulator"
)
&&
m_os
==
Symbian
OS
)
m_osFlavor
=
Symbian
E
mulator
Flavor
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"generic"
)
&&
m_os
==
U
nixOS
)
m_osFlavor
=
GenericUnixFlavor
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"msvc"
)
&&
m_os
==
Windows
OS
)
m_osFlavor
=
Windows
M
svc
Flavor
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"msys"
)
&&
m_os
==
Windows
OS
)
m_osFlavor
=
Windows
MSysFlavor
;
else
if
(
abiParts
.
at
(
2
)
==
QLatin1String
(
"ce"
)
&&
m_os
==
Windows
OS
)
m_osFlavor
=
Windows
CEFlavor
;
else
return
;
}
if
(
abiParts
.
count
()
>=
4
)
{
if
(
abiParts
.
at
(
3
)
==
QLatin1String
(
"unknown"
))
m_binaryFormat
=
U
NKNOWN_FORMAT
;
m_binaryFormat
=
U
nknownFormat
;
else
if
(
abiParts
.
at
(
3
)
==
QLatin1String
(
"elf"
))
m_binaryFormat
=
Format
_ELF
;
m_binaryFormat
=
Elf
Format
;
else
if
(
abiParts
.
at
(
3
)
==
QLatin1String
(
"pe"
))
m_binaryFormat
=
Format
_PE
;
m_binaryFormat
=
PE
Format
;
else
if
(
abiParts
.
at
(
3
)
==
QLatin1String
(
"mach_o"
))
m_binaryFormat
=
Format
_Mach_O
;
m_binaryFormat
=
MachO
Format
;
else
if
(
abiParts
.
at
(
3
)
==
QLatin1String
(
"qml_rt"
))
m_binaryFormat
=
Format_Runtime_QML
;
m_binaryFormat
=
RuntimeQmlFormat
;
else
return
;
}
...
...
@@ -191,36 +191,36 @@ bool Abi::operator == (const Abi &other) const
bool
Abi
::
isCompatibleWith
(
const
Abi
&
other
)
const
{
return
(
architecture
()
==
other
.
architecture
()
||
other
.
architecture
()
==
Abi
::
U
NKNOWN_ARCHITECTURE
)
&&
(
os
()
==
other
.
os
()
||
other
.
os
()
==
Abi
::
U
NKNOWN_
OS
)
&&
(
osFlavor
()
==
other
.
osFlavor
()
||
other
.
osFlavor
()
==
Abi
::
U
NKNOWN_OSFLAVOUR
)
&&
(
binaryFormat
()
==
other
.
binaryFormat
()
||
other
.
binaryFormat
()
==
Abi
::
U
NKNOWN_FORMAT
)
return
(
architecture
()
==
other
.
architecture
()
||
other
.
architecture
()
==
Abi
::
U
nknownArchitecture
)
&&
(
os
()
==
other
.
os
()
||
other
.
os
()
==
Abi
::
U
nknown
OS
)
&&
(
osFlavor
()
==
other
.
osFlavor
()
||
other
.
osFlavor
()
==
Abi
::
U
nknownFlavor
)
&&
(
binaryFormat
()
==
other
.
binaryFormat
()
||
other
.
binaryFormat
()
==
Abi
::
U
nknownFormat
)
&&
((
wordWidth
()
==
other
.
wordWidth
()
&&
wordWidth
()
!=
0
)
||
other
.
wordWidth
()
==
0
);
}
bool
Abi
::
isValid
()
const
{
return
m_architecture
!=
U
NKNOWN_ARCHITECTURE
&&
m_os
!=
U
NKNOWN_
OS
&&
m_osFlavor
!=
U
NKNOWN_OSFLAVOUR
&&
m_binaryFormat
!=
U
NKNOWN_FORMAT
return
m_architecture
!=
U
nknownArchitecture
&&
m_os
!=
U
nknown
OS
&&
m_osFlavor
!=
U
nknownFlavor
&&
m_binaryFormat
!=
U
nknownFormat
&&
m_wordWidth
!=
0
;
}
QString
Abi
::
toString
(
const
Architecture
&
a
)
{
switch
(
a
)
{
case
A
RM
:
case
A
rmArchitecture
:
return
QLatin1String
(
"arm"
);
case
x
86
:
case
X
86
Architecture
:
return
QLatin1String
(
"x86"
);
case
Mips
:
case
Mips
Arcitecture
:
return
QLatin1String
(
"mips"
);
case
PowerPC
:
case
PowerPC
Architecture
:
return
QLatin1String
(
"ppc"
);
case
Itanium
:
case
Itanium
Architecture
:
return
QLatin1String
(
"itanium"
);
case
U
NKNOWN_ARCHITECTURE
:
// fall through!
case
U
nknownArchitecture
:
// fall through!
default:
return
QLatin1String
(
"unknown"
);
}
...
...
@@ -229,48 +229,48 @@ QString Abi::toString(const Architecture &a)
QString
Abi
::
toString
(
const
OS
&
o
)
{
switch
(
o
)
{
case
Linux
:
case
Linux
OS
:
return
QLatin1String
(
"linux"
);
case
Mac
:
case
Mac
OS
:
return
QLatin1String
(
"macos"
);
case
Symbian
:
case
Symbian
OS
:
return
QLatin1String
(
"symbian"
);
case
U
NIX
:
case
U
nixOS
:
return
QLatin1String
(
"unix"
);
case
Windows
:
case
Windows
OS
:
return
QLatin1String
(
"windows"
);
case
U
NKNOWN_
OS
:
// fall through!
case
U
nknown
OS
:
// fall through!
default:
return
QLatin1String
(
"unknown"
);
};
}
QString
Abi
::
toString
(
const
OSFlavo
u
r
&
of
)
QString
Abi
::
toString
(
const
OSFlavor
&
of
)
{
switch
(
of
)
{
case
ProjectExplorer
::
Abi
::
Linux_generic
:
case
ProjectExplorer
::
Abi
::
GenericLinuxFlavor
:
return
QLatin1String
(
"generic"
);
case
ProjectExplorer
::
Abi
::
Linux_maemo
:
case
ProjectExplorer
::
Abi
::
MaemoLinuxFlavor
:
return
QLatin1String
(
"maemo"
);
case
ProjectExplorer
::
Abi
::
Linux_h
armattan
:
case
ProjectExplorer
::
Abi
::
H
armattan
LinuxFlavor
:
return
QLatin1String
(
"harmattan"
);
case
ProjectExplorer
::
Abi
::
Linux_meego
:
case
ProjectExplorer
::
Abi
::
MeegoLinuxFlavor
:
return
QLatin1String
(
"meego"
);
case
ProjectExplorer
::
Abi
::
Mac_g
eneric
:
case
ProjectExplorer
::
Abi
::
G
eneric
MacFlavor
:
return
QLatin1String
(
"generic"
);
case
ProjectExplorer
::
Abi
::
Symbian
_d
evice
:
case
ProjectExplorer
::
Abi
::
Symbian
D
evice
Flavor
:
return
QLatin1String
(
"device"
);
case
ProjectExplorer
::
Abi
::
Symbian
_e
mulator
:
case
ProjectExplorer
::
Abi
::
Symbian
E
mulator
Flavor
:
return
QLatin1String
(
"emulator"
);
case
ProjectExplorer
::
Abi
::
Unix_generic
:
case
ProjectExplorer
::
Abi
::
GenericUnixFlavor
:
return
QLatin1String
(
"generic"
);
case
ProjectExplorer
::
Abi
::
Windows
_m
svc
:
case
ProjectExplorer
::
Abi
::
Windows
M
svc
Flavor
:
return
QLatin1String
(
"msvc"
);
case
ProjectExplorer
::
Abi
::
Windows
_msys
:
case
ProjectExplorer
::
Abi
::
Windows
MSysFlavor
:
return
QLatin1String
(
"msys"
);
case
ProjectExplorer
::
Abi
::
Windows
_ce
:
case
ProjectExplorer
::
Abi
::
Windows
CEFlavor
:
return
QLatin1String
(
"ce"
);
case
ProjectExplorer
::
Abi
::
U
NKNOWN_OSFLAVOUR
:
// fall throught!
case
ProjectExplorer
::
Abi
::
U
nknownFlavor
:
// fall throught!
default:
return
QLatin1String
(
"unknown"
);
}
...
...
@@ -279,15 +279,15 @@ QString Abi::toString(const OSFlavour &of)
QString
Abi
::
toString
(
const
BinaryFormat
&
bf
)
{
switch
(
bf
)
{
case
Format
_ELF
:
case
Elf
Format
:
return
QLatin1String
(
"elf"
);
case
Format
_PE
:
case
PE
Format
:
return
QLatin1String
(
"pe"
);
case
Format
_Mach_O
:
case
MachO
Format
:
return
QLatin1String
(
"mach_o"
);
case
Format_Runtime_QML
:
case
RuntimeQmlFormat
:
return
QLatin1String
(
"qml_rt"
);
case
U
NKNOWN_FORMAT
:
// fall through!
case
U
nknownFormat
:
// fall through!
default:
return
QLatin1String
(
"unknown"
);
}
...
...
@@ -304,22 +304,22 @@ QString Abi::toString(int w)
Abi
Abi
::
hostAbi
()
{
Architecture
arch
=
QTC_CPU
;
// define set by qmake
OS
os
=
U
NKNOWN_
OS
;
OSFlavo
u
r
subos
=
U
NKNOWN_OSFLAVOUR
;
BinaryFormat
format
=
U
NKNOWN_FORMAT
;
OS
os
=
U
nknown
OS
;
OSFlavor
subos
=
U
nknownFlavor
;
BinaryFormat
format
=
U
nknownFormat
;
#if defined (Q_OS_WIN)
os
=
Windows
;
subos
=
Windows
_m
svc
;
format
=
Format
_PE
;
os
=
Windows
OS
;
subos
=
Windows
M
svc
Flavor
;
format
=
PE
Format
;
#elif defined (Q_OS_LINUX)
os
=
Linux
;
subos
=
Linux_generic
;
format
=
Format
_ELF
;
os
=
Linux
OS
;
subos
=
GenericLinuxFlavor
;
format
=
Elf
Format
;
#elif defined (Q_OS_MAC)
os
=
Mac
;
subos
=
Mac_g
eneric
;
format
=
Format
_Mach_O
;
os
=
Mac
OS
;
subos
=
G
eneric
MacFlavor
;
format
=
MachO
Format
;
#endif
return
Abi
(
arch
,
os
,
subos
,
format
,
QSysInfo
::
WordSize
);
...
...
@@ -328,15 +328,15 @@ Abi Abi::hostAbi()
static
Abi
macAbiForCpu
(
quint32
type
)
{
switch
(
type
)
{
case
7
:
// CPU_TYPE_X86, CPU_TYPE_I386
return
Abi
(
Abi
::
x
86
,
Abi
::
Mac
,
Abi
::
Mac_g
eneric
,
Abi
::
Format
_Mach_O
,
32
);
return
Abi
(
Abi
::
X
86
Architecture
,
Abi
::
Mac
OS
,
Abi
::
G
eneric
MacFlavor
,
Abi
::
MachO
Format
,
32
);
case
0x01000000
+
7
:
// CPU_TYPE_X86_64
return
Abi
(
Abi
::
x
86
,
Abi
::
Mac
,
Abi
::
Mac_g
eneric
,
Abi
::
Format
_Mach_O
,
64
);
return
Abi
(
Abi
::
X
86
Architecture
,
Abi
::
Mac
OS
,
Abi
::
G
eneric
MacFlavor
,
Abi
::
MachO
Format
,
64
);
case
18
:
// CPU_TYPE_POWERPC
return
Abi
(
Abi
::
PowerPC
,
Abi
::
Mac
,
Abi
::
Mac_g
eneric
,
Abi
::
Format
_Mach_O
,
32
);
return
Abi
(
Abi
::
PowerPC
Architecture
,
Abi
::
Mac
OS
,
Abi
::
G
eneric
MacFlavor
,
Abi
::
MachO
Format
,
32
);
case
0x01000000
+
18
:
// CPU_TYPE_POWERPC64
return
Abi
(
Abi
::
PowerPC
,
Abi
::
Mac
,
Abi
::
Mac_g
eneric
,
Abi
::
Format
_Mach_O
,
32
);
return
Abi
(
Abi
::
PowerPC
Architecture
,
Abi
::
Mac
OS
,
Abi
::
G
eneric
MacFlavor
,
Abi
::
MachO
Format
,
32
);
case
12
:
// CPU_TYPE_ARM
return
Abi
(
Abi
::
A
RM
,
Abi
::
Mac
,
Abi
::
Mac_g
eneric
,
Abi
::
Format
_Mach_O
,
32
);
return
Abi
(
Abi
::
A
rmArchitecture
,
Abi
::
Mac
OS
,
Abi
::
G
eneric
MacFlavor
,
Abi
::
MachO
Format
,
32
);
default:
return
Abi
();
}
...
...
@@ -363,22 +363,22 @@ QList<Abi> Abi::abisOfBinary(const QString &path)
quint16
machine
=
(
data
.
at
(
19
)
<<
8
)
+
data
.
at
(
18
);
switch
(
machine
)
{
case
3
:
// EM_386
result
.
append
(
Abi
(
Abi
::
x
86
,
Abi
::
Linux
,
Abi
::
Linux_generic
,
Abi
::
Format
_ELF
,
32
));
result
.
append
(
Abi
(
Abi
::
X
86
Architecture
,
Abi
::
Linux
OS
,
Abi
::
GenericLinuxFlavor
,
Abi
::
Elf
Format
,
32
));