Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: runtime/vm/parser_test.cc

Issue 265853003: $-indexed printf params don't work on all of our architectures, turns out. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 DebuggerStackTrace* stack = 205 DebuggerStackTrace* stack =
206 Isolate::Current()->debugger()->StackTrace(); 206 Isolate::Current()->debugger()->StackTrace();
207 intptr_t num_frames = stack->Length(); 207 intptr_t num_frames = stack->Length();
208 const int kBufferLen = 2048; 208 const int kBufferLen = 2048;
209 char* buffer = new char[kBufferLen]; 209 char* buffer = new char[kBufferLen];
210 char* pos = buffer; 210 char* pos = buffer;
211 LocalVarDescriptors& var_desc = LocalVarDescriptors::Handle(); 211 LocalVarDescriptors& var_desc = LocalVarDescriptors::Handle();
212 for (intptr_t i = 0; i < num_frames; i++) { 212 for (intptr_t i = 0; i < num_frames; i++) {
213 ActivationFrame* frame = stack->FrameAt(i); 213 ActivationFrame* frame = stack->FrameAt(i);
214 var_desc = frame->code().var_descriptors(); 214 var_desc = frame->code().var_descriptors();
215 const char* var_str = var_desc.ToCString(); 215 const char* var_str = SkipIndex(var_desc.ToCString());
216 char* edited_var_str = SkipIndex(var_str);
217 pos += OS::SNPrint(pos, (kBufferLen - (pos - buffer)), 216 pos += OS::SNPrint(pos, (kBufferLen - (pos - buffer)),
218 "%s\n%s", 217 "%s\n%s",
219 frame->function().ToQualifiedCString(), 218 frame->function().ToQualifiedCString(),
220 (edited_var_str != NULL ? edited_var_str :var_str)); 219 var_str);
221 delete [] edited_var_str; 220 delete [] var_str;
222 } 221 }
223 pos[0] = '\0'; 222 pos[0] = '\0';
224 saved_vars = buffer; 223 saved_vars = buffer;
225 } 224 }
226 225
227 226
228 // Uses the debugger to pause the program and capture the variable 227 // Uses the debugger to pause the program and capture the variable
229 // descriptors for all frames on the stack. 228 // descriptors for all frames on the stack.
230 static const char* CaptureVarsAtLine(Dart_Handle lib, 229 static const char* CaptureVarsAtLine(Dart_Handle lib,
231 const char* entry, 230 const char* entry,
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 // https://code.google.com/p/dart/issues/detail?id=18561 482 // https://code.google.com/p/dart/issues/detail?id=18561
484 "::.outer\n" 483 "::.outer\n"
485 " 0 StackVar scope=3 begin=9 end=50 name=i\n" 484 " 0 StackVar scope=3 begin=9 end=50 name=i\n"
486 " 1 ContextLevel level=1 scope=4 begin=20 end=50\n" 485 " 1 ContextLevel level=1 scope=4 begin=20 end=50\n"
487 " 2 ContextVar level=1 begin=23 end=50 name=value\n" 486 " 2 ContextVar level=1 begin=23 end=50 name=value\n"
488 " 3 StackVar scope=4 begin=30 end=50 name=inner\n", 487 " 3 StackVar scope=4 begin=30 end=50 name=inner\n",
489 CaptureVarsAtLine(lib, "outer", 5)); 488 CaptureVarsAtLine(lib, "outer", 5));
490 } 489 }
491 490
492 } // namespace dart 491 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698