Skip to content

Commit 61f80b7

Browse files
author
stgatilov
committed
#6280. Added "Sanitize" configuration with Address Sanitizer turned on.
Debug Fast is used as a basis for it: it is as slow as release, but improves debugging experience. Also note that I defined _DISABLE_VECTOR_ANNOTATION to avoid checks for std::vector elements access in [size()..capacity()) range. This check requires all third-party dependencies to be rebuilt with ASAN, which is a nuisance, and we should not use much STL anyway. git-svn-id: http://svn.thedarkmod.com/svn/darkmod_src/trunk@10352 49c82d7f-2e2a-0410-a16f-ae8f201b507f
1 parent d1fee28 commit 61f80b7

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed

TheDarkMod.sln

+8
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Global
2727
Debug|x64 = Debug|x64
2828
Release|Win32 = Release|Win32
2929
Release|x64 = Release|x64
30+
Sanitize|Win32 = Sanitize|Win32
31+
Sanitize|x64 = Sanitize|x64
3032
EndGlobalSection
3133
GlobalSection(ProjectConfigurationPlatforms) = postSolution
3234
{49BEC5C6-B964-417A-851E-808886B574F1}.Debug Editable|Win32.ActiveCfg = Debug|Win32
@@ -37,6 +39,8 @@ Global
3739
{49BEC5C6-B964-417A-851E-808886B574F1}.Debug|x64.ActiveCfg = Debug|x64
3840
{49BEC5C6-B964-417A-851E-808886B574F1}.Release|Win32.ActiveCfg = Release|Win32
3941
{49BEC5C6-B964-417A-851E-808886B574F1}.Release|x64.ActiveCfg = Release|x64
42+
{49BEC5C6-B964-417A-851E-808886B574F1}.Sanitize|Win32.ActiveCfg = Release|Win32
43+
{49BEC5C6-B964-417A-851E-808886B574F1}.Sanitize|x64.ActiveCfg = Release|x64
4044
{49BEC5C6-B964-417A-851E-808886B57420}.Debug Editable|Win32.ActiveCfg = Debug Editable|Win32
4145
{49BEC5C6-B964-417A-851E-808886B57420}.Debug Editable|Win32.Build.0 = Debug Editable|Win32
4246
{49BEC5C6-B964-417A-851E-808886B57420}.Debug Editable|x64.ActiveCfg = Debug Editable|x64
@@ -53,6 +57,10 @@ Global
5357
{49BEC5C6-B964-417A-851E-808886B57420}.Release|Win32.Build.0 = Release|Win32
5458
{49BEC5C6-B964-417A-851E-808886B57420}.Release|x64.ActiveCfg = Release|x64
5559
{49BEC5C6-B964-417A-851E-808886B57420}.Release|x64.Build.0 = Release|x64
60+
{49BEC5C6-B964-417A-851E-808886B57420}.Sanitize|Win32.ActiveCfg = Sanitize|Win32
61+
{49BEC5C6-B964-417A-851E-808886B57420}.Sanitize|Win32.Build.0 = Sanitize|Win32
62+
{49BEC5C6-B964-417A-851E-808886B57420}.Sanitize|x64.ActiveCfg = Sanitize|x64
63+
{49BEC5C6-B964-417A-851E-808886B57420}.Sanitize|x64.Build.0 = Sanitize|x64
5664
EndGlobalSection
5765
GlobalSection(SolutionProperties) = preSolution
5866
HideSolutionNode = FALSE

engine.vcxproj

