Hello again,

If using a build script such as follows:

(pushnew :mm-ecl-standalone *features*)
(declaim (optimize (speed 0) (safety 3) (debug 3)))
(compile-file "/path/to/program.lisp" :output-file "/tmp/program.o" :system-p t)
(c::build-program "/tmp/program" :lisp-files '("/tmp/program.o"))
(ext:quit)

And program.lisp contains the following to when invoked call its main function:

#+:mm-ecl-standalone
(defparameter config-file nil)
#+:mm-ecl-standalone
(defun standalone-main ()
  (let ((ext:*lisp-init-file-list* nil))
    (defun help (stream)
      (format stream "~%program [-config <file>]~%")
      (ext:quit 1))

    (defconstant +arg-rules+
      '(("-config" 1 (setf config-file 1))
        ("*DEFAULT*" 0 (help *standard-output*))))

    (handler-case (ext:process-command-args :rules +arg-rules+)
      (error ()
        (help *error-output*)))

    (unless config-file
      (help *error-output*))

    (load config-file)
    (main))) ; XXX Anything special I should do here?
#+:mm-ecl-standalone
(standalone-main) ; XXX Or here?

Then:
$ /tmp/program -config /tmp/config.lisp

Appears to work.  However, I noticed that although in the SLIME REPL
custom-registered restarts are shown and can be used, i.e. at reception
of SIGINT, those restarts are no longer available in the standalone
debugger.

For instance, I have a CONTINUE-LOOP restart, along with a
CONTINUE-RECONNECT one which show up in the SLIME REPL debugger if
issuing SIGINT, but anymore in the standalone executable.

Is there something my program must do to have a normal debugger
including custom restarts when an unhandled condition occurs?

Also, is what I'm doing sane, or would it be best to use the
prologue/epilogue features of c::build-program?

Thanks,
-- 
Matt

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to