From: Neil Jerram <neil@ossau.uklinux.net>
Cc: guile-user <guile-user@gnu.org>
Subject: Re: saving and restoring the error stack trace
Date: Fri, 01 Sep 2006 08:47:13 +0100 [thread overview]
Message-ID: <87veo8av0e.fsf@ossau.uklinux.net> (raw)
In-Reply-To: <J4UM88$884C91E0A85D995ECDC3E183F7F5D8B0@poste.it> (Marco Maggi's message of "Thu, 31 Aug 2006 08:04:56 +0200")
"Marco Maggi" <marco.maggi-ipsu@poste.it> writes:
> Making the stack with this:
>
> s_error_stack = scm_make_stack(SCM_BOOL_T, SCM_EOL);
>
> and using the function (scm_t = SCM): [...]
>
> I have error messages like:
>
> Backtrace:
> In unknown file:
> ?: 0* [dotest "gsl-ode-error-2.4" #<procedure #f ()> ...]
> ?: 1 (let* () (let* (# #) (let* # #)))
> ...
> ?: 2 (begin (display name) (if (thunk? setup) (setup)) ...)
> ?: 3* (let (# # # ...) (set-current-input-port saved-in) ...)
> ?: 4* (if catch-error (catch #t thunk (lambda (key .
> args) key)) (thunk))
> ?: 5 [#<procedure #f ()>]
> ...
> ?: 6 (let* ((result (quote ()))) (if debugging
> (newline)) ...)
> ?: 7* [gsl-ode-evolve #<universal GSL SMOB 404697f8>
> #:initial-indep-value ...]
> ?: 8 (let-keywords args #f ...)
> ...
> ?: 9 [gsl-p-ode-evolve #<universal GSL SMOB 404697f8>
> 0.0 ...]
>
> <unnamed port>: In procedure gsl-ode-evolve in expression
> (gsl-p-ode-evolve ode initial-indep-value ...):
> <unnamed port>: my error message 1 and 2
> In unknown file:
> ?: 10* [#<procedure #f (t y)> 0.0 #,(gsl-vector-real 1 2.0)]
> ?: 11* [gsl-ode-invoke-fun 0.0 #,(gsl-vector-real 1 2.0) ...]
> ?: 12 (let* ((o (func t #))) (if (gsl? o) (slot-ref o
> (quote v)) ...))
> ?: 13* [#<procedure #f (t y)> 0.0 #,(gvr 1 2.0)]
> ?: 14 [throwing-error]
> ...
> ?: 15 [scm-error my-own-error "sub-throwing-error" ...]
>
> which is not perfect but seems good enough for me.
OK. Out of interest, though, what changes would you like to the
presentation? (And, to ask a leading question, do you think that the
way my Emacs interface displays the stack is better or worse than
this? http://www.ossau.uklinux.net/guile/debugging-demo/shot2.html)
> I am a little annoyed that I have to use a port to
> build the backtrace string,
That just needs getting used to; I'd say that ports are a fantastic
abstraction. And the C API for a string port is very easy to use,
isn't it?
> and that the args content
> is not explicitly documented (that is, I was not
> able to find it) even if its content is well defined
> in 'scm_error_scm()':
>
> scm_ithrow (key,
> scm_list_4 (subr, message, args, data), 1);
Yes, here I completely agree with you. I've been wondering what to do
about this for ages. Do you think it can be solved adequately by
precise documentation, or do we need some way of describing the
expected throw args in code; perhaps even construct some kind of
object model around the args with methods for getting the useful bits
of information out? (Use of which would be optional.)
Regards,
Neil
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
next prev parent reply other threads:[~2006-09-01 7:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-31 6:04 saving and restoring the error stack trace Marco Maggi
2006-09-01 7:47 ` Neil Jerram [this message]
2006-09-01 9:39 ` Ludovic Courtès
2006-09-07 22:11 ` Neil Jerram
2006-09-12 12:21 ` Exception handling Ludovic Courtès
-- strict thread matches above, loose matches on Subject: below --
2006-09-01 20:10 saving and restoring the error stack trace Marco Maggi
2006-08-29 3:08 dsmich
2006-09-01 7:34 ` Neil Jerram
2006-08-25 9:39 Marco Maggi
2006-08-27 12:53 ` Neil Jerram
2006-08-28 22:21 ` Neil Jerram
2006-09-07 9:02 ` Volkan YAZICI
2006-09-07 21:36 ` Neil Jerram
2006-09-08 6:09 ` Volkan YAZICI
2006-08-24 19:34 Marco Maggi
2006-08-24 21:53 ` Neil Jerram
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87veo8av0e.fsf@ossau.uklinux.net \
--to=neil@ossau.uklinux.net \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).