+42
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@
3333
<Configuration>Release</Configuration>
3434
<Platform>x64</Platform>
3535
</ProjectConfiguration>
36+
<ProjectConfiguration Include="Sanitize|Win32">
37+
<Configuration>Sanitize</Configuration>
38+
<Platform>Win32</Platform>
39+
</ProjectConfiguration>
40+
<ProjectConfiguration Include="Sanitize|x64">
41+
<Configuration>Sanitize</Configuration>
42+
<Platform>x64</Platform>
43+
</ProjectConfiguration>
3644
</ItemGroup>
3745
<PropertyGroup Label="Globals">
3846
<ProjectName>DarkModTools</ProjectName>
@@ -60,6 +68,12 @@
6068
<CharacterSet>MultiByte</CharacterSet>
6169
<PlatformToolset>v143</PlatformToolset>
6270
</PropertyGroup>
71+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Sanitize|Win32'" Label="Configuration">
72+
<ConfigurationType>Application</ConfigurationType>
73+
<UseOfMfc>Static</UseOfMfc>
74+
<CharacterSet>MultiByte</CharacterSet>
75+
<PlatformToolset>v143</PlatformToolset>
76+
</PropertyGroup>
6377
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Editable|x64'" Label="Configuration">
6478
<ConfigurationType>Application</ConfigurationType>
6579
<UseOfMfc>Static</UseOfMfc>
@@ -72,6 +86,12 @@
7286
<CharacterSet>MultiByte</CharacterSet>
7387
<PlatformToolset>v143</PlatformToolset>
7488
</PropertyGroup>
89+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Sanitize|x64'" Label="Configuration">
90+
<ConfigurationType>Application</ConfigurationType>
91+
<UseOfMfc>Static</UseOfMfc>
92+
<CharacterSet>MultiByte</CharacterSet>
93+
<PlatformToolset>v143</PlatformToolset>
94+
</PropertyGroup>
7595
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
7696
<ConfigurationType>Application</ConfigurationType>
7797
<UseOfMfc>Static</UseOfMfc>
@@ -113,6 +133,14 @@
113133
<Import Project="$(SolutionDir)/sys/msvc/properties/_DoomDLL.props" />
114134
<Import Project="sys\msvc\properties\_DebugFast.props" />
115135
</ImportGroup>
136+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Sanitize|Win32'" Label="PropertySheets">
137+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
138+
<Import Project="$(SolutionDir)/sys/msvc/properties/_Common.props" />
139+
<Import Project="sys\msvc\properties\Common_x86.props" />
140+
<Import Project="$(SolutionDir)/sys/msvc/properties/_DoomDLL.props" />
141+
<Import Project="sys\msvc\properties\_DebugFast.props" />
142+
<Import Project="sys\msvc\properties\AddressSanitizer.props" />
143+
</ImportGroup>
116144
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Editable|x64'" Label="PropertySheets">
117145
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
118146
<Import Project="$(SolutionDir)/sys/msvc/properties/_Common.props" />
@@ -127,6 +155,14 @@
127155
<Import Project="$(SolutionDir)/sys/msvc/properties/_DoomDLL.props" />
128156
<Import Project="sys\msvc\properties\_DebugFast.props" />
129157
</ImportGroup>
158+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Sanitize|x64'" Label="PropertySheets">
159+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
160+
<Import Project="$(SolutionDir)/sys/msvc/properties/_Common.props" />
161+
<Import Project="sys\msvc\properties\Common_x64.props" />
162+
<Import Project="$(SolutionDir)/sys/msvc/properties/_DoomDLL.props" />
163+
<Import Project="sys\msvc\properties\_DebugFast.props" />
164+
<Import Project="sys\msvc\properties\AddressSanitizer.props" />
165+
</ImportGroup>
130166
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
131167
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
132168
<Import Project="$(SolutionDir)/sys/msvc/properties/_Common.props" />
@@ -160,16 +196,22 @@
160196
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
161197
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Editable|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
162198
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Fast|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
199+
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Sanitize|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
163200
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Editable|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
164201
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Fast|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
202+
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Sanitize|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
165203
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Editable|Win32'" />
166204
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Fast|Win32'" />
205+
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Sanitize|Win32'" />
167206
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Editable|x64'" />
168207
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Fast|x64'" />
208+
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Sanitize|x64'" />
169209
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Editable|Win32'" />
170210
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Fast|Win32'" />
211+
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Sanitize|Win32'" />
171212
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Editable|x64'" />
172213
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Fast|x64'" />
214+
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Sanitize|x64'" />
173215
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
174216
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
175217
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />

engine.vcxproj.user

+12
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
<LocalDebuggerCommandArguments>+set com_allowConsole 1 +set r_ignoreglerrors 0</LocalDebuggerCommandArguments>
1212
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
1313
</PropertyGroup>
14+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Sanitize|Win32'">
15+
<LocalDebuggerCommand>$(OutDir)$(TargetName)$(TargetExt)</LocalDebuggerCommand>
16+
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
17+
<LocalDebuggerCommandArguments>+set com_allowConsole 1 +set r_ignoreglerrors 0</LocalDebuggerCommandArguments>
18+
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
19+
</PropertyGroup>
1420
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug with inlines|x64'">
1521
<LocalDebuggerCommand>$(OutDir)$(TargetName)$(TargetExt)</LocalDebuggerCommand>
1622
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
@@ -22,6 +28,12 @@
2228
<LocalDebuggerCommandArguments>+set com_allowConsole 1 +set r_ignoreglerrors 0</LocalDebuggerCommandArguments>
2329
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
2430
</PropertyGroup>
31+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Sanitize|x64'">
32+
<LocalDebuggerCommand>$(OutDir)$(TargetName)$(TargetExt)</LocalDebuggerCommand>
33+
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
34+
<LocalDebuggerCommandArguments>+set com_allowConsole 1 +set r_ignoreglerrors 0</LocalDebuggerCommandArguments>
35+
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
36+
</PropertyGroup>
2537
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
2638
<LocalDebuggerCommand>$(OutDir)$(TargetName)$(TargetExt)</LocalDebuggerCommand>
2739
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ImportGroup Label="PropertySheets" />
4+
<PropertyGroup Label="UserMacros" />
5+
<PropertyGroup />
6+
<PropertyGroup Label="Configuration">
7+
<EnableASAN>true</EnableASAN>
8+
</PropertyGroup>
9+
<ItemDefinitionGroup>
10+
<ClCompile>
11+
<PreprocessorDefinitions>_DISABLE_VECTOR_ANNOTATION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
12+
</ClCompile>
13+
</ItemDefinitionGroup>
14+
<ItemGroup />
15+
</Project>

0 commit comments

Comments
 (0)