rbx-tracer 0.0.3-universal-rubinius-1.2 → 0.0.4-universal-rubinius-1.2

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,27 @@
1
+ 2011-01-24 rocky <rockyb@rubyforge.org>
2
+
3
+ * .gemspec, ChangeLog, LICENSE, NEWS, README, README.textile,
4
+ lib/script_lines.rb, lib/set_trace.rb: Update doc on SCRIPT_LINES__.
5
+ Get ready for release.
6
+
7
+ 2011-01-24 rocky <rockyb@rubyforge.org>
8
+
9
+ * .gemspec, lib/script_lines.rb: Handle require's better.
10
+
11
+ 2011-01-23 rocky <rockyb@rubyforge.org>
12
+
13
+ * README: The English she is so hard for me.
14
+
15
+ 2011-01-23 rocky <rockyb@rubyforge.org>
16
+
17
+ * README, lib/script_lines.rb, lib/set_trace.rb,
18
+ test/test-script-lines.rb: Add MRI 1.8/1.9 SCRIPT_LINES__
19
+ compatibilty. require may be broken but load works.
20
+
21
+ 2011-01-01 rocky <rockyb@rubyforge.org>
22
+
23
+ * ChangeLog, NEWS, lib/set_trace.rb: Update for release
24
+
1
25
  2010-12-31 rocky <rockyb@rubyforge.org>
2
26
 
3
27
  * .gemspec, Rakefile: Rakefile: Add 1.2.0 in test for Rubinius
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010, Rocky Bernstein
1
+ Copyright (c) 2010, 2011 Rocky Bernstein
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
data/NEWS CHANGED
@@ -1,3 +1,6 @@
1
+ 2011-01-01 0.0.4
2
+ * Add MRI's SCRIPT_LINES__ hash constant handling.
3
+
1
4
  2011-01-01 0.0.3
2
5
  * packaging fixed.
3
6
 
@@ -0,0 +1,24 @@
1
+ Simulate Ruby 1.8, 1.9, JRuby's _set_trace_func_ and SCRIPT_LINES__ in Rubinius.
2
+
3
+ What is method __Kernel#set_trace_func__ and constant SCRIPT_LINES___ ?
4
+
5
+ __set_trace_func(proc)__ establishes _proc_ as the handler for tracing or disables tracing if the parameter is _nil_.
6
+
7
+ if constaint __SCRIPT_LINES____ is defined and references a Hash, Ruby will store an entry containing the contents of each Ruby file it loads. The key for each hash entry is the file loaded as given by Ruby meta-constant "__FILE__" and the value is an Array of Strings with newlines containing the file contents.
8
+
9
+ Example of __set_trace_func__ :
10
+
11
+ bc. require 'rubygems'; require 'set_trace'
12
+ meth = lambda { |event, file, line, id, binding, classname|
13
+ puts "tracer: #{event} #{file}:#{line}"
14
+ }
15
+ set_trace_func meth
16
+
17
+
18
+ Example of SCRIPT_LINES__ :
19
+
20
+ bc. require 'rubygems'; require 'script_lines'
21
+ SCRIPT_LINES__ = {}
22
+ load 'foo.rb'
23
+ # SCRIPT_LINES__ should have 'foo.rb' as a key and file contents as an Array
24
+ # if it the 'foo.rb' loaded successfully.
data/THANKS CHANGED
@@ -1,2 +1,2 @@
1
- This code is a distillation of the stepping code in the Rubinius
1
+ The stepping code is a distillation of the stepping code in the Rubinius
2
2
  reference debugger written by Evan Phoenix and Brian Ford.
@@ -0,0 +1,35 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net>
3
+ # A Rubinius implementation of set_trace_func.
4
+ # Compatibility with MRI 1.8 and 1.9 SCRIPT_LINES__
5
+ def script_lines__(path)
6
+ if defined?(SCRIPT_LINES__) && SCRIPT_LINES__.is_a?(Hash)
7
+ begin
8
+ code_loader = Rubinius::CodeLoader.new(path)
9
+ begin
10
+ code_loader.resolve_load_path
11
+ load_path = code_loader.instance_variable_get('@load_path') ||
12
+ File.expand_path(path)
13
+ rescue LoadError
14
+ load_path = path.dup
15
+ end
16
+ load_path = path[0...-'.rbc'.size] if path.end_with?('.rbc')
17
+ load_path += '.rb' unless File.exist?(load_path)
18
+ if File.readable?(load_path)
19
+ SCRIPT_LINES__[path] = File.open(load_path).readlines
20
+ puts "#{path} added to SCRIPT_LINES__" if $DEBUG
21
+ end
22
+ rescue
23
+ end
24
+ end
25
+ end
26
+
27
+ Rubinius::CodeLoader.loaded_hook.add(method(:script_lines__))
28
+
29
+ if __FILE__ == $0
30
+ SCRIPT_LINES__ = {}
31
+ dir = File.dirname(__FILE__)
32
+ file = File.join(dir, 'set_trace.rb')
33
+ load File.join(file)
34
+ puts SCRIPT_LINES__[file][0...10]
35
+ end
@@ -0,0 +1,836 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 136
13
+ 99
14
+ 7
15
+ 0
16
+ 7
17
+ 1
18
+ 65
19
+ 67
20
+ 49
21
+ 2
22
+ 0
23
+ 49
24
+ 3
25
+ 4
26
+ 15
27
+ 45
28
+ 4
29
+ 5
30
+ 43
31
+ 6
32
+ 49
33
+ 7
34
+ 0
35
+ 5
36
+ 7
37
+ 0
38
+ 47
39
+ 49
40
+ 8
41
+ 1
42
+ 49
43
+ 9
44
+ 1
45
+ 15
46
+ 65
47
+ 49
48
+ 10
49
+ 0
50
+ 99
51
+ 43
52
+ 11
53
+ 7
54
+ 12
55
+ 49
56
+ 13
57
+ 1
58
+ 83
59
+ 14
60
+ 9
61
+ 132
62
+ 65
63
+ 7
64
+ 15
65
+ 44
66
+ 43
67
+ 16
68
+ 78
69
+ 49
70
+ 17
71
+ 1
72
+ 49
73
+ 18
74
+ 2
75
+ 15
76
+ 45
77
+ 19
78
+ 20
79
+ 65
80
+ 49
81
+ 10
82
+ 0
83
+ 49
84
+ 21
85
+ 1
86
+ 19
87
+ 0
88
+ 15
89
+ 45
90
+ 19
91
+ 22
92
+ 20
93
+ 0
94
+ 7
95
+ 23
96
+ 64
97
+ 49
98
+ 24
99
+ 2
100
+ 19
101
+ 1
102
+ 15
103
+ 5
104
+ 45
105
+ 19
106
+ 25
107
+ 20
108
+ 1
109
+ 49
110
+ 24
111
+ 1
112
+ 47
113
+ 49
114
+ 26
115
+ 1
116
+ 15
117
+ 5
118
+ 45
119
+ 15
120
+ 27
121
+ 20
122
+ 1
123
+ 49
124
+ 13
125
+ 1
126
+ 44
127
+ 43
128
+ 28
129
+ 78
130
+ 4
131
+ 10
132
+ 2
133
+ 49
134
+ 29
135
+ 3
136
+ 49
137
+ 13
138
+ 1
139
+ 47
140
+ 49
141
+ 30
142
+ 1
143
+ 8
144
+ 133
145
+ 1
146
+ 15
147
+ 2
148
+ 11
149
+ I
150
+ 8
151
+ I
152
+ 2
153
+ I
154
+ 0
155
+ I
156
+ 0
157
+ n
158
+ p
159
+ 31
160
+ x
161
+ 14
162
+ script_lines__
163
+ M
164
+ 1
165
+ n
166
+ n
167
+ x
168
+ 14
169
+ script_lines__
170
+ i
171
+ 319
172
+ 26
173
+ 93
174
+ 0
175
+ 15
176
+ 29
177
+ 15
178
+ 0
179
+ 7
180
+ 0
181
+ 98
182
+ 1
183
+ 1
184
+ 30
185
+ 8
186
+ 21
187
+ 25
188
+ 92
189
+ 0
190
+ 27
191
+ 8
192
+ 26
193
+ 15
194
+ 7
195
+ 2
196
+ 8
197
+ 27
198
+ 1
199
+ 13
200
+ 9
201
+ 40
202
+ 15
203
+ 45
204
+ 0
205
+ 3
206
+ 45
207
+ 4
208
+ 5
209
+ 49
210
+ 6
211
+ 1
212
+ 9
213
+ 317
214
+ 26
215
+ 93
216
+ 1
217
+ 15
218
+ 29
219
+ 285
220
+ 0
221
+ 45
222
+ 7
223
+ 8
224
+ 43
225
+ 9
226
+ 13
227
+ 71
228
+ 10
229
+ 47
230
+ 9
231
+ 74
232
+ 47
233
+ 49
234
+ 11
235
+ 0
236
+ 13
237
+ 20
238
+ 0
239
+ 47
240
+ 49
241
+ 12
242
+ 1
243
+ 15
244
+ 8
245
+ 79
246
+ 20
247
+ 0
248
+ 49
249
+ 10
250
+ 1
251
+ 19
252
+ 1
253
+ 15
254
+ 26
255
+ 93
256
+ 2
257
+ 15
258
+ 29
259
+ 120
260
+ 0
261
+ 20
262
+ 1
263
+ 49
264
+ 13
265
+ 0
266
+ 15
267
+ 20
268
+ 1
269
+ 7
270
+ 14
271
+ 64
272
+ 49
273
+ 15
274
+ 1
275
+ 13
276
+ 10
277
+ 115
278
+ 15
279
+ 45
280
+ 16
281
+ 17
282
+ 20
283
+ 0
284
+ 49
285
+ 18
286
+ 1
287
+ 19
288
+ 2
289
+ 30
290
+ 8
291
+ 153
292
+ 26
293
+ 93
294
+ 3
295
+ 15
296
+ 24
297
+ 13
298
+ 45
299
+ 19
300
+ 20
301
+ 12
302
+ 49
303
+ 21
304
+ 1
305
+ 10
306
+ 137
307
+ 8
308
+ 148
309
+ 15
310
+ 20
311
+ 0
312
+ 49
313
+ 22
314
+ 0
315
+ 19
316
+ 2
317
+ 25
318
+ 8
319
+ 153
320
+ 15
321
+ 92
322
+ 3
323
+ 27
324
+ 34
325
+ 92
326
+ 2
327
+ 27
328
+ 15
329
+ 20
330
+ 0
331
+ 7
332
+ 23
333
+ 64
334
+ 49
335
+ 24
336
+ 1
337
+ 9
338
+ 193
339
+ 20
340
+ 0
341
+ 44
342
+ 43
343
+ 25
344
+ 78
345
+ 7
346
+ 23
347
+ 64
348
+ 49
349
+ 26
350
+ 0
351
+ 49
352
+ 27
353
+ 0
354
+ 2
355
+ 49
356
+ 10
357
+ 3
358
+ 49
359
+ 28
360
+ 1
361
+ 19
362
+ 2
363
+ 8
364
+ 194
365
+ 1
366
+ 15
367
+ 45
368
+ 16
369
+ 29
370
+ 20
371
+ 2
372
+ 49
373
+ 30
374
+ 1
375
+ 9
376
+ 208
377
+ 1
378
+ 8
379
+ 217
380
+ 20
381
+ 2
382
+ 7
383
+ 31
384
+ 64
385
+ 81
386
+ 32
387
+ 19
388
+ 2
389
+ 15
390
+ 45
391
+ 16
392
+ 33
393
+ 20
394
+ 2
395
+ 49
396
+ 34
397
+ 1
398
+ 9
399
+ 281
400
+ 45
401
+ 0
402
+ 35
403
+ 20
404
+ 0
405
+ 45
406
+ 16
407
+ 36
408
+ 20
409
+ 2
410
+ 49
411
+ 37
412
+ 1
413
+ 49
414
+ 38
415
+ 0
416
+ 13
417
+ 18
418
+ 3
419
+ 49
420
+ 39
421
+ 2
422
+ 15
423
+ 15
424
+ 99
425
+ 43
426
+ 40
427
+ 7
428
+ 41
429
+ 49
430
+ 28
431
+ 1
432
+ 9
433
+ 278
434
+ 5
435
+ 20
436
+ 0
437
+ 47
438
+ 101
439
+ 42
440
+ 7
441
+ 43
442
+ 63
443
+ 2
444
+ 47
445
+ 49
446
+ 44
447
+ 1
448
+ 8
449
+ 279
450
+ 1
451
+ 8
452
+ 282
453
+ 1
454
+ 30
455
+ 8
456
+ 312
457
+ 26
458
+ 93
459
+ 4
460
+ 15
461
+ 24
462
+ 13
463
+ 45
464
+ 45
465
+ 46
466
+ 12
467
+ 49
468
+ 21
469
+ 1
470
+ 10
471
+ 302
472
+ 8
473
+ 307
474
+ 15
475
+ 1
476
+ 25
477
+ 8
478
+ 312
479
+ 15
480
+ 92
481
+ 4
482
+ 27
483
+ 34
484
+ 92
485
+ 1
486
+ 27
487
+ 8
488
+ 318
489
+ 1
490
+ 11
491
+ I
492
+ d
493
+ I
494
+ 3
495
+ I
496
+ 1
497
+ I
498
+ 1
499
+ n
500
+ p
501
+ 47
502
+ x
503
+ 14
504
+ SCRIPT_LINES__
505
+ x
506
+ 16
507
+ vm_const_defined
508
+ s
509
+ 8
510
+ constant
511
+ n
512
+ x
513
+ 4
514
+ Hash
515
+ n
516
+ x
517
+ 5
518
+ is_a?
519
+ x
520
+ 8
521
+ Rubinius
522
+ n
523
+ x
524
+ 10
525
+ CodeLoader
526
+ x
527
+ 3
528
+ new
529
+ x
530
+ 8
531
+ allocate
532
+ x
533
+ 10
534
+ initialize
535
+ x
536
+ 17
537
+ resolve_load_path
538
+ s
539
+ 10
540
+ @load_path
541
+ x
542
+ 21
543
+ instance_variable_get
544
+ x
545
+ 4
546
+ File
547
+ n
548
+ x
549
+ 11
550
+ expand_path
551
+ x
552
+ 9
553
+ LoadError
554
+ n
555
+ x
556
+ 3
557
+ ===
558
+ x
559
+ 3
560
+ dup
561
+ s
562
+ 4
563
+ .rbc
564
+ x
565
+ 9
566
+ end_with?
567
+ x
568
+ 5
569
+ Range
570
+ x
571
+ 4
572
+ size
573
+ x
574
+ 2
575
+ -@
576
+ x
577
+ 2
578
+ []
579
+ n
580
+ x
581
+ 6
582
+ exist?
583
+ s
584
+ 3
585
+ .rb
586
+ x
587
+ 1
588
+ +
589
+ n
590
+ x
591
+ 9
592
+ readable?
593
+ n
594
+ n
595
+ x
596
+ 4
597
+ open
598
+ x
599
+ 9
600
+ readlines
601
+ x
602
+ 3
603
+ []=
604
+ x
605
+ 7
606
+ Globals
607
+ x
608
+ 6
609
+ $DEBUG
610
+ x
611
+ 4
612
+ to_s
613
+ s
614
+ 24
615
+ added to SCRIPT_LINES__
616
+ x
617
+ 4
618
+ puts
619
+ x
620
+ 13
621
+ StandardError
622
+ n
623
+ p
624
+ 35
625
+ I
626
+ -1
627
+ I
628
+ 5
629
+ I
630
+ 0
631
+ I
632
+ 6
633
+ I
634
+ 2a
635
+ I
636
+ 8
637
+ I
638
+ 52
639
+ I
640
+ a
641
+ I
642
+ 5f
643
+ I
644
+ b
645
+ I
646
+ 6b
647
+ I
648
+ c
649
+ I
650
+ 73
651
+ I
652
+ b
653
+ I
654
+ 7d
655
+ I
656
+ d
657
+ I
658
+ 8a
659
+ I
660
+ e
661
+ I
662
+ 9d
663
+ I
664
+ 10
665
+ I
666
+ c3
667
+ I
668
+ 11
669
+ I
670
+ da
671
+ I
672
+ 12
673
+ I
674
+ e4
675
+ I
676
+ 13
677
+ I
678
+ fc
679
+ I
680
+ 14
681
+ I
682
+ 119
683
+ I
684
+ 12
685
+ I
686
+ 122
687
+ I
688
+ 17
689
+ I
690
+ 13d
691
+ I
692
+ 6
693
+ I
694
+ 13f
695
+ x
696
+ 55
697
+ /home/rocky-rvm/.rvm/src/rbx-tracer/lib/script_lines.rb
698
+ p
699
+ 3
700
+ x
701
+ 4
702
+ path
703
+ x
704
+ 11
705
+ code_loader
706
+ x
707
+ 9
708
+ load_path
709
+ x
710
+ 17
711
+ method_visibility
712
+ x
713
+ 15
714
+ add_defn_method
715
+ x
716
+ 8
717
+ Rubinius
718
+ n
719
+ x
720
+ 10
721
+ CodeLoader
722
+ x
723
+ 11
724
+ loaded_hook
725
+ x
726
+ 6
727
+ method
728
+ x
729
+ 3
730
+ add
731
+ x
732
+ 11
733
+ active_path
734
+ x
735
+ 7
736
+ Globals
737
+ x
738
+ 2
739
+ $0
740
+ x
741
+ 2
742
+ []
743
+ x
744
+ 2
745
+ ==
746
+ x
747
+ 14
748
+ SCRIPT_LINES__
749
+ x
750
+ 4
751
+ Hash
752
+ x
753
+ 16
754
+ new_from_literal
755
+ x
756
+ 9
757
+ const_set
758
+ x
759
+ 4
760
+ File
761
+ n
762
+ x
763
+ 7
764
+ dirname
765
+ n
766
+ s
767
+ 12
768
+ set_trace.rb
769
+ x
770
+ 4
771
+ join
772
+ n
773
+ x
774
+ 4
775
+ load
776
+ n
777
+ x
778
+ 5
779
+ Range
780
+ x
781
+ 3
782
+ new
783
+ x
784
+ 4
785
+ puts
786
+ p
787
+ 19
788
+ I
789
+ 0
790
+ I
791
+ 5
792
+ I
793
+ e
794
+ I
795
+ 1b
796
+ I
797
+ 21
798
+ I
799
+ 1d
800
+ I
801
+ 31
802
+ I
803
+ 1e
804
+ I
805
+ 3f
806
+ I
807
+ 1f
808
+ I
809
+ 4c
810
+ I
811
+ 20
812
+ I
813
+ 5a
814
+ I
815
+ 21
816
+ I
817
+ 68
818
+ I
819
+ 22
820
+ I
821
+ 84
822
+ I
823
+ 1d
824
+ I
825
+ 88
826
+ x
827
+ 55
828
+ /home/rocky-rvm/.rvm/src/rbx-tracer/lib/script_lines.rb
829
+ p
830
+ 2
831
+ x
832
+ 3
833
+ dir
834
+ x
835
+ 4
836
+ file