How to show Erlang call stack?

前端 未结 4 809
耶瑟儿~
耶瑟儿~ 2021-02-14 18:06

I need to debug some module in foreign system. The module has public function foo() - how can I know place (module and function name) from which foo() given module

4条回答
  •  甜味超标
    2021-02-14 18:44

    Here's a simple trick:

    Trace = try throw(42) catch 42 -> erlang:get_stacktrace() end,
    erlang:display(Trace)
    

提交回复
热议问题