Changeset 4070
- Timestamp:
- 09/26/03 15:04:46 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/LispThread.java
r4051 r4070 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: LispThread.java,v 1.1 4 2003-09-25 15:37:08piso Exp $5 * $Id: LispThread.java,v 1.15 2003-09-26 15:04:46 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 226 226 public void backtrace() 227 227 { 228 backtrace(0); 229 } 230 231 public void backtrace(int limit) 232 { 228 233 if (stack.size() > 0) { 229 234 CharacterOutputStream out = getTraceOutput(); 235 int count = 0; 230 236 try { 231 237 out.writeLine("Evaluation stack:"); … … 248 254 out.terpri(); 249 255 out.flushOutput(); 256 if (limit > 0 && ++count == limit) 257 break; 250 258 } 251 259 } … … 392 400 } 393 401 }; 402 403 // ### backtrace 404 private static final Primitive BACKTRACE = 405 new Primitive("backtrace", PACKAGE_EXT, true) 406 { 407 public LispObject execute(LispObject[] args) 408 throws ConditionThrowable 409 { 410 if (args.length > 1) 411 throw new ConditionThrowable(new WrongNumberOfArgumentsException(this)); 412 int count = args.length > 0 ? Fixnum.getValue(args[0]) : 0; 413 LispThread thread = currentThread(); 414 thread.backtrace(count); 415 return thread.nothing(); 416 } 417 }; 394 418 }
Note: See TracChangeset
for help on using the changeset viewer.