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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 } | 262 } |
263 return false; | 263 return false; |
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 for (intptr_t i = 0; i < descriptors.Length(); i++) { | 272 PcDescriptors::Iterator iter(descriptors); |
273 if (descriptors.PC(i) == pc) { | 273 while (iter.HasNext()) { |
274 token_pos = descriptors.TokenPos(i); | 274 const RawPcDescriptors::PcDescriptorRec& rec = iter.Next(); |
275 break; | 275 if (rec.pc == pc) { |
276 } else if ((token_pos <= 0) && (descriptors.PC(i) > pc)) { | 276 return rec.token_pos; |
277 token_pos = descriptors.TokenPos(i); | 277 } else if ((token_pos <= 0) && (rec.pc > pc)) { |
| 278 token_pos = rec.token_pos; |
278 } | 279 } |
279 } | 280 } |
280 return token_pos; | 281 return token_pos; |
281 } | 282 } |
282 | 283 |
283 | 284 |
284 void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp, | 285 void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp, |
285 const Function& function, | 286 const Function& function, |
286 intptr_t token_pos, | 287 intptr_t token_pos, |
287 bool is_optimized, | 288 bool is_optimized, |
(...skipping 3430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3718 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 3719 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
3719 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 3720 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
3720 buf->Longjmp(); | 3721 buf->Longjmp(); |
3721 } | 3722 } |
3722 | 3723 |
3723 } // namespace dart | 3724 } // namespace dart |
3724 | 3725 |
3725 #endif // !defined(HOST_ARCH_ARM) | 3726 #endif // !defined(HOST_ARCH_ARM) |
3726 | 3727 |
3727 #endif // defined TARGET_ARCH_ARM | 3728 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |