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

Side by Side Diff: src/trusted/debug_stub/abi.cc

Issue 11194045: Change BKPT and UDF encodings on ARM. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Clarify comments. Fix unaligned_data_irt.nexe, it had a hard-coded BKPT #0x7777. Created 8 years, 2 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) 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 <assert.h> 7 #include <assert.h>
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 11
12 #include "native_client/src/include/arm_sandbox.h"
12 #include "native_client/src/shared/platform/nacl_log.h" 13 #include "native_client/src/shared/platform/nacl_log.h"
13 #include "native_client/src/trusted/debug_stub/abi.h" 14 #include "native_client/src/trusted/debug_stub/abi.h"
14 #include "native_client/src/trusted/debug_stub/platform.h" 15 #include "native_client/src/trusted/debug_stub/platform.h"
15 16
16 using port::IPlatform; 17 using port::IPlatform;
17 18
18 namespace gdb_rsp { 19 namespace gdb_rsp {
19 20
20 #define MINIDEF(x, name, purpose) { #name, sizeof(x), Abi::purpose, 0, 0 } 21 #define MINIDEF(x, name, purpose) { #name, sizeof(x), Abi::purpose, 0, 0 }
21 22
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // a fault. INT3 leaves %eip/%rip pointing to the address after 123 // a fault. INT3 leaves %eip/%rip pointing to the address after
123 // the INT3 instruction, which makes it harder to tell 124 // the INT3 instruction, which makes it harder to tell
124 // unambiguously whether a fault was produced by an INT3 or the 125 // unambiguously whether a fault was produced by an INT3 or the
125 // instruction after it. 126 // instruction after it.
126 static uint8_t breakpoint_code_x86[] = { 0xf4 /* HLT */ }; 127 static uint8_t breakpoint_code_x86[] = { 0xf4 /* HLT */ };
127 static Abi::BPDef breakpoint_x86 = { 128 static Abi::BPDef breakpoint_x86 = {
128 sizeof(breakpoint_code_x86), 129 sizeof(breakpoint_code_x86),
129 breakpoint_code_x86 130 breakpoint_code_x86
130 }; 131 };
131 132
132 static uint32_t breakpoint_code_arm[] = { 0xe1277777 /* bkpt 0x7777 */ }; 133 static uint32_t breakpoint_code_arm[] = { NACL_INSTR_BREAKPOINT };
133 static Abi::BPDef breakpoint_arm = { 134 static Abi::BPDef breakpoint_arm = {
134 sizeof(breakpoint_code_arm), 135 sizeof(breakpoint_code_arm),
135 (uint8_t *) breakpoint_code_arm 136 (uint8_t *) breakpoint_code_arm
136 }; 137 };
137 138
138 static AbiMap_t *GetAbis() { 139 static AbiMap_t *GetAbis() {
139 static AbiMap_t *_abis = new AbiMap_t(); 140 static AbiMap_t *_abis = new AbiMap_t();
140 return _abis; 141 return _abis;
141 } 142 }
142 143
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 if (index >= regCnt_) return NULL; 251 if (index >= regCnt_) return NULL;
251 252
252 return &regDefs_[index]; 253 return &regDefs_[index];
253 } 254 }
254 255
255 const Abi::RegDef *Abi::GetInstPtrDef() const { 256 const Abi::RegDef *Abi::GetInstPtrDef() const {
256 return GetRegisterDef(ipIndex_); 257 return GetRegisterDef(ipIndex_);
257 } 258 }
258 259
259 } // namespace gdb_rsp 260 } // namespace gdb_rsp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698