getting args with erlang:get_stacktrace or similar?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

getting args with erlang:get_stacktrace or similar?

Vans S
When we call erlang:get_stacktrace we can get the function + line where we crashed.

Is there a way to get the arguments the function we crashed in was called, or a way to get the current line we crashed on, what the arguments
are currently?

This would make narrowing down pesky crashes so much easier.
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: getting args with erlang:get_stacktrace or similar?

Lukas Larsson-8
Hello,

On Thu, Mar 30, 2017 at 7:34 PM, Vans S <[hidden email]> wrote:
When we call erlang:get_stacktrace we can get the function + line where we crashed.

Is there a way to get the arguments the function we crashed in was called, or a way to get the current line we crashed on, what the arguments
are currently?

You get that information if the error is a function clause, however if you crash for any other reason (badmatch, badarith, etc) within a function you cannot get that information.

The reason for this is because the compiler may have found that the arguments to the function in which you crashed to be dead and optimized the values away.

Lukas

PS. Sorry for late reply, for some reason the gmail spam filter keeps putting all @yahoo.com e-mails in my spam folder :(

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Loading...