Stack trace on error (and packages)

Andrew Cooke andrew@intertrader.com
Wed, 11 Apr 2001 09:09:50 +0100


Hi,

Is it possible to persuade ghc/RTS to provide a stack trace (or
something similar) when an error occurs?  I have some code that is
generating a runtime error (appears to be due to division by
almost-zero, provoking very large numbers and then a NaN in a case
statement when coerced to Double) in a function that is used throughout
my code - it would be a big help to know which function called the
function that is generating the error.

Also, less importantly, how do I generate packages?  I have a bunch of
.o files (modules) all compiled using -package-name and -c, but I can't
find the correct ghc flag to link them into a library (.a/Linux).

Apologies if both/either of these are covered in the docs - I couldn't
find a simple way of getting a stack trace and no info on actually
linking to create a package (when I try various "obvious" things I get
errors indicating a missing main).

Thanks,
Andrew

PS Away from home, so having to use my work address.  Please reply to
the list (which I can read on the 'net and will subscribe to when I get
home) or, if you want to avoid that,
andrew@andrewcooke.free-online.co.uk, which I will read this weekend. 
Work isn't happy about non-work-related emails to this account.  Sorry.