rbx-trepanning 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.
Files changed (134) hide show
  1. data/ChangeLog +152 -55
  2. data/NEWS +7 -0
  3. data/Rakefile +1 -1
  4. data/app/breakpoint.rb +3 -2
  5. data/app/breakpoint.rbc +207 -220
  6. data/app/brkptmgr.rb +84 -82
  7. data/app/brkptmgr.rbc +263 -193
  8. data/app/client.rb +61 -0
  9. data/app/client.rbc +1225 -0
  10. data/app/default.rb +17 -7
  11. data/app/default.rbc +302 -181
  12. data/app/display.rb +134 -21
  13. data/app/display.rbc +2176 -566
  14. data/app/iseq.rb +33 -11
  15. data/app/iseq.rbc +634 -243
  16. data/app/llvm.rbc +2576 -0
  17. data/app/options.rb +51 -20
  18. data/app/options.rb.orig +154 -0
  19. data/app/options.rbc +1148 -561
  20. data/app/rbx-llvm.rb +165 -0
  21. data/app/util.rb +1 -1
  22. data/app/util.rbc +38 -32
  23. data/bin/trepan.orig +0 -0
  24. data/bin/trepan.rej +11 -0
  25. data/bin/trepanx +13 -8
  26. data/bin/trepanx.compiled.rbc +373 -319
  27. data/interface/base_intf.rb +11 -5
  28. data/interface/base_intf.rbc +173 -70
  29. data/interface/client.rb +80 -0
  30. data/interface/client.rbc +1072 -0
  31. data/interface/comcodes.rb +18 -0
  32. data/interface/comcodes.rbc +343 -0
  33. data/interface/server.rb +143 -0
  34. data/interface/server.rbc +2213 -0
  35. data/interface/user.rb +1 -8
  36. data/interface/user.rbc +68 -165
  37. data/io/base_io.rb +56 -2
  38. data/io/base_io.rbc +727 -20
  39. data/io/tcpclient.rb +123 -0
  40. data/io/tcpclient.rbc +2327 -0
  41. data/io/tcpfns.rb +31 -0
  42. data/io/tcpfns.rbc +652 -0
  43. data/io/tcpserver.rb +138 -0
  44. data/io/tcpserver.rbc +2585 -0
  45. data/lib/trepanning.rb +91 -56
  46. data/lib/trepanning.rb.orig +433 -0
  47. data/lib/trepanning.rb.rej +11 -0
  48. data/lib/trepanning.rbc +1954 -1340
  49. data/processor/command/backtrace.rb +45 -15
  50. data/processor/command/base/cmd.rb +10 -6
  51. data/processor/command/base/subcmd.rb +16 -1
  52. data/processor/command/complete.rb +47 -0
  53. data/processor/command/continue.rb +4 -3
  54. data/processor/command/directory.rb +9 -1
  55. data/processor/command/disassemble.rb +22 -7
  56. data/processor/command/display.rb +82 -0
  57. data/processor/command/eval.rb +3 -1
  58. data/processor/command/exit.rb +4 -0
  59. data/processor/command/help.rb +69 -18
  60. data/processor/command/info_subcmd/breakpoints.rb +6 -8
  61. data/processor/command/info_subcmd/file.rb +5 -7
  62. data/processor/command/info_subcmd/method.rb +9 -9
  63. data/processor/command/info_subcmd/program.rb +3 -4
  64. data/processor/command/info_subcmd/variables.rb +4 -3
  65. data/processor/command/list.rb +8 -4
  66. data/processor/command/nexti.rb +2 -2
  67. data/processor/command/pr.rb +2 -2
  68. data/processor/command/ps.rb +2 -2
  69. data/processor/command/server.rb +72 -0
  70. data/processor/command/set_subcmd/auto.rb +2 -3
  71. data/processor/command/set_subcmd/basename.rb +3 -4
  72. data/processor/command/set_subcmd/debug.rb +2 -3
  73. data/processor/command/set_subcmd/different.rb +3 -4
  74. data/processor/command/set_subcmd/hidelevel.rb +6 -7
  75. data/processor/command/set_subcmd/highlight.rb +33 -0
  76. data/processor/command/set_subcmd/kernelstep.rb +3 -4
  77. data/processor/command/set_subcmd/max.rb +2 -4
  78. data/processor/command/set_subcmd/max_subcmd/string.rb +44 -22
  79. data/processor/command/set_subcmd/substitute.rb +2 -3
  80. data/processor/command/set_subcmd/trace.rb +3 -4
  81. data/processor/command/show_subcmd/alias.rb +3 -4
  82. data/processor/command/show_subcmd/args.rb +2 -3
  83. data/processor/command/show_subcmd/auto.rb +1 -2
  84. data/processor/command/show_subcmd/basename.rb +2 -3
  85. data/processor/command/show_subcmd/debug.rb +1 -2
  86. data/processor/command/show_subcmd/different.rb +2 -3
  87. data/processor/command/show_subcmd/hidelevel.rb +1 -2
  88. data/processor/command/show_subcmd/highlight.rb +24 -0
  89. data/processor/command/show_subcmd/kernelstep.rb +3 -6
  90. data/processor/command/show_subcmd/max.rb +4 -5
  91. data/processor/command/show_subcmd/trace.rb +9 -11
  92. data/processor/command/show_subcmd/version.rb +23 -0
  93. data/processor/command/source.rb +75 -31
  94. data/processor/command/undisplay.rb +59 -0
  95. data/processor/default.rb +4 -4
  96. data/processor/disassemble.rb +18 -5
  97. data/processor/display.rb +18 -0
  98. data/processor/location.rb +15 -5
  99. data/processor/main.rb +27 -13
  100. data/processor/mock.rb +12 -9
  101. data/processor/msg.rb +24 -9
  102. data/processor/stepping.rb +10 -12
  103. data/sample/list-terminal-colors.rb +139 -0
  104. data/sample/list-terminal-colors.rbc +2164 -0
  105. data/sample/rocky-dot-trepanrc.orig +0 -0
  106. data/sample/rocky-dot-trepanrc.rej +11 -0
  107. data/sample/rocky-dot-trepanxrc +14 -0
  108. data/sample/rocky-trepanx-colors.rb +39 -0
  109. data/test/data/fname-with-blank.right +3 -0
  110. data/test/data/inline-call.cmd +6 -0
  111. data/test/data/inline-call.right +13 -0
  112. data/test/data/quit.right +2 -0
  113. data/test/example/{gcd1.rb → gcd-server.rb} +4 -6
  114. data/test/example/gcd.rb +0 -0
  115. data/test/example/inline-call.rb +23 -0
  116. data/test/integration/helper.rb +8 -8
  117. data/test/integration/test-fname-with-blank.rb +5 -1
  118. data/test/integration/test-inline-call.rb +20 -0
  119. data/test/integration/test-quit.rb +5 -1
  120. data/test/unit/cmd-helper.rb +7 -4
  121. data/test/unit/mock-helper.rb +1 -0
  122. data/test/unit/test-app-brkpt.rb +4 -5
  123. data/test/unit/test-app-brkptmgr.rb +2 -2
  124. data/test/unit/test-app-iseq.rb +29 -14
  125. data/test/unit/test-app-options.rb +26 -5
  126. data/test/unit/test-base-subcmd.rb +1 -1
  127. data/test/unit/test-cmd-source.rb +34 -0
  128. data/test/unit/test-io-tcp.rb +33 -0
  129. data/test/unit/test-io-tcpclient.rb +53 -0
  130. data/test/unit/test-io-tcpfns.rb +17 -0
  131. data/test/unit/test-io-tcpserver.rb +50 -0
  132. data/test/unit/test-proc-main.rb +6 -2
  133. metadata +53 -10
  134. data/test/example/gcd-xx.rb +0 -18
data/interface/user.rb CHANGED
@@ -27,12 +27,11 @@ class Trepan::UserInterface < Trepan::Interface
27
27
  end
28
28
  end
29
29
 
30
- # Closes both input and output
31
-
32
30
  # Called when a dangerous action is about to be done, to make
33
31
  # sure it's okay. Expect a yes/no answer to `prompt' which is printed,
34
32
  # suffixed with a question mark and the default value. The user
35
33
  # response converted to a boolean is returned.
34
+ # FIXME: make common routine for this and server.rb
36
35
  def confirm(prompt, default)
37
36
  default_str = default ? 'Y/n' : 'N/y'
38
37
  while true do
@@ -58,12 +57,6 @@ class Trepan::UserInterface < Trepan::Interface
58
57
  end
59
58
 
60
59
  def interactive? ; @input.interactive? end
61
-
62
- def read_command(prompt='')
63
- line = readline(prompt)
64
- # FIXME: Do something with history?
65
- return line
66
- end
67
60
  end
68
61
 
69
62
  # Demo
data/interface/user.rbc CHANGED
@@ -9,7 +9,7 @@ x
9
9
  10
10
10
  __script__
11
11
  i
12
- 354
12
+ 351
13
13
  5
14
14
  7
15
15
  0
@@ -94,7 +94,7 @@ i
94
94
  83
