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 "lib/stacktrace.h" | 5 #include "lib/stacktrace.h" |
6 #include "vm/bootstrap_natives.h" | 6 #include "vm/bootstrap_natives.h" |
7 #include "vm/debugger.h" | 7 #include "vm/debugger.h" |
8 #include "vm/exceptions.h" | 8 #include "vm/exceptions.h" |
9 #include "vm/native_entry.h" | 9 #include "vm/native_entry.h" |
10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 Thread* thread = Thread::Current(); | 103 Thread* thread = Thread::Current(); |
104 return CurrentStackTrace(thread, false, 0); | 104 return CurrentStackTrace(thread, false, 0); |
105 } | 105 } |
106 | 106 |
107 | 107 |
108 DEFINE_NATIVE_ENTRY(StackTrace_current, 0) { | 108 DEFINE_NATIVE_ENTRY(StackTrace_current, 0) { |
109 return CurrentStackTrace(thread, false); | 109 return CurrentStackTrace(thread, false); |
110 } | 110 } |
111 | 111 |
112 | 112 |
113 DEFINE_NATIVE_ENTRY(StackTrace_asyncStackTraceHelper, 0) { | 113 DEFINE_NATIVE_ENTRY(StackTrace_asyncStackTraceHelper, 1) { |
| 114 GET_NON_NULL_NATIVE_ARGUMENT(Closure, async_op, arguments->NativeArgAt(0)); |
| 115 if (FLAG_support_debugger) { |
| 116 Debugger* debugger = isolate->debugger(); |
| 117 if (debugger != NULL) { |
| 118 debugger->MaybeAsyncStepInto(async_op); |
| 119 } |
| 120 } |
114 return CurrentStackTrace(thread, true); | 121 return CurrentStackTrace(thread, true); |
115 } | 122 } |
116 | 123 |
117 | 124 |
| 125 DEFINE_NATIVE_ENTRY(AsyncStarMoveNext_debuggerStepCheck, 1) { |
| 126 GET_NON_NULL_NATIVE_ARGUMENT(Closure, async_op, arguments->NativeArgAt(0)); |
| 127 if (FLAG_support_debugger) { |
| 128 Debugger* debugger = isolate->debugger(); |
| 129 if (debugger != NULL) { |
| 130 debugger->MaybeAsyncStepInto(async_op); |
| 131 } |
| 132 } |
| 133 return Object::null(); |
| 134 } |
| 135 |
| 136 |
118 DEFINE_NATIVE_ENTRY(StackTrace_clearAsyncThreadStackTrace, 0) { | 137 DEFINE_NATIVE_ENTRY(StackTrace_clearAsyncThreadStackTrace, 0) { |
119 thread->clear_async_stack_trace(); | 138 thread->clear_async_stack_trace(); |
120 return Object::null(); | 139 return Object::null(); |
121 } | 140 } |
122 | 141 |
123 | 142 |
124 DEFINE_NATIVE_ENTRY(StackTrace_setAsyncThreadStackTrace, 1) { | 143 DEFINE_NATIVE_ENTRY(StackTrace_setAsyncThreadStackTrace, 1) { |
125 GET_NON_NULL_NATIVE_ARGUMENT(StackTrace, stack_trace, | 144 GET_NON_NULL_NATIVE_ARGUMENT(StackTrace, stack_trace, |
126 arguments->NativeArgAt(0)); | 145 arguments->NativeArgAt(0)); |
127 thread->set_async_stack_trace(stack_trace); | 146 thread->set_async_stack_trace(stack_trace); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 void _printCurrentStackTraceNoSafepoint() { | 205 void _printCurrentStackTraceNoSafepoint() { |
187 StackFrameIterator frames(StackFrameIterator::kDontValidateFrames); | 206 StackFrameIterator frames(StackFrameIterator::kDontValidateFrames); |
188 StackFrame* frame = frames.NextFrame(); | 207 StackFrame* frame = frames.NextFrame(); |
189 while (frame != NULL) { | 208 while (frame != NULL) { |
190 OS::PrintErr("%s\n", frame->ToCString()); | 209 OS::PrintErr("%s\n", frame->ToCString()); |
191 frame = frames.NextFrame(); | 210 frame = frames.NextFrame(); |
192 } | 211 } |
193 } | 212 } |
194 | 213 |
195 } // namespace dart | 214 } // namespace dart |
OLD | NEW |