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> | 5 #include <setjmp.h> |
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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 264 } |
265 | 265 |
266 | 266 |
267 intptr_t SimulatorDebugger::GetApproximateTokenIndex(const Code& code, | 267 intptr_t SimulatorDebugger::GetApproximateTokenIndex(const Code& code, |
268 uword pc) { | 268 uword pc) { |
269 intptr_t token_pos = -1; | 269 intptr_t token_pos = -1; |
270 const PcDescriptors& descriptors = | 270 const PcDescriptors& descriptors = |
271 PcDescriptors::Handle(code.pc_descriptors()); | 271 PcDescriptors::Handle(code.pc_descriptors()); |
272 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind); | 272 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind); |
273 while (iter.HasNext()) { | 273 while (iter.HasNext()) { |
274 RawPcDescriptors::PcDescriptorRec rec; | 274 uword current_pc = iter.NextPc(); |
275 iter.NextRec(&rec); | 275 if (current_pc == pc) { |
276 if (rec.pc() == pc) { | 276 return iter.current_token_pos(); |
277 return rec.token_pos(); | 277 } else if ((token_pos <= 0) && (current_pc > pc)) { |
278 } else if ((token_pos <= 0) && (rec.pc() > pc)) { | 278 token_pos = iter.current_token_pos(); |
279 token_pos = rec.token_pos(); | |
280 } | 279 } |
281 } | 280 } |
282 return token_pos; | 281 return token_pos; |
283 } | 282 } |
284 | 283 |
285 | 284 |
286 void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp, | 285 void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp, |
287 const Function& function, | 286 const Function& function, |
288 intptr_t token_pos, | 287 intptr_t token_pos, |
289 bool is_optimized, | 288 bool is_optimized, |
(...skipping 3434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3724 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 3723 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
3725 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 3724 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
3726 buf->Longjmp(); | 3725 buf->Longjmp(); |
3727 } | 3726 } |
3728 | 3727 |
3729 } // namespace dart | 3728 } // namespace dart |
3730 | 3729 |
3731 #endif // !defined(HOST_ARCH_ARM) | 3730 #endif // !defined(HOST_ARCH_ARM) |
3732 | 3731 |
3733 #endif // defined TARGET_ARCH_ARM | 3732 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |