diff options
author | Björn Gustavsson <[email protected]> | 2011-08-25 11:25:29 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-08-25 11:25:29 +0200 |
commit | 142700357d3c76aa4c916f0cd5f915a947cbf94c (patch) | |
tree | 3af82388a86d708b3185fc142013a459c0201652 /system/doc/getting_started/seq_prog.xml | |
parent | 756a93ca2064b9e0eba3d82a7bd37aeae0f39be1 (diff) | |
parent | 26cceb7a0718182e74083b4ad044985e8f624ee2 (diff) | |
download | otp-142700357d3c76aa4c916f0cd5f915a947cbf94c.tar.gz otp-142700357d3c76aa4c916f0cd5f915a947cbf94c.tar.bz2 otp-142700357d3c76aa4c916f0cd5f915a947cbf94c.zip |
Merge branch 'bjorn/line-numbers-in-exceptions/OTP-9468' into major
* bjorn/line-numbers-in-exceptions/OTP-9468: (51 commits)
debugger: By default, only save non-tail-recursive calls
debugger: Add line_number_SUITE
debugger: Include line numbers in exceptions
Update examples in the documentation to include line numbers
Update documentation for erlang:raise/3 and erlang:get_stacktrace/0
beam_lib: Retain the "Line" chunk when stripping BEAM files
erl: Add +L to suppress loading of line number information
compiler: Add no_line_info for suppressing line/1 instructions
exception_SUITE: Test line numbers in exceptions
common_test: Use line numbers in exceptions
common_test tests: Don't do detailed testing of the stack backtrace
test_server: Refactor init_per_testcase/3 into two functions
Implement process_info(Pid, current_{location,stacktrace})
beam_emu: Factor out saving of stack trace from save_stacktrace()
compiler: Don't create filenames starting with "./"
ops.tab: Remove line instructions before tail-recursive calls
Lookup and include filenames and line numbers in exceptions
Fix decrement of continuation pointers
Refactor building of the exception stacktrace
BEAM loader: Load the line table
...
Diffstat (limited to 'system/doc/getting_started/seq_prog.xml')
-rw-r--r-- | system/doc/getting_started/seq_prog.xml | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/system/doc/getting_started/seq_prog.xml b/system/doc/getting_started/seq_prog.xml index bc1758d855..96876ea513 100644 --- a/system/doc/getting_started/seq_prog.xml +++ b/system/doc/getting_started/seq_prog.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2003</year><year>2009</year> + <year>2003</year><year>2011</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -41,9 +41,9 @@ <c>erl</c>, you will see something like this.</p> <pre> % <input>erl</input> -Erlang (BEAM) emulator version 5.2 [source] [hipe] +Erlang R15B (erts-5.9.1) [source] [smp:8:8] [rq:8] [async-threads:0] [hipe] [kernel-poll:false] -Eshell V5.2 (abort with ^G) +Eshell V5.9.1 (abort with ^G) 1></pre> <p>Now type in "2 + 5." as shown below.</p> <pre> @@ -245,7 +245,7 @@ convert(N, centimeter) -> inch in the convert function:</p> <pre> 12> <input>tut2:convert(3, miles).</input> -** exception error: no function clause matching tut2:convert(3,miles)</pre> +** exception error: no function clause matching tut2:convert(3,miles) (tut2.erl, line 4)</pre> <p>The two parts of the <c>convert</c> function are called its clauses. Here we see that "miles" is not part of either of the clauses. The Erlang system can't <em>match</em> either of @@ -255,11 +255,13 @@ convert(N, centimeter) -> command <c>v/1</c>:</p> <pre> 13> <input>v(12).</input> -{'EXIT',{function_clause,[{tut2,convert,[3,miles]}, - {erl_eval,do_apply,5}, - {shell,exprs,6}, - {shell,eval_exprs,6}, - {shell,eval_loop,3}]}}</pre> +{'EXIT',{function_clause,[{tut2,convert, + [3,miles], + [{file,"tut2.erl"},{line,4}]}, + {erl_eval,do_apply,5,[{file,"erl_eval.erl"},{line,482}]}, + {shell,exprs,7,[{file,"shell.erl"},{line,666}]}, + {shell,eval_exprs,7,[{file,"shell.erl"},{line,621}]}, + {shell,eval_loop,3,[{file,"shell.erl"},{line,606}]}]}}</pre> </section> @@ -943,7 +945,7 @@ A == 1 ; B == 7 a_equals_1_or_b_equals_7 66> <input>tut9:test_if(33, 33).</input> ** exception error: no true branch found when evaluating an if expression - in function tut9:test_if/2</pre> + in function tut9:test_if/2 (tut9.erl, line 5)</pre> <p>Notice that <c>tut9:test_if(33,33)</c> did not cause any condition to succeed so we got the run time error <c>if_clause</c>, here nicely formatted by the shell. See the chapter |