From 78539dfc91cb59f079ac6ada3b80ac7e57fb0dc4 Mon Sep 17 00:00:00 2001 From: "timurrrr@chromium.org" Date: Wed, 16 Jul 2014 22:34:22 +0000 Subject: [PATCH] Make content_shell.exe a console app in ASan/Win builds This will help ASan reports appear on stderr when content_shell is run from CMD.exe console or on ClusterFuzz See also http://crrev.com/275067 where the same was applied to chrome.exe BUG=345874 Review URL: https://codereview.chromium.org/394853002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283551 0039d316-1c4b-4281-b951-d872f2087c98 --- content/content_shell.gypi | 10 +++++++--- content/shell/app/shell_main.cc | 7 +++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/content/content_shell.gypi b/content/content_shell.gypi index b15570bf9ecf..281b1fada05e 100644 --- a/content/content_shell.gypi +++ b/content/content_shell.gypi @@ -519,9 +519,6 @@ 'INFOPLIST_FILE': 'shell/app/app-Info.plist', }, 'msvs_settings': { - 'VCLinkerTool': { - 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS - }, 'VCManifestTool': { 'AdditionalManifestFiles': [ 'shell/app/shell.exe.manifest', @@ -553,6 +550,13 @@ '../sandbox/sandbox.gyp:sandbox', ], }], # OS=="win" + ['OS=="win" and asan==0', { + 'msvs_settings': { + 'VCLinkerTool': { + 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS + }, + }, + }], # OS=="win" and asan==0 ['OS=="mac"', { 'product_name': '<(content_shell_product_name)', 'dependencies!': [ diff --git a/content/shell/app/shell_main.cc b/content/shell/app/shell_main.cc index 4a04d8d826f4..338570f56585 100644 --- a/content/shell/app/shell_main.cc +++ b/content/shell/app/shell_main.cc @@ -16,7 +16,14 @@ #if defined(OS_WIN) +#if !defined(ADDRESS_SANITIZER) int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { +#else +// The AddressSanitizer build should be a console program as it prints out stuff +// on stderr. +int main() { + HINSTANCE instance = GetModuleHandle(NULL); +#endif sandbox::SandboxInterfaceInfo sandbox_info = {0}; content::InitializeSandboxInfo(&sandbox_info); content::ShellMainDelegate delegate; -- 2.11.4.GIT