Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: src/trusted/service_runtime/sel_ldr_standard.c

Issue 7164001: Resurrection of "Hooks for out-of-process (OOP) debugger" CL. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2011 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 10
(...skipping 13 matching lines...) Expand all
24 #include "native_client/src/shared/platform/nacl_time.h" 24 #include "native_client/src/shared/platform/nacl_time.h"
25 #include "native_client/src/trusted/perf_counter/nacl_perf_counter.h" 25 #include "native_client/src/trusted/perf_counter/nacl_perf_counter.h"
26 26
27 #include "native_client/src/trusted/service_runtime/include/sys/errno.h" 27 #include "native_client/src/trusted/service_runtime/include/sys/errno.h"
28 28
29 #include "native_client/src/trusted/service_runtime/arch/sel_ldr_arch.h" 29 #include "native_client/src/trusted/service_runtime/arch/sel_ldr_arch.h"
30 #include "native_client/src/trusted/service_runtime/elf_util.h" 30 #include "native_client/src/trusted/service_runtime/elf_util.h"
31 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h" 31 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h"
32 #include "native_client/src/trusted/service_runtime/nacl_closure.h" 32 #include "native_client/src/trusted/service_runtime/nacl_closure.h"
33 #include "native_client/src/trusted/service_runtime/nacl_debug_init.h" 33 #include "native_client/src/trusted/service_runtime/nacl_debug_init.h"
34 #include "native_client/src/trusted/service_runtime/nacl_oop_debugger_hooks.h"
34 #include "native_client/src/trusted/service_runtime/nacl_sync_queue.h" 35 #include "native_client/src/trusted/service_runtime/nacl_sync_queue.h"
35 #include "native_client/src/trusted/service_runtime/nacl_syscall_common.h" 36 #include "native_client/src/trusted/service_runtime/nacl_syscall_common.h"
36 #include "native_client/src/trusted/service_runtime/nacl_text.h" 37 #include "native_client/src/trusted/service_runtime/nacl_text.h"
37 #include "native_client/src/trusted/service_runtime/outer_sandbox.h" 38 #include "native_client/src/trusted/service_runtime/outer_sandbox.h"
38 #include "native_client/src/trusted/service_runtime/sel_memory.h" 39 #include "native_client/src/trusted/service_runtime/sel_memory.h"
39 #include "native_client/src/trusted/service_runtime/sel_ldr.h" 40 #include "native_client/src/trusted/service_runtime/sel_ldr.h"
40 #include "native_client/src/trusted/service_runtime/sel_util.h" 41 #include "native_client/src/trusted/service_runtime/sel_util.h"
41 #include "native_client/src/trusted/service_runtime/sel_addrspace.h" 42 #include "native_client/src/trusted/service_runtime/sel_addrspace.h"
42 43
43 #if !defined(SIZE_T_MAX) 44 #if !defined(SIZE_T_MAX)
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 695
695 /* now actually spawn the thread */ 696 /* now actually spawn the thread */
696 natp = malloc(sizeof *natp); 697 natp = malloc(sizeof *natp);
697 if (!natp) { 698 if (!natp) {
698 goto cleanup; 699 goto cleanup;
699 } 700 }
700 701
701 /* We are ready to distinguish crashes in trusted and untrusted code. */ 702 /* We are ready to distinguish crashes in trusted and untrusted code. */
702 NaClSignalRegisterApp(nap); 703 NaClSignalRegisterApp(nap);
703 704
705 /* NaClApp initialization is completed, call OOP debugger hook. */
706 NaClOopDebuggerAppCreateHook(nap);
707
704 NaClXMutexLock(&nap->mu); 708 NaClXMutexLock(&nap->mu);
705 nap->running = 1; 709 nap->running = 1;
706 NaClXMutexUnlock(&nap->mu); 710 NaClXMutexUnlock(&nap->mu);
707 711
708 NaClVmHoleWaitToStartThread(nap); 712 NaClVmHoleWaitToStartThread(nap);
709 713
710 NaClLog(2, "system stack ptr : %016"NACL_PRIxPTR"\n", stack_ptr); 714 NaClLog(2, "system stack ptr : %016"NACL_PRIxPTR"\n", stack_ptr);
711 NaClLog(2, " user stack ptr : %016"NACL_PRIxPTR"\n", 715 NaClLog(2, " user stack ptr : %016"NACL_PRIxPTR"\n",
712 NaClSysToUserStackAddr(nap, stack_ptr)); 716 NaClSysToUserStackAddr(nap, stack_ptr));
713 717
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 } 757 }
754 NaClXMutexUnlock(&nap->mu); 758 NaClXMutexUnlock(&nap->mu);
755 /* 759 /*
756 * Some thread invoked the exit (exit_group) syscall. 760 * Some thread invoked the exit (exit_group) syscall.
757 */ 761 */
758 762
759 if (NULL != nap->debug_stub_callbacks) { 763 if (NULL != nap->debug_stub_callbacks) {
760 nap->debug_stub_callbacks->process_exit_hook(nap->exit_status); 764 nap->debug_stub_callbacks->process_exit_hook(nap->exit_status);
761 } 765 }
762 766
767 NaClOopDebuggerAppExitHook(nap->exit_status);
768
763 return (nap->exit_status); 769 return (nap->exit_status);
764 } 770 }
765 771
766 /* 772 /*
767 * stack_ptr is from syscall, so a 32-bit address. 773 * stack_ptr is from syscall, so a 32-bit address.
768 */ 774 */
769 int32_t NaClCreateAdditionalThread(struct NaClApp *nap, 775 int32_t NaClCreateAdditionalThread(struct NaClApp *nap,
770 uintptr_t prog_ctr, 776 uintptr_t prog_ctr,
771 uintptr_t sys_stack_ptr, 777 uintptr_t sys_stack_ptr,
772 uintptr_t sys_tdb, 778 uintptr_t sys_tdb,
(...skipping 25 matching lines...) Expand all
798 sys_tdb, 804 sys_tdb,
799 tdb_size)) { 805 tdb_size)) {
800 NaClLog(LOG_WARNING, 806 NaClLog(LOG_WARNING,
801 ("NaClCreateAdditionalThread: could not allocate thread index." 807 ("NaClCreateAdditionalThread: could not allocate thread index."
802 " Returning EAGAIN per POSIX specs.\n")); 808 " Returning EAGAIN per POSIX specs.\n"));
803 free(natp); 809 free(natp);
804 return -NACL_ABI_EAGAIN; 810 return -NACL_ABI_EAGAIN;
805 } 811 }
806 return 0; 812 return 0;
807 } 813 }
OLDNEW
« no previous file with comments | « src/trusted/service_runtime/osx/nacl_oop_debugger_hooks.c ('k') | src/trusted/service_runtime/service_runtime.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698