95
95
  19
96
96
  9
97
- 350
97
+ 347
98
98
  45
99
99
  7
100
100
  20
@@ -143,7 +143,7 @@ i
143
143
  85
144
144
  29
145
145
  9
146
- 347
146
+ 344
147
147
  26
148
148
  93
149
149
  0
@@ -192,7 +192,7 @@ i
192
192
  1
193
193
  25
194
194
  8
195
- 204
195
+ 203
196
196
  15
197
197
  92
198
198
  1
@@ -205,9 +205,8 @@ i
205
205
  20
206
206
  1
207
207
  47
208
- 49
208
+ 101
209
209
  38
210
- 0
211
210
  63
212
211
  2
213
212
  47
@@ -250,10 +249,10 @@ i
250
249
  41
251
250
  0
252
251
  9
253
- 244
252
+ 243
254
253
  1
255
254
  8
256
- 345
255
+ 342
257
256
  20
258
257
  0
259
258
  7
@@ -272,9 +271,8 @@ i
272
271
  20
273
272
  1
274
273
  47
275
- 49
274
+ 101
276
275
  38
277
- 0
278
276
  63
279
277
  2
280
278
  47
@@ -323,9 +321,8 @@ i
323
321
  20
324
322
  1
325
323
  47
326
- 49
324
+ 101
327
325
  38
328
- 0
329
326
  63
330
327
  2
331
328
  47
@@ -356,10 +353,10 @@ i
356
353
  36
357
354
  1
358
355
  8
359
- 348
356
+ 345
360
357
  1
361
358
  8
362
- 351
359
+ 348
363
360
  1
364
361
  15
365
362
  2
@@ -418,7 +415,7 @@ x
418
415
  13
419
416
  UserInterface
420
417
  i
421
- 114
418
+ 100
422
419
  5
423
420
  66
424
421
  26
@@ -518,20 +515,6 @@ i
518
515
  49
519
516
  8
520
517
  4
521
- 15
522
- 99
523
- 7
524
- 15
525
- 7
526
- 16
527
- 65
528
- 67
529
- 49
530
- 7
531
- 0
532
- 49
533
- 8
534
- 4
535
518
  11
536
519
  I
537
520
  6
@@ -543,7 +526,7 @@ I
543
526
  0
544
527
  n
545
528
  p
546
- 17
529
+ 15
547
530
  x
548
531
  12
549
532
  FILE_HISTORY
@@ -694,9 +677,9 @@ x
694
677
  6
695
678
  @input
696
679
  p
697
- 11
680
+ 13
698
681
  I
699
- 0
682
+ -1
700
683
  I
701
684
  15
702
685
  I
@@ -716,6 +699,10 @@ I
716
699
  I
717
700
  1a
718
701
  I
702
+ 49
703
+ I
704
+ 17
705
+ I
719
706
  4c
720
707
  x
721
708
  57
@@ -943,45 +930,45 @@ n
943
930
  p
944
931
  21
945
932
  I
946
- 0
933
+ -1
947
934
  I
948
- 24
935
+ 23
949
936
  I
950
937
  0
951
938
  I
952
- 25
939
+ 24
953
940
  I
954
941
  f
955
942
  I
956
- 26
943
+ 25
957
944
  I
958
945
  12
