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 <math.h> // for isnan. | 5 #include <math.h> // for isnan. |
6 #include <setjmp.h> | 6 #include <setjmp.h> |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
10 #if defined(TARGET_ARCH_ARM) | 10 #if defined(TARGET_ARCH_ARM) |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } | 263 } |
264 return false; | 264 return false; |
265 } | 265 } |
266 | 266 |
267 | 267 |
268 intptr_t SimulatorDebugger::GetApproximateTokenIndex(const Code& code, | 268 intptr_t SimulatorDebugger::GetApproximateTokenIndex(const Code& code, |
269 uword pc) { | 269 uword pc) { |
270 intptr_t token_pos = -1; | 270 intptr_t token_pos = -1; |
271 const PcDescriptors& descriptors = | 271 const PcDescriptors& descriptors = |
272 PcDescriptors::Handle(code.pc_descriptors()); | 272 PcDescriptors::Handle(code.pc_descriptors()); |
273 for (intptr_t i = 0; i < descriptors.Length(); i++) { | 273 PcDescriptors::Iterator iter(descriptors); |
274 if (descriptors.PC(i) == pc) { | 274 while (iter.HasNext()) { |
275 token_pos = descriptors.TokenPos(i); | 275 const RawPcDescriptors::PcDescriptorRec& rec = iter.Next(); |
276 break; | 276 if (rec.pc == pc) { |
277 } else if ((token_pos <= 0) && (descriptors.PC(i) > pc)) { | 277 return rec.token_pos; |
278 token_pos = descriptors.TokenPos(i); | 278 } else if ((token_pos <= 0) && (rec.pc > pc)) { |
| 279 token_pos = rec.token_pos; |
279 } | 280 } |
280 } | 281 } |
281 return token_pos; | 282 return token_pos; |
282 } | 283 } |
283 | 284 |
284 | 285 |
285 void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp, | 286 void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp, |
286 const Function& function, | 287 const Function& function, |
287 intptr_t token_pos, | 288 intptr_t token_pos, |
288 bool is_optimized, | 289 bool is_optimized, |
(...skipping 3430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3719 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 3720 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
3720 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 3721 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
3721 buf->Longjmp(); | 3722 buf->Longjmp(); |
3722 } | 3723 } |
3723 | 3724 |
3724 } // namespace dart | 3725 } // namespace dart |
3725 | 3726 |
3726 #endif // !defined(HOST_ARCH_ARM) | 3727 #endif // !defined(HOST_ARCH_ARM) |
3727 | 3728 |
3728 #endif // defined TARGET_ARCH_ARM | 3729 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |