OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-binutils/] [binutils-2.19.1/] [cgen/] [guile.scm] - Rev 6

Compare with Previous | Blame | View Log

; Guile-specific functions.
; Copyright (C) 2000, 2004, 2009 Red Hat, Inc.
; This file is part of CGEN.
; See file COPYING.CGEN for details.
; eval takes a module argument in 1.6 and later
; symbol-bound? is deprecated in 1.6
"must pass #f for symbol-bound? first arg"; FIXME: Not sure this is 100% correct.
;(load-from-path file)
; FIXME: to be deleted
; Guile 1.3 has reverse!, Guile 1.2 has list-reverse!.
; CGEN uses reverse!
;; Guile 1.8 no longer has "." in %load-path so relative path loads
;; no longer work.
".";;; Enabling and disabling debugging features of the host Scheme.
;;; For the initial load proces, turn everything on.  We'll disable it
;;; before we start doing the heavy computation.
;;; Call THUNK, with debugging enabled if FLAG is true, or disabled if
;;; FLAG is false.
;;;
;;; (On systems other than Guile, this needn't actually do anything at
;;; all, beyond calling THUNK, so long as your backtraces are still
;;; helpful.  In Guile, the debugging evaluator is slower, so we don't
;;; want to use it unless the user asked for it.)
;; Now, make that debugging / no-debugging setting actually take
;; effect.
;;
;; Guile has two separate evaluators, one that does the extra
;; bookkeeping for backtraces, and one which doesn't, but runs
;; faster.  However, the evaluation process (in either evaluator)
;; ordinarily never consults the variable that says which evaluator
;; to use: whatever evaluator was running just keeps rolling along.
;; There are certain primitives, like some of the eval variants,
;; that do actually check.  start-stack is one such primitive, but
;; we don't want to shadow whatever other stack id is there, so we
;; do all the real work in the ID argument, and do nothing in the
;; EXP argument.  What a kludge.
;;; Apply PROC to ARGS, marking that application as the bottom of the
;;; stack for error backtraces.
;;;
;;; (On systems other than Guile, this doesn't really need to do
;;; anything other than apply PROC to ARGS, as long as something
;;; ensures that backtraces will work right.)
;; Naming this procedure, rather than using an anonymous lambda,
;; allows us to pass less fragile cut info to save-stack.
;;(display args (current-error-port))
;;(newline (current-error-port))
;; display-error takes 6 arguments.
;; If `quit' is called from elsewhere, it may not have 6
;; arguments.  Not sure how best to handle this.
;; Grab a copy of the current stack,
;; Apply proc to args, and if any uncaught exception is thrown, call
;; handler WITHOUT UNWINDING THE STACK (that's the 'lazy' part).  We
;; need the stack left alone so we can produce a backtrace.
;; I have no idea why the 'load-stack' stack mark is
;; not still present on the stack; we're still loading
;; cgen-APP.scm, aren't we?  But stack-id returns #f
;; in handler if we don't do a start-stack here.
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.