OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include <setjmp.h> // NOLINT | 5 #include <setjmp.h> // NOLINT |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
9 #if defined(TARGET_ARCH_ARM) | 9 #if defined(TARGET_ARCH_ARM) |
10 | 10 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 return true; | 248 return true; |
249 } | 249 } |
250 } | 250 } |
251 return false; | 251 return false; |
252 } | 252 } |
253 | 253 |
254 | 254 |
255 intptr_t SimulatorDebugger::GetApproximateTokenIndex(const Code& code, | 255 intptr_t SimulatorDebugger::GetApproximateTokenIndex(const Code& code, |
256 uword pc) { | 256 uword pc) { |
257 intptr_t token_pos = -1; | 257 intptr_t token_pos = -1; |
| 258 uword pc_offset = pc - code.EntryPoint(); |
258 const PcDescriptors& descriptors = | 259 const PcDescriptors& descriptors = |
259 PcDescriptors::Handle(code.pc_descriptors()); | 260 PcDescriptors::Handle(code.pc_descriptors()); |
260 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind); | 261 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind); |
261 while (iter.MoveNext()) { | 262 while (iter.MoveNext()) { |
262 if (iter.Pc() == pc) { | 263 if (iter.PcOffset() == pc_offset) { |
263 return iter.TokenPos(); | 264 return iter.TokenPos(); |
264 } else if ((token_pos <= 0) && (iter.Pc() > pc)) { | 265 } else if ((token_pos <= 0) && (iter.PcOffset() > pc_offset)) { |
265 token_pos = iter.TokenPos(); | 266 token_pos = iter.TokenPos(); |
266 } | 267 } |
267 } | 268 } |
268 return token_pos; | 269 return token_pos; |
269 } | 270 } |
270 | 271 |
271 | 272 |
272 void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp, | 273 void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp, |
273 const Function& function, | 274 const Function& function, |
274 intptr_t token_pos, | 275 intptr_t token_pos, |
(...skipping 3597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3872 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 3873 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
3873 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 3874 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
3874 buf->Longjmp(); | 3875 buf->Longjmp(); |
3875 } | 3876 } |
3876 | 3877 |
3877 } // namespace dart | 3878 } // namespace dart |
3878 | 3879 |
3879 #endif // !defined(HOST_ARCH_ARM) | 3880 #endif // !defined(HOST_ARCH_ARM) |
3880 | 3881 |
3881 #endif // defined TARGET_ARCH_ARM | 3882 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |