OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /* | 7 /* |
8 * NaCl Simple/secure ELF loader (NaCl SEL). | 8 * NaCl Simple/secure ELF loader (NaCl SEL). |
9 */ | 9 */ |
10 #include "native_client/src/include/portability.h" | 10 #include "native_client/src/include/portability.h" |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 NaClLog(LOG_FATAL, "Adding item to env_vars failed\n"); | 385 NaClLog(LOG_FATAL, "Adding item to env_vars failed\n"); |
386 } | 386 } |
387 break; | 387 break; |
388 default: | 388 default: |
389 fprintf(stderr, "ERROR: unknown option: [%c]\n\n", opt); | 389 fprintf(stderr, "ERROR: unknown option: [%c]\n\n", opt); |
390 PrintUsage(); | 390 PrintUsage(); |
391 exit(-1); | 391 exit(-1); |
392 } | 392 } |
393 } | 393 } |
394 | 394 |
| 395 if (getenv("NACL_UNTRUSTED_EXCEPTION_HANDLING") != NULL) { |
| 396 exception_handling_requested = 1; |
| 397 } |
395 if (exception_handling_requested) { | 398 if (exception_handling_requested) { |
396 #if NACL_WINDOWS | 399 #if NACL_WINDOWS |
397 int status; | 400 int status; |
398 DWORD exit_code; | 401 DWORD exit_code; |
399 enable_exception_handling = 1; | 402 enable_exception_handling = 1; |
400 status = NaClLaunchAndDebugItself(argv[0], &exit_code); | 403 status = NaClLaunchAndDebugItself(argv[0], &exit_code); |
401 if (status == DEBUG_EXCEPTION_HANDLER_NOT_SUPPORTED) { | 404 if (status == DEBUG_EXCEPTION_HANDLER_NOT_SUPPORTED) { |
402 enable_exception_handling = 0; | 405 enable_exception_handling = 0; |
403 } else if (status == DEBUG_EXCEPTION_HANDLER_SUCCESS) { | 406 } else if (status == DEBUG_EXCEPTION_HANDLER_SUCCESS) { |
404 return exit_code; | 407 return exit_code; |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 fflush(stdout); | 932 fflush(stdout); |
930 | 933 |
931 if (handle_signals) NaClSignalHandlerFini(); | 934 if (handle_signals) NaClSignalHandlerFini(); |
932 NaClAllModulesFini(); | 935 NaClAllModulesFini(); |
933 | 936 |
934 NaClExit(ret_code); | 937 NaClExit(ret_code); |
935 | 938 |
936 /* Unreachable, but having the return prevents a compiler error. */ | 939 /* Unreachable, but having the return prevents a compiler error. */ |
937 return ret_code; | 940 return ret_code; |
938 } | 941 } |
OLD | NEW |