Commit 2c227ffd authored by mseaborn@chromium.org's avatar mseaborn@chromium.org

NaCl: Permit using the debug exception handler when the debug stub is enabled

This is in preparation for a NaCl-side change to make the debug stub
use the Windows debug exception handler process instead of Vectored
Exception Handling.

BUG=http://code.google.com/p/nativeclient/issues/detail?id=2948
TEST=none

Review URL: https://chromiumcodereview.appspot.com/10836197

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151171 0039d316-1c4b-4281-b951-d872f2087c98
parent 7ce3056c
...@@ -128,6 +128,7 @@ NaClProcessHost::NaClProcessHost(const GURL& manifest_url, bool off_the_record) ...@@ -128,6 +128,7 @@ NaClProcessHost::NaClProcessHost(const GURL& manifest_url, bool off_the_record)
internal_(new NaClInternal()), internal_(new NaClInternal()),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
enable_exception_handling_(false), enable_exception_handling_(false),
enable_debug_stub_(false),
off_the_record_(off_the_record) { off_the_record_(off_the_record) {
process_.reset(content::BrowserChildProcessHost::Create( process_.reset(content::BrowserChildProcessHost::Create(
content::PROCESS_TYPE_NACL_LOADER, this)); content::PROCESS_TYPE_NACL_LOADER, this));
...@@ -145,6 +146,8 @@ NaClProcessHost::NaClProcessHost(const GURL& manifest_url, bool off_the_record) ...@@ -145,6 +146,8 @@ NaClProcessHost::NaClProcessHost(const GURL& manifest_url, bool off_the_record)
getenv("NACL_UNTRUSTED_EXCEPTION_HANDLING") != NULL) { getenv("NACL_UNTRUSTED_EXCEPTION_HANDLING") != NULL) {
enable_exception_handling_ = true; enable_exception_handling_ = true;
} }
enable_debug_stub_ = CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableNaClDebug);
enable_ipc_proxy_ = CommandLine::ForCurrentProcess()->HasSwitch( enable_ipc_proxy_ = CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableNaClIPCProxy); switches::kEnableNaClIPCProxy);
...@@ -622,8 +625,7 @@ bool NaClProcessHost::StartNaClExecution() { ...@@ -622,8 +625,7 @@ bool NaClProcessHost::StartNaClExecution() {
params.validation_cache_key = nacl_browser->GetValidationCacheKey(); params.validation_cache_key = nacl_browser->GetValidationCacheKey();
params.version = chrome::VersionInfo().CreateVersionString(); params.version = chrome::VersionInfo().CreateVersionString();
params.enable_exception_handling = enable_exception_handling_; params.enable_exception_handling = enable_exception_handling_;
params.enable_debug_stub = params.enable_debug_stub = enable_debug_stub_;
CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNaClDebug);
params.enable_ipc_proxy = enable_ipc_proxy_; params.enable_ipc_proxy = enable_ipc_proxy_;
base::PlatformFile irt_file = nacl_browser->IrtFile(); base::PlatformFile irt_file = nacl_browser->IrtFile();
...@@ -735,9 +737,9 @@ void NaClProcessHost::OnAttachDebugExceptionHandler(const std::string& info, ...@@ -735,9 +737,9 @@ void NaClProcessHost::OnAttachDebugExceptionHandler(const std::string& info,
bool NaClProcessHost::AttachDebugExceptionHandler(const std::string& info, bool NaClProcessHost::AttachDebugExceptionHandler(const std::string& info,
IPC::Message* reply_msg) { IPC::Message* reply_msg) {
if (!enable_exception_handling_) { if (!enable_exception_handling_ && !enable_debug_stub_) {
DLOG(ERROR) << DLOG(ERROR) <<
"Exception handling requested by NaCl process when not enabled"; "Debug exception handler requested by NaCl process when not enabled";
return false; return false;
} }
if (debug_exception_handler_requested_) { if (debug_exception_handler_requested_) {
......
...@@ -153,6 +153,7 @@ class NaClProcessHost : public content::BrowserChildProcessHostDelegate { ...@@ -153,6 +153,7 @@ class NaClProcessHost : public content::BrowserChildProcessHostDelegate {
scoped_ptr<content::BrowserChildProcessHost> process_; scoped_ptr<content::BrowserChildProcessHost> process_;
bool enable_exception_handling_; bool enable_exception_handling_;
bool enable_debug_stub_;
bool off_the_record_; bool off_the_record_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment