OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64) | 9 #if defined(TARGET_ARCH_ARM64) |
10 | 10 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 return true; | 266 return true; |
267 } | 267 } |
268 } | 268 } |
269 return false; | 269 return false; |
270 } | 270 } |
271 | 271 |
272 | 272 |
273 intptr_t SimulatorDebugger::GetApproximateTokenIndex(const Code& code, | 273 intptr_t SimulatorDebugger::GetApproximateTokenIndex(const Code& code, |
274 uword pc) { | 274 uword pc) { |
275 intptr_t token_pos = -1; | 275 intptr_t token_pos = -1; |
| 276 uword pc_offset = pc - code.EntryPoint(); |
276 const PcDescriptors& descriptors = | 277 const PcDescriptors& descriptors = |
277 PcDescriptors::Handle(code.pc_descriptors()); | 278 PcDescriptors::Handle(code.pc_descriptors()); |
278 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind); | 279 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind); |
279 while (iter.MoveNext()) { | 280 while (iter.MoveNext()) { |
280 if (iter.Pc() == pc) { | 281 if (iter.PcOffset() == pc_offset) { |
281 return iter.TokenPos(); | 282 return iter.TokenPos(); |
282 } else if ((token_pos <= 0) && (iter.Pc() > pc)) { | 283 } else if ((token_pos <= 0) && (iter.PcOffset() > pc_offset)) { |
283 token_pos = iter.TokenPos(); | 284 token_pos = iter.TokenPos(); |
284 } | 285 } |
285 } | 286 } |
286 return token_pos; | 287 return token_pos; |
287 } | 288 } |
288 | 289 |
289 | 290 |
290 void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp, | 291 void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp, |
291 const Function& function, | 292 const Function& function, |
292 intptr_t token_pos, | 293 intptr_t token_pos, |
(...skipping 3201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3494 set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); | 3495 set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); |
3495 set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); | 3496 set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); |
3496 buf->Longjmp(); | 3497 buf->Longjmp(); |
3497 } | 3498 } |
3498 | 3499 |
3499 } // namespace dart | 3500 } // namespace dart |
3500 | 3501 |
3501 #endif // !defined(HOST_ARCH_ARM64) | 3502 #endif // !defined(HOST_ARCH_ARM64) |
3502 | 3503 |
3503 #endif // defined TARGET_ARCH_ARM64 | 3504 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |