backtracer 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +16 -87
- data/VERSION +1 -1
- data/examples/crash.rb +2 -3
- metadata +3 -4
- data/lib/backtracer_tracer.rb +0 -3
- /data/lib/{backtracer_locals.rb → backtracer_all.rb} +0 -0
data/README
CHANGED
@@ -1,16 +1,14 @@
|
|
1
|
-
ruby_backtracer: output higher quality backtraces if an unhandled exception
|
1
|
+
ruby_backtracer: a library to output higher quality backtraces if an unhandled exception is raised
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
ex:
|
6
|
-
a script used to output:
|
3
|
+
ex:
|
4
|
+
running given script examples/crash.rb used to output:
|
7
5
|
examples>ruby crash.rb
|
8
6
|
crash.rb:2:in `go2': unhandled exception
|
9
7
|
from crash.rb:6:in `go'
|
10
8
|
from crash.rb:9
|
11
9
|
|
12
|
-
|
13
|
-
examples>ruby -
|
10
|
+
now outputs:
|
11
|
+
examples>ruby -r../backtrace_with_code_and_locals crash.rb
|
14
12
|
|
15
13
|
unhandled exception: crash.rb:2: raise
|
16
14
|
locals: {"a"=>"3", "b"=>55}
|
@@ -19,92 +17,23 @@ unhandled exception: crash.rb:2: raise
|
|
19
17
|
locals: {"a"=>"3", "b"=>55}
|
20
18
|
crash.rb:5 go(a=>3)
|
21
19
|
locals: {"a"=>"3"}
|
22
|
-
or
|
23
|
-
examples>ruby -rbacktracer crash.rb
|
24
|
-
====
|
25
|
-
crash.rb:2:in `go2'
|
26
|
-
raise
|
27
|
-
crash.rb:7:in `go'
|
28
|
-
go2(a, 55)
|
29
|
-
crash.rb:10
|
30
|
-
go '3'
|
31
|
-
====
|
32
|
-
crash.rb:2:in `go2': unhandled exception
|
33
|
-
from crash.rb:7:in `go'
|
34
|
-
from crash.rb:10
|
35
|
-
|
36
|
-
|
37
|
-
All the options are backtracer, backtracer_locals, backtracer_simple, backtracer_tracer
|
38
|
-
|
39
|
-
|
40
|
-
== Installation ==
|
41
|
-
|
42
|
-
== 1.9 ==
|
43
|
-
|
44
|
-
$ gem install ruby-debug19
|
45
|
-
$ gem sources add http://gemcutter.org # if necessary
|
46
|
-
$ gem install backtracer
|
47
|
-
|
48
|
-
run as above
|
49
|
-
$ ruby -rbacktracer script_name
|
50
|
-
|
51
|
-
== 1.8.x ==
|
52
|
-
|
53
|
-
$ gem install ruby-debug
|
54
|
-
$ gem sources add http://gemcutter.org # if necessary
|
55
|
-
$ sudo gem install faster_rubygems # necessary to be able to load gems from the command line -- installs the file rubygemsf into your site_ruby
|
56
|
-
$ gem install backtracer
|
57
|
-
|
58
|
-
now run them like
|
59
|
-
$ ruby -rubygemsf -rbacktracer script_name
|
60
|
-
|
61
|
-
the rubygemsf is necessary because for some reason running
|
62
|
-
$ ruby -rubygems -rbacktracer script_name
|
63
|
-
|
64
|
-
fails [probably a bug in ruby]
|
65
|
-
|
66
|
-
== Descriptions ==
|
67
|
-
|
68
|
-
Try these out if desired:
|
69
|
-
create a file like:
|
70
|
-
|
71
|
-
def go(a)
|
72
|
-
raise
|
73
|
-
end
|
74
|
-
go(3)
|
75
|
-
|
76
|
-
then run ruby against it like
|
77
|
-
|
78
|
-
ruby -rbacktracer name
|
79
|
-
outputs full backtrace with code of each line [a la Python]
|
80
|
-
ruby -rbacktracer_locals name
|
81
|
-
outputs full backtrace with local variables and parameters
|
82
|
-
ruby -rbacktracer_simple name
|
83
|
-
outputs backtrace without the ...24 levels... [yea!]
|
84
|
-
ruby -backtracer_tracer name
|
85
|
-
same as backtracer_locals except it shows traces of calls as they're made
|
86
|
-
|
87
|
-
|
88
|
-
or in 1.8.x
|
89
|
-
ruby -rubygemsf -rbacktracer name
|
90
|
-
etc.
|
91
20
|
|
21
|
+
Now wasn't that prettier?
|
92
22
|
|
93
|
-
|
23
|
+
There are several other tracing options provided, if you don't want as much output, or want more speed. Specify which by script name.
|
94
24
|
|
95
|
-
|
96
|
-
|
25
|
+
ex: backtrace_nothing_swallowed.rb outputs the same as the default exception output, except it doesn't have the
|
26
|
+
...skip 24 lines...
|
27
|
+
line in the middle (also no speed slowdown, and no local variables displayed).
|
97
28
|
|
98
|
-
|
29
|
+
Try them out by running test_all.rb in the examples folder, or eyeball the example output files in examples/example_output*
|
99
30
|
|
100
|
-
|
101
|
-
$ export RUBYOPT=-rbacktracer
|
31
|
+
http://github.com/rogerdpack/ruby_backtracer/tree/master
|
102
32
|
|
103
|
-
|
33
|
+
Note: some options depends on ruby-debug [MRI] gem, some don't.
|
104
34
|
|
105
|
-
|
106
|
-
unroller, http://eigenclass.org/hiki/method+arguments+via+introspection, liveconsole, ruby-debug
|
35
|
+
To install clone from github, above, then ruby -rscriptname your_script.
|
107
36
|
|
108
|
-
|
37
|
+
related projects: unroller, http://eigenclass.org/hiki/method+arguments+via+introspection, liveconsole, ruby-debug
|
109
38
|
|
110
|
-
|
39
|
+
send comments to rogerdpack on github.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
data/examples/crash.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backtracer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors: []
|
7
7
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-29 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -32,9 +32,8 @@ files:
|
|
32
32
|
- examples/run_all_styles_of_backtracer.rb
|
33
33
|
- examples/run_large_style_output.rb
|
34
34
|
- lib/backtracer.rb
|
35
|
-
- lib/
|
35
|
+
- lib/backtracer_all.rb
|
36
36
|
- lib/backtracer_simple.rb
|
37
|
-
- lib/backtracer_tracer.rb
|
38
37
|
- lib/core_backtracer.rb
|
39
38
|
has_rdoc: true
|
40
39
|
homepage:
|
data/lib/backtracer_tracer.rb
DELETED
File without changes
|