[Haskell-cafe] GHC debug plugin

Vanessa McHale vamchale at gmail.com
Sun Dec 12 20:53:51 UTC 2021


Have you tried the -xc flag yet?

If you do a profiling build and then run your program with +RTS -xc it
will give a stack trace on exceptions.

(I think your idea still has some content but ^ is easier because it
already exists!)

On 12/12/21 2:01 PM, Daneel Yaitskov wrote:
> Hi,
>
> I would like to enable stack traces at launch time and run program
> without HasCallStack overhead by default.
> I've got an idea to use GHC plugin which would duplicate all functions
> in modules with specified prefix. Duplicated functions should get
> disambiguating prefix (e.g. "debug") and HasCallStack constraint.
> Bodies of prefixed functions should be rewritten to use prefixed
> functions from matching modules (should be easy to do - hook just
> after renaming GHC phase when all names are fully qualified?).
>
> This way main function could choose "runLib" or "debugRunLib".
>
> Did anybody make something similar?
>
>
>
> -- 
>
> Best regards,
> Daniil Iaitskov
>  
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20211212/b8b573ed/attachment.html>


More information about the Haskell-Cafe mailing list