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_MIPS) | 9 #if defined(TARGET_ARCH_MIPS) |
10 | 10 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 return true; | 259 return true; |
260 } | 260 } |
261 } | 261 } |
262 return false; | 262 return false; |
263 } | 263 } |
264 | 264 |
265 | 265 |
266 intptr_t SimulatorDebugger::GetApproximateTokenIndex(const Code& code, | 266 intptr_t SimulatorDebugger::GetApproximateTokenIndex(const Code& code, |
267 uword pc) { | 267 uword pc) { |
268 intptr_t token_pos = -1; | 268 intptr_t token_pos = -1; |
| 269 uword pc_offset = pc - code.EntryPoint(); |
269 const PcDescriptors& descriptors = | 270 const PcDescriptors& descriptors = |
270 PcDescriptors::Handle(code.pc_descriptors()); | 271 PcDescriptors::Handle(code.pc_descriptors()); |
271 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind); | 272 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind); |
272 while (iter.MoveNext()) { | 273 while (iter.MoveNext()) { |
273 if (iter.Pc() == pc) { | 274 if (iter.PcOffset() == pc_offset) { |
274 return iter.TokenPos(); | 275 return iter.TokenPos(); |
275 } else if ((token_pos <= 0) && (iter.Pc() > pc)) { | 276 } else if ((token_pos <= 0) && (iter.PcOffset() > pc_offset)) { |
276 token_pos = iter.TokenPos(); | 277 token_pos = iter.TokenPos(); |
277 } | 278 } |
278 } | 279 } |
279 return token_pos; | 280 return token_pos; |
280 } | 281 } |
281 | 282 |
282 | 283 |
283 void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp, | 284 void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp, |
284 const Function& function, | 285 const Function& function, |
285 intptr_t token_pos, | 286 intptr_t token_pos, |
(...skipping 2201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2487 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 2488 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
2488 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 2489 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
2489 buf->Longjmp(); | 2490 buf->Longjmp(); |
2490 } | 2491 } |
2491 | 2492 |
2492 } // namespace dart | 2493 } // namespace dart |
2493 | 2494 |
2494 #endif // !defined(HOST_ARCH_MIPS) | 2495 #endif // !defined(HOST_ARCH_MIPS) |
2495 | 2496 |
2496 #endif // defined TARGET_ARCH_MIPS | 2497 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |