rbtrace 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -3,7 +3,8 @@
3
3
  rbtrace shows you method calls happening inside another ruby process in real
4
4
  time.
5
5
 
6
- rbtrace works on ruby 1.8 and 1.9, running on linux or mac osx.
6
+ rbtrace works on ruby 1.8 through 2.2 (and beyond), running on linux or mac
7
+ osx.
7
8
 
8
9
  rbtrace is designed to have minimal overhead, and should be safe to run
9
10
  in production.
@@ -197,4 +198,3 @@ for popular ruby libraries and functions.
197
198
  * add special expressions for method args (_arg0_, _arguments_)
198
199
  * optimize local variable lookup to avoid instance_eval
199
200
  * investigate mach_msg on osx since msgget(2) has hard kernel limits
200
-
@@ -39,6 +39,9 @@
39
39
  #ifndef RSTRING_LEN
40
40
  #define RSTRING_LEN(str) RSTRING(str)->len
41
41
  #endif
42
+ #ifndef RBASIC_CLASS
43
+ #define RBASIC_CLASS(obj) (RBASIC(obj)->klass)
44
+ #endif
42
45
 
43
46
 
44
47
  #ifdef __FreeBSD__
@@ -322,7 +322,7 @@ EOS
322
322
  if opts[:exec_given]
323
323
  tracee = fork{
324
324
  Process.setsid
325
- ENV['RUBYOPT'] = "-r#{File.expand_path('../../lib/rbtrace',__FILE__)}"
325
+ ENV['RUBYOPT'] = "-r#{File.expand_path('../../rbtrace',__FILE__)}"
326
326
  exec(*opts[:exec])
327
327
  }
328
328
  STDERR.puts "*** spawned child #{tracee}: #{opts[:exec].inspect[1..-2]}"
@@ -246,16 +246,22 @@ class RBTracer
246
246
 
247
247
  # Process events from the traced process.
248
248
  #
249
- # Returns nothing.
249
+ # Returns nothing
250
250
  def recv_loop
251
251
  while true
252
- # block until a message arrives
253
- process_line(recv_cmd)
252
+ ready = IO.select([@sock], nil, nil, 1)
253
+
254
+ if ready
255
+ # block until a message arrives
256
+ process_line(recv_cmd)
257
+ # process any remaining messages
258
+ recv_lines
259
+ else
260
+ Process.kill(0, @pid)
261
+ end
254
262
 
255
- # process any remaining messages
256
- recv_lines
257
263
  end
258
- rescue Errno::EINVAL, Errno::EIDRM
264
+ rescue Errno::EINVAL, Errno::EIDRM, Errno::ESRCH
259
265
  # process went away
260
266
  end
261
267
 
@@ -1,3 +1,3 @@
1
1
  class RBTracer
2
- VERSION = '0.4.6'
2
+ VERSION = '0.4.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbtrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-23 00:00:00.000000000 Z
12
+ date: 2015-02-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi