2 # Copyright (C) 2001-2007, The Perl Foundation.
7 use lib qw( . lib ../lib ../../lib );
9 use Parrot::Test tests => 8;
13 t/op/debuginfo.t - Debugging Info
17 % prove t/op/debuginfo.t
21 Tests the various set and get operations for line, package and file info,
22 as well as backtrace tests.
26 pasm_output_like( <<'CODE', <<'OUTPUT', "getline, getfile" );
40 pir_error_output_like( <<'CODE', <<'OUTPUT', "debug backtrace - Null PMC access" );
73 Null PMC access in invoke\(\)
74 current instr\.: 'd' pc (\d+|-1) \(.*?:(\d+|-1)\)
75 called from Sub 'c' pc (\d+|-1) \(.*?:(\d+|-1)\)
76 called from Sub 'b' pc (\d+|-1) \(.*?:(\d+|-1)\)
77 called from Sub 'a' pc (\d+|-1) \(.*?:(\d+|-1)\)
78 called from Sub 'main' pc (\d+|-1) \(.*?:(\d+|-1)\)$/
81 pir_error_output_like( <<'CODE', <<'OUTPUT', "debug backtrace - method not found" );
99 Method 'nosuchmethod' not found for invocant of class 'Integer'
100 current instr.: 'parrot;Test1;foo' pc (\d+|-1) \(.*?:(\d+|-1)\)
101 called from Sub 'parrot;Test1;main' pc (\d+|-1) \(.*?:(\d+|-1)\)$/
104 pir_error_output_like( <<'CODE', <<'OUTPUT', "debug backtrace - fetch of unknown lexical" );
113 find_lex $P0, "nosuchlex"
119 Lexical 'nosuchlex' not found
120 current instr.: 'parrot;Test2;foo' pc (\d+|-1) \(.*?:(\d+|-1)\)
121 called from Sub 'parrot;Test2;main' pc (\d+|-1) \(.*?:(\d+|-1)\)$/
125 # in plain functional run-loop result is 999
126 # other run-loops report 998
127 # investigate this after interpreter strtup is done
128 # see also todo item in src/embed.c
129 pir_error_output_like( <<'CODE', <<'OUTPUT', "debug backtrace - recursion 1" );
134 /^maximum recursion depth exceeded
135 current instr\.: 'main' pc (\d+|-1) \(.*?:(\d+|-1)\)
136 called from Sub 'main' pc (\d+|-1) \(.*?:(\d+|-1)\)
137 \.\.\. call repeated 1000 times/
140 pir_error_output_like( <<'CODE', <<'OUTPUT', "debug backtrace - recursion 2" );
155 /^Null PMC access in invoke\(\)
156 current instr\.: 'rec' pc (\d+|-1) \(.*?:(\d+|-1)\)
157 called from Sub 'rec' pc (\d+|-1) \(.*?:(\d+|-1)\)
158 \.\.\. call repeated 90 times
159 called from Sub 'main' pc (\d+|-1) \(.*?:(\d+|-1)\)$/
162 pir_error_output_like( <<'CODE', <<'OUTPUT', "setfile and setline", todo => "#RT43269" );
168 'no_such_function'($S0, $I0)
174 pir_error_output_like( <<'CODE', <<'OUTPUT', "setfile and setline", todo => "#RT43269" );
183 $P0 = get_global '$a'
194 # cperl-indent-level: 4
197 # vim: expandtab shiftwidth=4: