| 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 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #if !NACL_ANDROID | 10 #if !NACL_ANDROID |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 # if NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86 | 37 # if NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86 |
| 38 # if NACL_BUILD_SUBARCH == 32 | 38 # if NACL_BUILD_SUBARCH == 32 |
| 39 faulting_pc = ucp->uc_mcontext.gregs[REG_EIP]; | 39 faulting_pc = ucp->uc_mcontext.gregs[REG_EIP]; |
| 40 # elif NACL_BUILD_SUBARCH == 64 | 40 # elif NACL_BUILD_SUBARCH == 64 |
| 41 faulting_pc = ucp->uc_mcontext.gregs[REG_RIP]; | 41 faulting_pc = ucp->uc_mcontext.gregs[REG_RIP]; |
| 42 # else | 42 # else |
| 43 # error "128-bit version of x86?!?" | 43 # error "128-bit version of x86?!?" |
| 44 # endif | 44 # endif |
| 45 # elif NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm | 45 # elif NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm |
| 46 faulting_pc = ucp->uc_mcontext.arm_pc; | 46 faulting_pc = ucp->uc_mcontext.arm_pc; |
| 47 # elif NACL_ARCH(NACL_BUILD_ARCH) == NACL_mips |
| 48 faulting_pc = ucp->uc_mcontext.pc; |
| 47 # else | 49 # else |
| 48 # error "how do i get the PC on this cpu architecture?" | 50 # error "how do i get the PC on this cpu architecture?" |
| 49 # endif | 51 # endif |
| 50 #elif NACL_OSX | 52 #elif NACL_OSX |
| 51 # if NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86 | 53 # if NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86 |
| 52 # if NACL_BUILD_SUBARCH == 32 | 54 # if NACL_BUILD_SUBARCH == 32 |
| 53 /* typeof(ucp->uc_mcontext) is struct __darwin_mcontext32 *. */ | 55 /* typeof(ucp->uc_mcontext) is struct __darwin_mcontext32 *. */ |
| 54 faulting_pc = ucp->uc_mcontext->__ss.__eip; | 56 faulting_pc = ucp->uc_mcontext->__ss.__eip; |
| 55 # else | 57 # else |
| 56 faulting_pc = ucp->uc_mcontext->__ss.__rip; | 58 faulting_pc = ucp->uc_mcontext->__ss.__rip; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 static struct NaClTestInjectionTable const g_test_injection_functions = { | 101 static struct NaClTestInjectionTable const g_test_injection_functions = { |
| 100 NaClInjectThreadCaptureSyscall, /* ChangeTrampolines */ | 102 NaClInjectThreadCaptureSyscall, /* ChangeTrampolines */ |
| 101 NaClSetSignalHandler, /* BeforeMainThreadLaunches */ | 103 NaClSetSignalHandler, /* BeforeMainThreadLaunches */ |
| 102 }; | 104 }; |
| 103 | 105 |
| 104 int main(int argc, char **argv) { | 106 int main(int argc, char **argv) { |
| 105 NaClTestInjectionSetInjectionTable(&g_test_injection_functions); | 107 NaClTestInjectionSetInjectionTable(&g_test_injection_functions); |
| 106 (void) NaClSelLdrMain(argc, argv); | 108 (void) NaClSelLdrMain(argc, argv); |
| 107 return 1; /* fail! */ | 109 return 1; /* fail! */ |
| 108 } | 110 } |
| OLD | NEW |