OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 | 5 |
6 #include "vm/ast_printer.h" | 6 #include "vm/ast_printer.h" |
7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
8 #include "vm/debugger.h" | 8 #include "vm/debugger.h" |
9 #include "vm/longjump.h" | 9 #include "vm/longjump.h" |
10 #include "vm/object.h" | 10 #include "vm/object.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 const Dart_CodeLocation& loc) { | 206 const Dart_CodeLocation& loc) { |
207 DebuggerStackTrace* stack = | 207 DebuggerStackTrace* stack = |
208 Isolate::Current()->debugger()->StackTrace(); | 208 Isolate::Current()->debugger()->StackTrace(); |
209 intptr_t num_frames = stack->Length(); | 209 intptr_t num_frames = stack->Length(); |
210 const int kBufferLen = 2048; | 210 const int kBufferLen = 2048; |
211 char* buffer = new char[kBufferLen]; | 211 char* buffer = new char[kBufferLen]; |
212 char* pos = buffer; | 212 char* pos = buffer; |
213 LocalVarDescriptors& var_desc = LocalVarDescriptors::Handle(); | 213 LocalVarDescriptors& var_desc = LocalVarDescriptors::Handle(); |
214 for (intptr_t i = 0; i < num_frames; i++) { | 214 for (intptr_t i = 0; i < num_frames; i++) { |
215 ActivationFrame* frame = stack->FrameAt(i); | 215 ActivationFrame* frame = stack->FrameAt(i); |
216 var_desc = frame->code().var_descriptors(); | 216 var_desc = frame->code().GetLocalVarDescriptors(); |
217 const char* var_str = SkipIndex(var_desc.ToCString()); | 217 const char* var_str = SkipIndex(var_desc.ToCString()); |
218 const char* function_str = String::Handle( | 218 const char* function_str = String::Handle( |
219 frame->function().QualifiedUserVisibleName()).ToCString(); | 219 frame->function().QualifiedUserVisibleName()).ToCString(); |
220 pos += OS::SNPrint(pos, (kBufferLen - (pos - buffer)), | 220 pos += OS::SNPrint(pos, (kBufferLen - (pos - buffer)), |
221 "%s\n%s", | 221 "%s\n%s", |
222 function_str, | 222 function_str, |
223 var_str); | 223 var_str); |
224 delete [] var_str; | 224 delete [] var_str; |
225 } | 225 } |
226 pos[0] = '\0'; | 226 pos[0] = '\0'; |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 "a\n" | 559 "a\n" |
560 " 0 CurrentCtx scope=0 begin=0 end=0" | 560 " 0 CurrentCtx scope=0 begin=0 end=0" |
561 " name=:current_context_var\n" | 561 " name=:current_context_var\n" |
562 " 1 ContextLevel level=1 scope=2 begin=3 end=76\n" | 562 " 1 ContextLevel level=1 scope=2 begin=3 end=76\n" |
563 " 2 ContextVar level=1 begin=9 end=76 name=x\n" | 563 " 2 ContextVar level=1 begin=9 end=76 name=x\n" |
564 " 3 StackVar scope=2 begin=11 end=76 name=b\n", | 564 " 3 StackVar scope=2 begin=11 end=76 name=b\n", |
565 CaptureVarsAtLine(lib, "a", 10)); | 565 CaptureVarsAtLine(lib, "a", 10)); |
566 } | 566 } |
567 | 567 |
568 } // namespace dart | 568 } // namespace dart |
OLD | NEW |