better error reporting from the vm
authorAndy Wingo <wingo@pobox.com>
Thu, 15 Jul 2010 10:44:15 +0000 (12:44 +0200)
committerAndy Wingo <wingo@pobox.com>
Thu, 15 Jul 2010 10:44:15 +0000 (12:44 +0200)
commit41e49280f37c350106719d8377a4dc2390caf0a7
treeeacca18c876dbc20ee42ef592d79459a67bcbf32
parent867961f9798d2d6ce398e2d14f8a9dc01cf20ae7
better error reporting from the vm

* libguile/vm-engine.c: Add func_name local, for error reporting.
  (vm_error_apply_to_non_list): New error case.
  (vm_error_wrong_type_arg): Remove this generic error case.
  (vm_error_wrong_type_apply): Remove FUNC_NAME -- no sense in seeing
  "vm-debug-engine" in the error report.
  (vm_error_not_a_pair, vm_error_not_a_bytevector)
  (vm_error_not_a_struct, vm_error_not_a_thunk): Use func_name instead
  of FUNC_NAME, so we can indicate what caused the error.

* libguile/vm-i-scheme.c (VM_VALIDATE_CONS, car, cdr, set-car!)
  (set-cdr!): Indicate provenance of errors.
  (VM_VALIDATE_STRUCT, struct-vtable):
  (VM_VALIDATE_BYTEVECTOR, BV_FIXABLE_INT_REF, BV_INT_REF)
  (BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET, BV_FLOAT_SET): Same.

* libguile/vm-i-system.c (apply, tail-apply): Use
  vm_error_apply_to_non_list.
libguile/vm-engine.c
libguile/vm-i-scheme.c
libguile/vm-i-system.c