959
946
  I
960
- 28
947
+ 27
961
948
  I
962
949
  34
963
950
  I
964
- 29
951
+ 28
965
952
  I
966
953
  41
967
954
  I
968
- 2a
955
+ 29
969
956
  I
970
957
  53
971
958
  I
972
- 2c
959
+ 2b
973
960
  I
974
961
  5e
975
962
  I
976
- 30
963
+ 2f
977
964
  I
978
965
  6f
979
966
  I
980
- 31
967
+ 30
981
968
  I
982
969
  7d
983
970
  I
984
- 33
971
+ 32
985
972
  I
986
973
  87
987
974
  x
@@ -1042,13 +1029,13 @@ finalize
1042
1029
  p
1043
1030
  5
1044
1031
  I
1045
- 0
1032
+ -1
1046
1033
  I
1047
- 36
1034
+ 35
1048
1035
  I
1049
1036
  8
1050
1037
  I
1051
- 39
1038
+ 38
1052
1039
  I
1053
1040
  c
1054
1041
  x
@@ -1097,9 +1084,9 @@ interactive?
1097
1084
  p
1098
1085
  3
1099
1086
  I
1100
- 0
1087
+ -1
1101
1088
  I
1102
- 3c
1089
+ 3b
1103
1090
  I
1104
1091
  6
1105
1092
  x
@@ -1107,88 +1094,8 @@ x
1107
1094
  /home/rocky-rvm/.rvm/src/rbx-trepanning/interface/user.rb
1108
1095
  p
1109
1096
  0
1110
- x
1111
- 12
1112
- read_command
1113
- M
1114
- 1
1115
- n
1116
- n
1117
- x
1118
- 12
1119
- read_command
1120
- i
1121
- 24
1122
- 23
1123
- 0
1124
- 10
1125
- 10
1126
- 7
1127
- 0
1128
- 64
1129
- 19
1130
- 0
1131
- 15
1132
- 5
1133
- 20
1134
- 0
1135
- 47
1136
- 49
1137
- 1
1138
- 1
1139
- 19
1140
- 1
1141
- 15
1142
- 20
1143
- 1
1144
- 11
1145
- 11
1146
- I
1147
- 4
1148
- I
1149
- 2
1150
- I
1151
- 0
1152
- I
1153
- 1
1154
- n
1155
- p
1156
- 2
1157
- s
1158
- 0
1159
-
1160
- x
1161
- 8
1162
- readline
1163
- p
1164
- 7
1165
- I
1166
- 0
1167
- I
1168
- 3e
1169
- I
1170
- a
1171
- I
1172
- 3f
1173
- I
1174
- 14
1175
- I
1176
- 41
1177
- I
1178
- 18
1179
- x
1180
- 57
1181
- /home/rocky-rvm/.rvm/src/rbx-trepanning/interface/user.rb
1182
- p
1183
- 2
1184
- x
1185
- 6
1186
- prompt
1187
- x
1188
- 4
1189
- line
1190
1097
  p
1191
- 13
1098
+ 11
1192
1099
  I
1193
1100
  2
1194
1101
  I
@@ -1200,21 +1107,17 @@ I
1200
1107
  I
1201
1108
  3a
1202
1109
  I
1203
- 24
1110
+ 23
1204
1111
  I
1205
1112
  48
1206
1113
  I
1207
- 36
1114
+ 35
1208
1115
  I
1209
1116
  56
1210
1117
  I
1211
- 3c
1118
+ 3b
1212
1119
  I
1213
1120
  64
1214
- I
1215
- 3e
1216
- I
1217
- 72
1218
1121
  x
1219
1122
  57
1220
1123
  /home/rocky-rvm/.rvm/src/rbx-trepanning/interface/user.rb
@@ -1334,77 +1237,77 @@ I
1334
1237
  I
1335
1238
  45
1336
1239
  I
1337
- 46
1240
+ 3f
1338
1241
  I
1339
1242
  55
1340
1243
  I
1341
- 47
1244
+ 40
1342
1245
  I
1343
1246
  72
1344
1247
  I
1345
- 48
1248
+ 41
1346
1249
  I
1347
1250
  7b
1348
1251
  I
