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

Side by Side Diff: tests/debug_stub/debugger_test.c

Issue 11269063: Fix the NACL_INSTR_* names that I just checked in to NACL_INSTR_ARM_*, as suggested by mseaborn. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « src/trusted/validator_arm/model.h ('k') | tests/dynamic_code_loading/dynamic_load_test.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <pthread.h> 7 #include <pthread.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 17 matching lines...) Expand all
28 * top-level assembly. 28 * top-level assembly.
29 */ 29 */
30 #if defined(__i386__) || defined(__x86_64__) 30 #if defined(__i386__) || defined(__x86_64__)
31 __asm__(".pushsection .text, \"ax\", @progbits\n" 31 __asm__(".pushsection .text, \"ax\", @progbits\n"
32 "fault_addr:\n" 32 "fault_addr:\n"
33 "hlt\n" 33 "hlt\n"
34 ".popsection\n"); 34 ".popsection\n");
35 #elif defined(__arm__) 35 #elif defined(__arm__)
36 __asm__(".pushsection .text, \"ax\", %progbits\n" 36 __asm__(".pushsection .text, \"ax\", %progbits\n"
37 "fault_addr:\n" 37 "fault_addr:\n"
38 ".word " NACL_TO_STRING(NACL_INSTR_BREAKPOINT) "\n" 38 ".word " NACL_TO_STRING(NACL_INSTR_ARM_BREAKPOINT) "\n"
39 ".popsection\n"); 39 ".popsection\n");
40 #else 40 #else
41 # error Update fault_addr for other architectures 41 # error Update fault_addr for other architectures
42 #endif 42 #endif
43 43
44 void set_registers_and_stop() { 44 void set_registers_and_stop() {
45 struct NaClSignalContext regs; 45 struct NaClSignalContext regs;
46 memset(&regs, 0, sizeof(regs)); 46 memset(&regs, 0, sizeof(regs));
47 47
48 /* 48 /*
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 /* We avoid using int3 because of a Mac OS X kernel bug. */ 182 /* We avoid using int3 because of a Mac OS X kernel bug. */
183 __asm__("hlt"); 183 __asm__("hlt");
184 #elif defined(__arm__) 184 #elif defined(__arm__)
185 /* 185 /*
186 * Arrange the breakpoint so that the test can skip over it by 186 * Arrange the breakpoint so that the test can skip over it by
187 * jumping to the next bundle. This means we never have to set the 187 * jumping to the next bundle. This means we never have to set the
188 * program counter to within a bundle, which could be unsafe, 188 * program counter to within a bundle, which could be unsafe,
189 * because BKPTs guard data literals in the ARM sandbox. 189 * because BKPTs guard data literals in the ARM sandbox.
190 */ 190 */
191 __asm__(".p2align 4\n" 191 __asm__(".p2align 4\n"
192 ".word " NACL_TO_STRING(NACL_INSTR_BREAKPOINT) "\n" 192 ".word " NACL_TO_STRING(NACL_INSTR_ARM_BREAKPOINT) "\n"
193 ".p2align 4\n"); 193 ".p2align 4\n");
194 #else 194 #else
195 # error Unsupported architecture 195 # error Unsupported architecture
196 #endif 196 #endif
197 } 197 }
198 198
199 void *child_thread_func(void *thread_arg) { 199 void *child_thread_func(void *thread_arg) {
200 for (;;) { 200 for (;;) {
201 g_child_thread_var++; 201 g_child_thread_var++;
202 breakpoint(); 202 breakpoint();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 if (strcmp(argv[1], "test_interrupt") == 0) { 246 if (strcmp(argv[1], "test_interrupt") == 0) {
247 test_interrupt(); 247 test_interrupt();
248 return 0; 248 return 0;
249 } 249 }
250 if (strcmp(argv[1], "test_suspending_threads") == 0) { 250 if (strcmp(argv[1], "test_suspending_threads") == 0) {
251 test_suspending_threads(); 251 test_suspending_threads();
252 return 0; 252 return 0;
253 } 253 }
254 return 1; 254 return 1;
255 } 255 }
OLDNEW
« no previous file with comments | « src/trusted/validator_arm/model.h ('k') | tests/dynamic_code_loading/dynamic_load_test.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698