rbx-trepanning 0.0.4-universal-rubinius-1.2 → 0.0.6-universal-rubinius-1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +682 -0
- data/NEWS +19 -0
- data/README.textile +8 -9
- data/Rakefile +8 -8
- data/app/complete.rb +52 -0
- data/app/complete.rbc +1288 -0
- data/app/irb.rb +1 -2
- data/app/irb.rbc +55 -72
- data/app/llvm.rbc +780 -878
- data/app/method.rb +1 -1
- data/app/method.rbc +31 -35
- data/app/method_name.rbc +2467 -0
- data/app/options.rb +7 -24
- data/app/options.rbc +238 -132
- data/app/rbx-llvm.rbc +2478 -0
- data/app/util.rb +3 -3
- data/app/util.rbc +23 -27
- data/bin/trepanx +4 -3
- data/bin/trepanx.compiled.rbc +42 -32
- data/data/irbrc +41 -0
- data/data/irbrc.compiled.rbc +640 -0
- data/interface/base_intf.rb +9 -5
- data/interface/base_intf.rbc +200 -146
- data/interface/comcodes.rb +10 -8
- data/interface/comcodes.rbc +68 -26
- data/interface/script.rbc +21 -9
- data/interface/user.rb +74 -8
- data/interface/user.rbc +1702 -156
- data/io/input.rb +37 -14
- data/io/input.rbc +869 -320
- data/io/tcpclient.rb +7 -1
- data/io/tcpclient.rbc +205 -113
- data/io/tcpfns.rb +5 -3
- data/io/tcpfns.rbc +82 -40
- data/io/tcpserver.rb +13 -10
- data/io/tcpserver.rbc +236 -183
- data/lib/trepanning.rb +62 -21
- data/lib/trepanning.rbc +1304 -874
- data/lib/{trepanning.rb.orig → trepanning2.rb} +12 -4
- data/processor/breakpoint.rb +4 -1
- data/processor/command/base/cmd.rb +48 -3
- data/processor/command/base/subcmd.rb +2 -1
- data/processor/command/base/submgr.rb +23 -20
- data/processor/command/base/subsubmgr.rb +13 -2
- data/processor/command/complete.rb +7 -17
- data/processor/command/continue.rb +19 -11
- data/processor/command/disassemble.rb +39 -12
- data/processor/command/eval.rb +23 -5
- data/processor/command/help.rb +60 -6
- data/processor/command/info_subcmd/{file.rb → files.rb} +76 -18
- data/processor/command/info_subcmd/line.rb +86 -0
- data/processor/command/info_subcmd/program.rb +2 -11
- data/processor/command/info_subcmd/ruby.rb +62 -0
- data/processor/command/info_subcmd/variables.rb +7 -0
- data/processor/command/irb.rb +39 -7
- data/processor/command/macro.rb +76 -0
- data/processor/command/set_subcmd/confirm.rb +24 -0
- data/processor/command/set_subcmd/max.rb +4 -5
- data/processor/command/show.rb +11 -0
- data/processor/command/show_subcmd/auto.rb +1 -0
- data/processor/command/show_subcmd/basename.rb +1 -2
- data/processor/command/show_subcmd/confirm.rb +18 -0
- data/processor/command/show_subcmd/max.rb +0 -2
- data/processor/command/source.rb +0 -1
- data/processor/default.rb +2 -0
- data/processor/disassemble.rb +1 -0
- data/processor/load_cmds.rb +104 -20
- data/processor/location.rb +11 -12
- data/processor/main.rb +10 -6
- data/processor/mock.rb +6 -2
- data/processor/stepping.rb +1 -4
- data/processor/subcmd.rb +3 -2
- data/processor/validate.rb +3 -3
- data/sample/list-terminal-colors.rbc +158 -4
- data/sample/rocky-trepanx-colors.rb +15 -7
- data/sample/rocky-trepanx-colors.rbc +530 -0
- data/test/data/quit2.cmd +6 -0
- data/test/data/quit2.right +3 -0
- data/test/data/step-bug.cmd +11 -0
- data/test/data/step-bug.right +3 -0
- data/test/example/step-bug.rb +14 -0
- data/test/integration/helper.rb +1 -1
- data/test/integration/skip-test-step-bug.rb +17 -0
- data/test/integration/test-quit.rb +11 -0
- data/test/unit/test-app-util.rb +0 -1
- data/test/unit/test-base-cmd.rb +47 -0
- data/test/unit/test-base-subcmd.rb +2 -2
- data/test/unit/test-base-submgr.rb +24 -0
- data/test/unit/test-cmd-help.rb +4 -0
- data/test/unit/test-completion.rb +38 -0
- data/test/unit/test-intf-user.rb +2 -2
- data/test/unit/test-io-tcpclient.rb +3 -2
- data/test/unit/test-proc-eval.rb +1 -1
- data/test/unit/test-proc-load_cmds.rb +9 -0
- data/test/unit/test-subcmd-help.rb +1 -5
- metadata +182 -167
- data/app/options.rb.orig +0 -154
- data/bin/trepan.orig +0 -0
- data/bin/trepan.rej +0 -11
- data/lib/trepanning.rb.rej +0 -11
- data/sample/rocky-dot-trepanrc.orig +0 -0
- data/sample/rocky-dot-trepanrc.rej +0 -11
data/app/util.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
1
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
2
2
|
|
3
3
|
class Trepan
|
4
4
|
module Util
|
5
5
|
|
6
|
+
module_function
|
6
7
|
def safe_repr(str, max, elipsis='... ')
|
7
8
|
if str.is_a?(String) && max > 0 && str.size > max && !str.index("\n")
|
8
9
|
"%s%s%s" % [ str[0...max/2], elipsis, str[str.size-max/2..str.size]]
|
@@ -10,8 +11,7 @@ class Trepan
|
|
10
11
|
str
|
11
12
|
end
|
12
13
|
end
|
13
|
-
|
14
|
-
|
14
|
+
|
15
15
|
# Find user portion of script skipping over Rubinius code loading.
|
16
16
|
# Unless hidestack is off, we don't show parts of the frame below this.
|
17
17
|
def find_main_script(locs)
|
data/app/util.rbc
CHANGED
@@ -279,30 +279,26 @@ x
|
|
279
279
|
4
|
280
280
|
Util
|
281
281
|
i
|
282
|
-
|
282
|
+
42
|
283
283
|
5
|
284
284
|
66
|
285
|
-
|
286
|
-
|
285
|
+
5
|
286
|
+
48
|
287
287
|
0
|
288
|
+
15
|
289
|
+
99
|
288
290
|
7
|
289
291
|
1
|
292
|
+
7
|
293
|
+
2
|
290
294
|
65
|
291
295
|
67
|
292
296
|
49
|
293
|
-
2
|
294
|
-
0
|
295
|
-
49
|
296
297
|
3
|
297
|
-
4
|
298
|
-
15
|
299
|
-
5
|
300
|
-
7
|
301
298
|
0
|
302
|
-
47
|
303
299
|
49
|
304
300
|
4
|
305
|
-
|
301
|
+
4
|
306
302
|
15
|
307
303
|
99
|
308
304
|
7
|
@@ -312,10 +308,10 @@ i
|
|
312
308
|
65
|
313
309
|
67
|
314
310
|
49
|
315
|
-
|
311
|
+
3
|
316
312
|
0
|
317
313
|
49
|
318
|
-
|
314
|
+
4
|
319
315
|
4
|
320
316
|
15
|
321
317
|
5
|
@@ -323,7 +319,7 @@ i
|
|
323
319
|
5
|
324
320
|
47
|
325
321
|
49
|
326
|
-
|
322
|
+
0
|
327
323
|
1
|
328
324
|
11
|
329
325
|
I
|
@@ -338,6 +334,9 @@ n
|
|
338
334
|
p
|
339
335
|
7
|
340
336
|
x
|
337
|
+
15
|
338
|
+
module_function
|
339
|
+
x
|
341
340
|
9
|
342
341
|
safe_repr
|
343
342
|
M
|
@@ -532,19 +531,19 @@ p
|
|
532
531
|
I
|
533
532
|
-1
|
534
533
|
I
|
535
|
-
|
534
|
+
7
|
536
535
|
I
|
537
536
|
a
|
538
537
|
I
|
539
|
-
|
538
|
+
8
|
540
539
|
I
|
541
540
|
3c
|
542
541
|
I
|
543
|
-
|
542
|
+
9
|
544
543
|
I
|
545
544
|
78
|
546
545
|
I
|
547
|
-
|
546
|
+
b
|
548
547
|
I
|
549
548
|
7b
|
550
549
|
x
|
@@ -568,9 +567,6 @@ x
|
|
568
567
|
15
|
569
568
|
add_defn_method
|
570
569
|
x
|
571
|
-
15
|
572
|
-
module_function
|
573
|
-
x
|
574
570
|
16
|
575
571
|
find_main_script
|
576
572
|
M
|
@@ -890,19 +886,19 @@ I
|
|
890
886
|
I
|
891
887
|
6
|
892
888
|
I
|
893
|
-
|
889
|
+
6
|
894
890
|
I
|
895
|
-
|
891
|
+
7
|
896
892
|
I
|
897
|
-
|
893
|
+
14
|
898
894
|
I
|
899
895
|
11
|
900
896
|
I
|
901
|
-
|
897
|
+
22
|
902
898
|
I
|
903
899
|
21
|
904
900
|
I
|
905
|
-
|
901
|
+
2a
|
906
902
|
x
|
907
903
|
51
|
908
904
|
/home/rocky-rvm/.rvm/src/rbx-trepanning/app/util.rb
|
data/bin/trepanx
CHANGED
@@ -55,12 +55,13 @@ if File.basename(__FILE__) == File.basename($0)
|
|
55
55
|
File.exist?(program_to_debug)
|
56
56
|
Trepan::PROG_SCRIPT = program_to_debug
|
57
57
|
|
58
|
-
# Set global so others may use this debugger.
|
59
|
-
|
60
58
|
opts = {}
|
61
|
-
%w(cmdfiles initial_dir host nx port
|
59
|
+
%w(cmdfiles highlight initial_dir host nx port readline server
|
60
|
+
).each do |opt|
|
62
61
|
opts[opt.to_sym] = options[opt.to_sym]
|
63
62
|
end
|
63
|
+
|
64
|
+
# Set global so others may use this debugger.
|
64
65
|
$trepan = Trepan.new(opts)
|
65
66
|
debug_program($trepan, Trepan::RUBY_PATH,
|
66
67
|
File.expand_path(program_to_debug))
|
data/bin/trepanx.compiled.rbc
CHANGED
@@ -191,7 +191,7 @@ x
|
|
191
191
|
9
|
192
192
|
__block__
|
193
193
|
i
|
194
|
-
|
194
|
+
387
|
195
195
|
1
|
196
196
|
19
|
197
197
|
1
|
@@ -504,49 +504,52 @@ i
|
|
504
504
|
7
|
505
505
|
60
|
506
506
|
64
|
507
|
-
35
|
508
507
|
7
|
509
|
-
56
|
510
508
|
61
|
511
|
-
|
509
|
+
64
|
510
|
+
35
|
511
|
+
8
|
512
|
+
56
|
512
513
|
62
|
514
|
+
50
|
515
|
+
63
|
513
516
|
0
|
514
517
|
15
|
515
518
|
99
|
516
519
|
43
|
517
520
|
14
|
518
521
|
7
|
519
|
-
|
522
|
+
64
|
520
523
|
45
|
521
524
|
0
|
522
|
-
|
525
|
+
65
|
523
526
|
13
|
524
527
|
71
|
525
528
|
23
|
526
529
|
47
|
527
530
|
9
|
528
|
-
|
531
|
+
351
|
529
532
|
47
|
530
533
|
49
|
531
|
-
|
534
|
+
66
|
532
535
|
0
|
533
536
|
13
|
534
537
|
20
|
535
538
|
3
|
536
539
|
47
|
537
540
|
49
|
538
|
-
|
541
|
+
67
|
539
542
|
1
|
540
543
|
15
|
541
544
|
8
|
542
|
-
|
545
|
+
356
|
543
546
|
20
|
544
547
|
3
|
545
548
|
49
|
546
549
|
23
|
547
550
|
1
|
548
551
|
49
|
549
|
-
|
552
|
+
68
|
550
553
|
2
|
551
554
|
15
|
552
555
|
5
|
@@ -554,18 +557,18 @@ i
|
|
554
557
|
43
|
555
558
|
14
|
556
559
|
7
|
557
|
-
|
560
|
+
64
|
558
561
|
49
|
559
562
|
16
|
560
563
|
1
|
561
564
|
45
|
562
565
|
0
|
563
|
-
|
566
|
+
69
|
564
567
|
43
|
565
568
|
30
|
566
569
|
45
|
567
570
|
12
|
568
|
-
|
571
|
+
70
|
569
572
|
20
|
570
573
|
1
|
571
574
|
49
|
@@ -573,11 +576,11 @@ i
|
|
573
576
|
1
|
574
577
|
47
|
575
578
|
49
|
576
|
-
|
579
|
+
71
|
577
580
|
3
|
578
581
|
11
|
579
582
|
I
|
580
|
-
|
583
|
+
e
|
581
584
|
I
|
582
585
|
5
|
583
586
|
I
|
@@ -587,7 +590,7 @@ I
|
|
587
590
|
I
|
588
591
|
-2
|
589
592
|
p
|
590
|
-
|
593
|
+
72
|
591
594
|
x
|
592
595
|
6
|
593
596
|
Trepan
|
@@ -722,6 +725,9 @@ s
|
|
722
725
|
8
|
723
726
|
cmdfiles
|
724
727
|
s
|
728
|
+
9
|
729
|
+
highlight
|
730
|
+
s
|
725
731
|
11
|
726
732
|
initial_dir
|
727
733
|
s
|
@@ -735,7 +741,7 @@ s
|
|
735
741
|
port
|
736
742
|
s
|
737
743
|
8
|
738
|
-
|
744
|
+
readline
|
739
745
|
s
|
740
746
|
6
|
741
747
|
server
|
@@ -805,15 +811,19 @@ x
|
|
805
811
|
3
|
806
812
|
[]=
|
807
813
|
p
|
808
|
-
|
814
|
+
7
|
809
815
|
I
|
810
816
|
0
|
811
817
|
I
|
812
|
-
|
818
|
+
3b
|
819
|
+
I
|
820
|
+
1
|
821
|
+
I
|
822
|
+
3c
|
813
823
|
I
|
814
824
|
4
|
815
825
|
I
|
816
|
-
|
826
|
+
3d
|
817
827
|
I
|
818
828
|
1f
|
819
829
|
x
|
@@ -946,29 +956,29 @@ I
|
|
946
956
|
I
|
947
957
|
119
|
948
958
|
I
|
949
|
-
|
959
|
+
3a
|
950
960
|
I
|
951
961
|
123
|
952
962
|
I
|
953
|
-
|
954
|
-
I
|
955
|
-
140
|
956
|
-
I
|
957
|
-
40
|
963
|
+
3b
|
958
964
|
I
|
959
|
-
|
965
|
+
143
|
960
966
|
I
|
961
967
|
41
|
962
968
|
I
|
963
|
-
|
969
|
+
168
|
964
970
|
I
|
965
971
|
42
|
966
972
|
I
|
967
|
-
|
973
|
+
176
|
968
974
|
I
|
969
|
-
|
975
|
+
43
|
976
|
+
I
|
977
|
+
17e
|
978
|
+
I
|
979
|
+
42
|
970
980
|
I
|
971
|
-
|
981
|
+
183
|
972
982
|
x
|
973
983
|
51
|
974
984
|
/home/rocky-rvm/.rvm/src/rbx-trepanning/bin/trepanx
|
data/data/irbrc
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# -*- Ruby -*-
|
2
|
+
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
3
|
+
# We use this as the default startup file for irb inside trepan
|
4
|
+
# Down the line we will have a way for folks to add/override this
|
5
|
+
# with their own file.
|
6
|
+
IRB.conf[:PROMPT_MODE] = :SIMPLE
|
7
|
+
IRB.conf[:PROMPT][:SIMPLE] =
|
8
|
+
{:PROMPT_C=>"trepanx ?> ",
|
9
|
+
:PROMPT_I=>"trepanx >> ",
|
10
|
+
:PROMPT_N=>"trepanx >> ",
|
11
|
+
:PROMPT_S=>nil,
|
12
|
+
:RETURN=>"=> %s\n"}
|
13
|
+
|
14
|
+
# Using dbgr to issue a debugger statement inside irb:
|
15
|
+
# dbgr %w(info program)
|
16
|
+
# dbgr 'info program' # also works
|
17
|
+
# But...
|
18
|
+
# dbgr info program # wrong!
|
19
|
+
#
|
20
|
+
puts "You are in a trepan session. You should have access to program scope."
|
21
|
+
puts "'dbgr', 'step', 'ne', 'q', 'cont' commands have been added."
|
22
|
+
|
23
|
+
if defined?($trepanx) && $trepanx
|
24
|
+
puts 'You should have access to debugger state via global variable $trepanx'
|
25
|
+
end
|
26
|
+
if defined?($trepanx_frame) && $trepanx_frame
|
27
|
+
puts 'You should have access to the program frame via global variable $trepanx_frame'
|
28
|
+
end
|
29
|
+
if defined?($trepanx_cmdproc) && $trepanx_cmdproc
|
30
|
+
puts 'You should have access to the command processor via global variable $trepanx_cmdproc'
|
31
|
+
end
|
32
|
+
|
33
|
+
# Monkeypatch to save the current IRB statement to be run.
|
34
|
+
class IRB::Context
|
35
|
+
alias_method :_trepanx_original_evaluate, :evaluate
|
36
|
+
def evaluate(line, line_no)
|
37
|
+
$trepanx_irb_statements = line
|
38
|
+
_trepanx_original_evaluate(line, line_no)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|