2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,6 +1,14 @@
|
|||
Many programming languages allow for introspection of the current call stack environment. This can be for a variety of purposes such as enforcing security checks, debugging, or for getting access to the stack frame of callers.
|
||||
|
||||
This task calls for you to print out (in a manner considered suitable for the platform) the current call stack. The amount of information printed for each frame on the call stack is not constrained, but should include at least the name of the function or method at that level of the stack frame. You may explicitly add a call to produce the stack trace to the (example) code being instrumented for examination.
|
||||
|
||||
The task should allow the program to continue after generating the stack trace. The task report here must include the trace from a sample program.
|
||||
<br clear=all>
|
||||
;Task:
|
||||
Print out (in a manner considered suitable for the platform) the current call stack.
|
||||
|
||||
The amount of information printed for each frame on the call stack is not constrained, but should include at least the name of the function or method at that level of the stack frame.
|
||||
|
||||
You may explicitly add a call to produce the stack trace to the (example) code being instrumented for examination.
|
||||
|
||||
The task should allow the program to continue after generating the stack trace.
|
||||
|
||||
The task report here must include the trace from a sample program.
|
||||
<br><br>
|
||||
|
|
|
|||
25
Task/Stack-traces/Elixir/stack-traces.elixir
Normal file
25
Task/Stack-traces/Elixir/stack-traces.elixir
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
defmodule Stack_traces do
|
||||
def main do
|
||||
{:ok, a} = outer
|
||||
IO.inspect a
|
||||
end
|
||||
|
||||
defp outer do
|
||||
{:ok, a} = middle
|
||||
{:ok, a}
|
||||
end
|
||||
|
||||
defp middle do
|
||||
{:ok, a} = inner
|
||||
{:ok, a}
|
||||
end
|
||||
|
||||
defp inner do
|
||||
try do
|
||||
throw(42)
|
||||
catch 42 -> {:ok, :erlang.get_stacktrace}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Stack_traces.main
|
||||
Loading…
Add table
Add a link
Reference in a new issue