1349
- 49
1252
+ 42
1350
1253
  I
1351
1254
  86
1352
1255
  I
1353
- 4b
1256
+ 44
1354
1257
  I
1355
1258
  9f
1356
1259
  I
1357
- 4c
1260
+ 45
1358
1261
  I
1359
1262
  ac
1360
1263
  I
1361
- 4d
1264
+ 46
1362
1265
  I
1363
1266
  bd
1364
1267
  I
1365
- 4f
1268
+ 48
1366
1269
  I
1367
- d0
1270
+ cf
1368
1271
  I
1369
- 51
1272
+ 4a
1370
1273
  I
1371
- e7
1274
+ e6
1372
1275
  I
1373
- 52
1276
+ 4b
1374
1277
  I
1375
- f4
1278
+ f3
1376
1279
  I
1377
- 53
1280
+ 4c
1378
1281
  I
1379
- 100
1282
+ ff
1380
1283
  I
1381
- 54
1284
+ 4d
1382
1285
  I
1383
- 110
1286
+ 10e
1384
1287
  I
1385
- 55
1288
+ 4e
1386
1289
  I
1387
- 127
1290
+ 125
1388
1291
  I
1389
- 56
1292
+ 4f
1390
1293
  I
1391
- 133
1294
+ 131
1392
1295
  I
1393
- 57
1296
+ 50
1394
1297
  I
1395
- 143
1298
+ 140
1396
1299
  I
1397
- 58
1300
+ 51
1398
1301
  I
1399
- 15b
1302
+ 158
1400
1303
  I
1401
- 49
1304
+ 42
1402
1305
  I
1403
- 15e
1306
+ 15b
1404
1307
  I
1405
- 46
1308
+ 3f
1406
1309
  I
1407
- 162
1310
+ 15f
1408
1311
  x
1409
1312
  57
1410
1313
  /home/rocky-rvm/.rvm/src/rbx-trepanning/interface/user.rb
data/io/base_io.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
1
+ # Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
2
2
  # classes to support communication to and from the debugger. This
3
3
  # communcation might be to/from another process or another computer.
4
4
  # And reading may be from a debugger command script.
@@ -86,9 +86,63 @@ class Trepan
86
86
  # used to write to a debugger that is connected to this
87
87
  # `str' written will have a newline added to it
88
88
  #
89
- def writeline( msg)
89
+ def writeline(msg)
90
90
  @output.write("%s\n" % msg)
91
91
  end
92
92
  end
93
+
94
+ # This is an abstract class that specifies debugger input output when
95
+ # handled by the same channel, e.g. a socket or tty.
96
+ #
97
+ class InOutBase
98
+
99
+ def initialize(inout, opts={})
100
+ @opts = DEFAULT_OPTS.merge(opts)
101
+ @inout = inout
102
+ end
103
+
104
+ def close
105
+ @inout.close() if @inout
106
+ end
107
+
108
+ def eof?
109
+ begin
110
+ @input.eof?
111
+ rescue IOError
112
+ true
113
+ end
114
+ end
115
+
116
+ def flush
117
+ @inout.flush
118
+ end
119
+
120
+ # Read a line of input. EOFError will be raised on EOF.
121
+ #
122
+ # Note that we don't support prompting first. Instead, arrange to
123
+ # call DebuggerOutput.write() first with the prompt. If `use_raw'
124
+ # is set raw_input() will be used in that is supported by the
125
+ # specific input input. If this option is left nil as is normally
126
+ # expected the value from the class initialization is used.
127
+ def readline(use_raw=nil)
128
+ @input.readline
129
+ end
130
+
131
+ # Use this to set where to write to. output can be a
132
+ # file object or a string. This code raises IOError on error.
133
+ #
134
+ # Use this to set where to write to. output can be a
135
+ # file object or a string. This code raises IOError on error.
136
+ def write(*args)
137
+ @inout.write(*args)
138
+ end
139
+
140
+ # used to write to a debugger that is connected to this
141
+ # server; `str' written will have a newline added to it
142
+ def writeline( msg)
143
+ @inout.write("%s\n" % msg)
144
+ end
145
+ end
146
+
93
147
  end
94
148