Skip to content

Instantly share code, notes, and snippets.

@febeling
Created March 19, 2009 13:40
Show Gist options
  • Save febeling/81819 to your computer and use it in GitHub Desktop.
Save febeling/81819 to your computer and use it in GitHub Desktop.
Macros for displaying stacktrace information in erlang
-define(callstack(),
try throw(generate_stack)
catch
throw:generate_stack ->
erlang:get_stacktrace()
end).
-define(printstack(),
PrintFrame = fun({Mod, Fun, Ari}) ->
io:format(" at ~w:~w/~w~n", [Mod, Fun, Ari])
end,
lists:map(PrintFrame, ?callstack())).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment