rbtrace 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Gemfile.lock +1 -1
  2. data/bin/rbtrace +11 -21
  3. data/rbtrace.gemspec +1 -1
  4. metadata +2 -2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbtrace (0.3.7)
4
+ rbtrace (0.3.8)
5
5
  ffi (>= 1.0.5)
6
6
  msgpack (>= 0.4.3)
7
7
  trollop (>= 1.16.2)
data/bin/rbtrace CHANGED
@@ -24,7 +24,7 @@ end
24
24
 
25
25
  module MsgQ
26
26
  extend FFI::Library
27
- ffi_lib 'c'
27
+ ffi_lib FFI::CURRENT_PROCESS
28
28
 
29
29
  class EventMsg < FFI::Struct
30
30
  BUF_SIZE = RUBY_PLATFORM =~ /linux/ ? 256 : 120
@@ -43,7 +43,7 @@ module MsgQ
43
43
  end
44
44
 
45
45
  def self.recv_cmd(q, block=true)
46
- MsgQ.enable_interrupt if RUBY_VERSION > '1.9'
46
+ MsgQ.rb_enable_interrupt if RUBY_VERSION > '1.9'
47
47
 
48
48
  msg = EventMsg.new
49
49
  ret = MsgQ.msgrcv(q, msg, BUF_SIZE, 0, block ? 0 : IPC_NOWAIT)
@@ -57,28 +57,18 @@ module MsgQ
57
57
 
58
58
  msg[:buf].to_ptr.read_string_length(BUF_SIZE)
59
59
  ensure
60
- MsgQ.disable_interrupt if RUBY_VERSION > '1.9'
61
- end
62
- end
63
-
64
- if RUBY_VERSION > '1.9'
65
- require 'fiddle'
66
-
67
- handle = DL::Handle.new
68
- @enable_interrupt = Fiddle::Function.new(handle['rb_enable_interrupt'], [], DL::TYPE_VOID)
69
- @disable_interrupt = Fiddle::Function.new(handle['rb_disable_interrupt'], [], DL::TYPE_VOID)
70
-
71
- def self.enable_interrupt
72
- @enable_interrupt.call
73
- end
74
- def self.disable_interrupt
75
- @disable_interrupt.call
60
+ MsgQ.rb_disable_interrupt if RUBY_VERSION > '1.9'
76
61
  end
77
62
  end
78
63
 
79
64
  attach_function :msgget, [:int, :int], :int
80
65
  attach_function :msgrcv, [:int, EventMsg.ptr, :size_t, :long, :int], :int
81
66
  attach_function :msgsnd, [:int, EventMsg.ptr, :size_t, :int], :int
67
+
68
+ if RUBY_VERSION > '1.9'
69
+ attach_function :rb_enable_interrupt, [], :void
70
+ attach_function :rb_disable_interrupt, [], :void
71
+ end
82
72
  end
83
73
 
84
74
  class RBTracer
@@ -318,8 +308,8 @@ class RBTracer
318
308
  rescue Errno::EINVAL, Errno::EIDRM
319
309
  newline
320
310
  STDERR.puts "*** process #{pid} is gone"
321
- STDERR.puts "*** #{$!.inspect}"
322
- STDERR.puts $!.backtrace.join("\n ")
311
+ # STDERR.puts "*** #{$!.inspect}"
312
+ # STDERR.puts $!.backtrace.join("\n ")
323
313
  rescue Interrupt, SignalException
324
314
  retry
325
315
  end
@@ -635,7 +625,7 @@ class RBTracer
635
625
  parser = Trollop::Parser.new do
636
626
  version <<-EOS
637
627
  rbtrace: like strace, but for ruby code
638
- version 0.3.7
628
+ version 0.3.8
639
629
  (c) 2011 Aman Gupta (tmm1)
640
630
  http://github.com/tmm1/rbtrace
641
631
  EOS
data/rbtrace.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'rbtrace'
3
- s.version = '0.3.7'
3
+ s.version = '0.3.8'
4
4
  s.homepage = 'http://github.com/tmm1/rbtrace'
5
5
 
6
6
  s.authors = 'Aman Gupta'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 7
9
- version: 0.3.7
8
+ - 8
9
+ version: 0.3.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Aman Gupta