How can I get the position where error was called?

后端 未结 4 932
遇见更好的自我
遇见更好的自我 2021-01-04 11:52

I am looking for something to replace loch (and its preprocessor) since it doesn\'t compile with ghc 7.

Specifically, if error is called then I would l

4条回答
  •  臣服心动
    2021-01-04 12:12

    You can use the -xc RTS option, as described on this page; you need to compile your program with profiling support, and the output is pretty ugly, but it works.

    This should do it:

    $ ghc --make -prof -auto-all myprog.hs
    $ ./myprog +RTS -xc
    

    Technically this only gives a cost centre stack, not a true stack trace. Improved stack trace support is coming in GHC 7.4.

提交回复
热议问题