rbx-trepanning 0.1.0-universal-rubinius-1.2 → 0.2.1-universal-rubinius-1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +3 -0
  3. data/.travis.yml +4 -0
  4. data/ChangeLog +162 -0
  5. data/Gemfile +16 -0
  6. data/NEWS +15 -8
  7. data/README.md +72 -0
  8. data/Rakefile +16 -13
  9. data/app/client.rb +15 -4
  10. data/app/cmd_parse.kpeg +38 -40
  11. data/app/cmd_parse.rb +25 -20
  12. data/app/cmd_parser.rb +1030 -1036
  13. data/app/complete.rb +12 -12
  14. data/app/default.rb +6 -5
  15. data/app/display.rb +2 -2
  16. data/app/frame.rb +17 -4
  17. data/app/method.rb +11 -10
  18. data/app/options.rb +21 -22
  19. data/app/util.rb +17 -10
  20. data/interface/user.rb +2 -2
  21. data/io/input.rb +13 -3
  22. data/lib/trepanning.rb +22 -23
  23. data/processor.rb +32 -32
  24. data/processor/command.rb +32 -13
  25. data/processor/command/backtrace.rb +2 -16
  26. data/processor/command/base/submgr.rb +22 -14
  27. data/processor/command/base/subsubcmd.rb +11 -13
  28. data/processor/command/base/subsubmgr.rb +38 -19
  29. data/processor/command/disassemble.rb +11 -11
  30. data/processor/command/help.rb +24 -24
  31. data/processor/command/shell.rb +17 -17
  32. data/processor/default.rb +5 -2
  33. data/processor/frame.rb +37 -0
  34. data/processor/help.rb +9 -11
  35. data/processor/load_cmds.rb +53 -40
  36. data/processor/location.rb +2 -2
  37. data/processor/mock.rb +8 -9
  38. data/processor/subcmd.rb +12 -12
  39. data/rbx-trepanning.gemspec +4 -3
  40. data/sample/rocky-trepanx-colors.rb +1 -1
  41. data/test/example/factorial.rb +10 -0
  42. data/test/functional/fn_helper.rb +8 -7
  43. data/test/functional/test-break.rb +39 -5
  44. data/test/functional/test-recursive-bt.rb +105 -0
  45. data/test/integration/helper.rb +14 -14
  46. data/test/integration/test-quit.rb +8 -2
  47. data/test/unit/cmd-helper.rb +2 -2
  48. data/test/unit/test-base-subcmd.rb +14 -3
  49. data/test/unit/test-completion.rb +7 -3
  50. data/test/unit/test-io-tcpserver.rb +10 -5
  51. data/test/unit/test-proc-validate.rb +4 -4
  52. metadata +208 -113
  53. data/README.textile +0 -34
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ODNmMTE5OWU1NmZjYTg1ZjgwZTBlMmJmZGYxODU4YjNmODMyNTlkNA==
5
+ data.tar.gz: !binary |-
6
+ ZTZjNTU2MjE3YjE2MWQ2ODU0N2U2ODcxYTI1ZGM1MDFhYTg1ODFmNQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ Mzc4YjRlZDYwN2NiYzUxYmNiMWZmYmFkYWZhMzVlMzFhOTQ0NDMwNzQ2ZTRj
10
+ MjAwNmMxYzJiOWVmODBlM2Y2MmRlYTA5MWRhNzQxYzRjZmQ3NzM2ZTRiZDgy
11
+ Y2IyZDYyZjcxOTk2NTViODIyMDcxODY0OTNmMTY5NDUzZjE2MjI=
12
+ data.tar.gz: !binary |-
13
+ Y2Y3OTJjYjgxM2I5ODBmMzU2NzIyMDdiNmQyMWEzMWIyNDE3YjY0M2NkMjRl
14
+ NDJiZjhlM2YzNGNjNmI4OTliNWVkYWJkZDdjZWM3Yzg1NTlhMDY0MDZhNWQz
15
+ ZjczM2ExN2NmYmRjZjk1NTgwNjg0MjEwNjUxMWViNDc3YWRiZTE=
data/.gitignore CHANGED
@@ -1,5 +1,8 @@
1
+ .rbx
1
2
  /*.rbc
2
3
  /*~
4
+ /Gemfile.lock
3
5
  /irc-discuss
4
6
  /pkg
5
7
  /tmp
8
+ rbx-trepanning*.gemspec
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - rbx-19mode
data/ChangeLog CHANGED
@@ -1,3 +1,165 @@
1
+ 2013-07-18 rocky <rockyb@rubyforge.org>
2
+
3
+ * NEWS, app/options.rb: Get ready for release 0.2.1
4
+
5
+ 2013-07-18 rocky <rockyb@rubyforge.org>
6
+
7
+ * README.md, README.textile: Update REAME
8
+
9
+ 2013-07-18 rocky <rockyb@rubyforge.org>
10
+
11
+ * test/integration/test-quit.rb, test/unit/test-io-tcpserver.rb:
12
+ Make tests work in the presense of different environmental
13
+ conditions.
14
+
15
+ 2013-07-18 rocky <rockyb@rubyforge.org>
16
+
17
+ * test/functional/fn_helper.rb,
18
+ test/functional/test-recursive-bt.rb, test/integration/test-quit.rb:
19
+ ... And the last of the failing 1.9 tests are working! (This batch
20
+ was just about tests, not the debugger code)
21
+
22
+ 2013-07-18 rocky <rockyb@rubyforge.org>
23
+
24
+ * app/cmd_parse.rb: Ruby 1.8/1.9 compatability. This one is
25
+ important and buried deep in there: resolving method/class objects.
26
+
27
+ 2013-07-17 rocky <rockyb@rubyforge.org>
28
+
29
+ * processor/command/base/subsubcmd.rb, processor/help.rb: More
30
+ 1.8/1.9 compatibility
31
+
32
+ 2013-07-17 rocky <rockyb@rubyforge.org>
33
+
34
+ * : commit 7ae1a2e45c687ab388064cc7af4ea497aefc7d06 Author: rocky
35
+ <rockyb@rubyforge.org> Date: Wed Jul 17 16:44:18 2013 -0400
36
+
37
+ 2013-07-17 rocky <rockyb@rubyforge.org>
38
+
39
+ * Gemfile, app/cmd_parser.rb: Update parser with kpeg version 0.10.0
40
+
41
+ 2013-07-17 rocky <rockyb@rubyforge.org>
42
+
43
+ * app/util.rb, processor/command.rb,
44
+ processor/command/base/subsubmgr.rb, test/unit/test-base-subcmd.rb:
45
+ More 1.9/1.8 compatability
46
+
47
+ 2013-07-16 rocky <rockyb@rubyforge.org>
48
+
49
+ * Rakefile, app/complete.rb, processor/command/base/submgr.rb,
50
+ processor/command/help.rb, processor/load_cmds.rb,
51
+ processor/mock.rb, processor/subcmd.rb: Deal with one more ruby 1.8
52
+ vs 1.9 incompatiblity
53
+
54
+ 2013-07-16 rocky <rockyb@rubyforge.org>
55
+
56
+ * Gemfile, processor/load_cmds.rb, rbx-trepanning.gemspec: Start
57
+ using redcard to make this work on both rubinius 1.8 and 1.9
58
+
59
+ 2013-07-15 rocky <rockyb@rubyforge.org>
60
+
61
+ * app/cmd_parse.kpeg, app/cmd_parse.rb, lib/trepanning.rb,
62
+ processor.rb, processor/load_cmds.rb: Towards getting this to work
63
+ on the 1.9.3 dialect
64
+
65
+ 2013-07-15 rocky <rockyb@rubyforge.org>
66
+
67
+ * Rakefile, processor/mock.rb: Rakefile is now 1.9 compliant
68
+
69
+ 2013-07-15 rocky <rockyb@rubyforge.org>
70
+
71
+ * test/unit/test-proc-validate.rb: More aggressive setting of
72
+ :start_frame in mock debugger
73
+
74
+ 2013-07-15 rocky <rockyb@rubyforge.org>
75
+
76
+ * test/unit/cmd-helper.rb: More aggressive setting of :start_frame
77
+ in mock debugger
78
+
79
+ 2013-07-15 rocky <rockyb@rubyforge.org>
80
+
81
+ * processor/command/shell.rb: Remove stray spaces between "msg" and
82
+ before "("
83
+
84
+ 2013-07-15 rocky <rockyb@rubyforge.org>
85
+
86
+ * processor/command/disassemble.rb: Remove stray space betwein "msg"
87
+ and before "("
88
+
89
+ 2013-07-15 rocky <rockyb@rubyforge.org>
90
+
91
+ * app/default.rb, test/unit/cmd-helper.rb: Add default value for
92
+ "start_frame" setting
93
+
94
+ 2013-07-15 rocky <rockyb@rubyforge.org>
95
+
96
+ * Gemfile: Forgot columnize
97
+
98
+ 2013-07-15 rocky <rockyb@rubyforge.org>
99
+
100
+ * Gemfile: Travis wants rdoc in Gemfile
101
+
102
+ 2013-07-15 rocky <rockyb@rubyforge.org>
103
+
104
+ * Gemfile: Travis wants rake in Gemfile
105
+
106
+ 2013-07-15 rocky <rockyb@rubyforge.org>
107
+
108
+ * .gitignore, Gemfile, rbx-trepanning.gemspec: Add a Bundler
109
+ Gemfile.
110
+
111
+ 2013-07-14 rocky <rockyb@rubyforge.org>
112
+
113
+ * app/options.rb: Bump required gem versions
114
+
115
+ 2013-07-14 rocky <rockyb@rubyforge.org>
116
+
117
+ * .travis.yml: Try travis
118
+
119
+ 2013-07-14 rocky <rockyb@rubyforge.org>
120
+
121
+ * ChangeLog, app/options.rb: Get ready for release 0.2.0
122
+
123
+ 2013-07-14 rocky <rockyb@rubyforge.org>
124
+
125
+ * app/method.rb, lib/trepanning.rb, processor/load_cmds.rb,
126
+ test/functional/test-break.rb, test/integration/helper.rb,
127
+ test/unit/test-completion.rb: Changes to get this to work on
128
+ rubinius 2.0.0.rc1 (1.8.7 93c75658...) app/method.rb:
129
+ top_scope.parent can be nil lib/trepanning.rb: Locations have
130
+ changed to get -Xcode start correct processor/load_cmds.rb: $0 can
131
+ be nil when -Xtrace is used
132
+
133
+ 2013-03-10 rocky <rockyb@rubyforge.org>
134
+
135
+ * processor/default.rb: A more clever displaywidth default setting
136
+
137
+ 2013-02-08 rocky <rockyb@rubyforge.org>
138
+
139
+ * .gitignore: Administrivia
140
+
141
+ 2013-02-08 rocky <rockyb@rubyforge.org>
142
+
143
+ * app/display.rb, app/frame.rb, app/method.rb,
144
+ processor/location.rb: static_scope -> constant_scope.
145
+ compiled_method->compiled_code. Thanks brixen!
146
+
147
+ 2012-11-26 R. Bernstein <rockyb@rubyforge.org>
148
+
149
+ * sample/rocky-trepanx-colors.rb: Update
150
+ sample/rocky-trepanx-colors.rb
151
+
152
+ 2012-06-27 rvm <rocky@gnu.org>
153
+
154
+ * app/client.rb, interface/user.rb, io/input.rb,
155
+ sample/rocky-trepanx-colors.rb: Remote execution corrections found
156
+ in rb-trepanning' .
157
+
158
+ 2011-10-29 rocky <rockyb@rubyforge.org>
159
+
160
+ * : commit a7fb8932e29a9afa95a355c0eef1f1d06783d8b1 Author: rocky
161
+ <rockyb@rubyforge.org> Date: Sat Oct 29 12:33:05 2011 -0400
162
+
1
163
  2011-10-27 rvm <rocky@gnu.org>
2
164
 
3
165
  * NEWS, app/rbx-llvm.rb, rbx-trepanning.gemspec,
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+ gem 'rake'
3
+ gem 'redcard'
4
+ gem 'rdoc'
5
+ gem 'columnize'
6
+ gem 'rbx-require-relative', :require => 'require_relative'
7
+ gem 'rbx-linecache', :require => 'linecache'
8
+ gem 'coderay', '>=1.0'
9
+
10
+ group :test do
11
+ gem 'diff-lcs'
12
+ end
13
+
14
+ group :development do
15
+ gem 'kpeg'
16
+ end
data/NEWS CHANGED
@@ -1,5 +1,12 @@
1
+ July 18, 2013 (0.2.1)
2
+ - Changes to make it work on 1.9 language dialect for 2.0rc1
3
+
4
+ July 14, 2013
5
+ - Changes to make it work on 1.8 language dialect for 2.0rc1
6
+
7
+
1
8
  Oct 27, 2011 (0.1.0)
2
- - Add debugger commands:
9
+ - Add debugger commands:
3
10
  * info variables (is in ruby-debug)
4
11
  * info locals as alternative to "info variables locals" (is in gdb)
5
12
 
@@ -38,7 +45,7 @@ June 12, 2011 (0.0.9) Fleetwood release
38
45
  - Add options from ruby-debug:
39
46
  * --cd
40
47
  * --include
41
- * --require
48
+ * --require
42
49
  * --debug
43
50
  - fix bugs, and improve help
44
51
 
@@ -50,10 +57,10 @@ March 15, 2011 (0.0.8)
50
57
  * VM offsets are now specified via @ rather than o or O
51
58
  * Filenames can be quoted and blanks and characters inside escaped
52
59
  - Document command syntax by adding it as a new category with sub help
53
- - More controlled parsing of method names
60
+ - More controlled parsing of method names
54
61
  - improvements to "info files"
55
62
  show if we have a compiled method object for the file
56
- - eval? now strips more:
63
+ - eval? now strips more:
57
64
  * leading "return" or "case", or "unless"
58
65
  * trailing "then"
59
66
  - Save and restore some debugger state across a restart
@@ -74,17 +81,17 @@ Feb 15, 2011 (0.0.6)
74
81
 
75
82
  Feb 15, 2011 (0.0.5)
76
83
  - "disassemble" command: allow disassembly of specified line numbers
77
- - GNU Readline:
78
- * Start GNU readline tab (command) completion.
84
+ - GNU Readline:
85
+ * Start GNU readline tab (command) completion.
79
86
  * Save and restore command history
80
87
  * add --readline and --no-readline options to trepanx
81
88
  - Macros can return more than one command now
82
- - help
89
+ - help
83
90
  * "help macros" shows all macro names
84
91
  * "help aliases" shows all alias names
85
92
  * "help *" lists macros and aliases now
86
93
  - start "info line"
87
- - "info file" has/shows File::stat()'s mtime and ctime
94
+ - "info file" has/shows File::stat()'s mtime and ctime
88
95
  - be able to pass --verbose to ruby to rake
89
96
 
90
97
 
data/README.md ADDED
@@ -0,0 +1,72 @@
1
+ [![Build Status](https://travis-ci.org/rocky/rbx-trepanning.png)](https://travis-ci.org/rocky/rbx-trepanning)
2
+
3
+ ## Summary trepanx
4
+
5
+ The trepanning debugger gdb-like debugger. As such, it is both a high-level and low-level debugger. It is a also a rewrite of *ruby-debug*.
6
+
7
+ ## Installing
8
+
9
+ ```console
10
+ gem install rbx-trepanning
11
+ ```
12
+
13
+ If you want to run from git:
14
+
15
+ ```console
16
+ $ git clone https://github.com/rocky/rbx-trepanning.git
17
+ $ cd rbx-trepanning
18
+ $ bundle install # load dependent packages
19
+ $ rake test # test it
20
+ $ rake install # install it
21
+ ```
22
+
23
+ should get you going.
24
+
25
+
26
+
27
+ ## Running
28
+
29
+ To run initially:
30
+
31
+ ```console
32
+ $ trepanx my-ruby-program.rb
33
+ ```
34
+
35
+ Or to call from inside your code:
36
+
37
+ ```console
38
+ require 'trepanning'
39
+ debugger # Don't stop here...
40
+ work # but stop here.
41
+ ```
42
+
43
+ If you want an immediate stop:
44
+
45
+ ```console
46
+ debugger(:immediate=>true)
47
+ ```
48
+
49
+ Finally, if you put in your _.trepanx_
50
+
51
+ ```ruby
52
+ Rubinius::Loader.debugger = proc {
53
+ require 'trepanning';
54
+ Trepan.start(:skip_loader => :Xdebug)
55
+ }
56
+ ```
57
+
58
+ Then you can use the _-Xdebug_ option the Ruby, e.g.
59
+
60
+ ```
61
+ rbx -Xdebug my-ruby-program.rb
62
+ ```
63
+
64
+ ## See Also
65
+
66
+ * There is extensive on-line help. Run `help` inside the debugger.
67
+ * There is a [google group mailing list](http://groups.google.com/group/ruby-debugger for Ruby debuggers.)
68
+ * The [Wiki](https://github.com/rocky/rbx-trepanning/wiki).
69
+
70
+ ## Author
71
+
72
+ Rocky Bernstein
data/Rakefile CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env rake
2
2
  # -*- Ruby -*-
3
- # Are we Rubinius? The right versions of it?
4
- raise RuntimeError,
3
+ # Are we Rubinius? The right versions of it?
4
+ raise RuntimeError,
5
5
  'This package is for Rubinius 1.2.[34] or 2.0.x only!' unless
6
- Object.constants.include?('Rubinius') &&
7
- Rubinius.constants.include?('VM') &&
6
+ Object.constants.include?('Rubinius') &&
7
+ Rubinius.constants.include?('VM') &&
8
8
  Rubinius::VERSION =~ /1\.2\.[34]/ || Rubinius::VERSION =~ /2\.0/
9
9
 
10
10
  require 'rubygems'
@@ -36,8 +36,9 @@ task :gem=>:gemspec do
36
36
  two_filename = gemspec.dup.file_name.gsub(/1\.2/, '2.0')
37
37
  FileUtils.cp("rbx-trepanning.gemspec", "rbx-trepanning-2.0.gemspec")
38
38
  gemspec_filename2 = "rbx-trepanning-2.0.gemspec"
39
- f = File.open(gemspec_filename2, "w")
40
- f.write(lines); f.close
39
+ File.open(gemspec_filename2, 'w') do |f|
40
+ lines.each {|line| f.write(line)}
41
+ end
41
42
  sh "gem build #{gemspec_filename2}"
42
43
  FileUtils.mv("#{two_filename}", "pkg/")
43
44
  end
@@ -64,14 +65,15 @@ task :check => :test
64
65
 
65
66
  require 'rbconfig'
66
67
  def RbConfig.ruby
67
- File.join(RbConfig::CONFIG['bindir'],
68
- RbConfig::CONFIG['RUBY_INSTALL_NAME'] +
68
+ File.join(RbConfig::CONFIG['bindir'],
69
+ RbConfig::CONFIG['RUBY_INSTALL_NAME'] +
69
70
  RbConfig::CONFIG['EXEEXT'])
70
71
  end unless defined? RbConfig.ruby
71
72
 
72
73
  def run_standalone_ruby_files(list, opts={})
73
74
  puts '*' * 40
74
75
  list.each do |ruby_file|
76
+ puts ruby_file
75
77
  system(RbConfig.ruby, ruby_file)
76
78
  p $?.exitstatus
77
79
  break if $?.exitstatus != 0 && !opts[:continue]
@@ -123,7 +125,7 @@ task :test do
123
125
  e
124
126
  end
125
127
  end.compact
126
-
128
+
127
129
  exceptions.each {|e| puts e;puts e.backtrace }
128
130
  raise 'Test failures' unless exceptions.empty?
129
131
  end
@@ -164,6 +166,7 @@ end
164
166
 
165
167
  desc 'Run each processor Ruby file in standalone mode.'
166
168
  task :'check:unit' do
169
+ # run_standalone_ruby_files(FileList['test/unit/**/test-*.rb'], :continue=>true)
167
170
  run_standalone_ruby_files(FileList['test/unit/**/test-*.rb'])
168
171
  end
169
172
 
@@ -181,8 +184,8 @@ desc 'Generate command parser.'
181
184
  task :'cmd_parse' do
182
185
  require 'tmpdir'
183
186
  temp_file = File.join(Dir.tmpdir, "cmd_parser_#{$$}.rb")
184
- sh("kpeg --name CmdParse --verbose --stand-alone " +
185
- "#{File.join(ROOT_DIR, %w(app cmd_parse.kpeg))} " +
187
+ sh("kpeg --name CmdParse --verbose --stand-alone " +
188
+ "#{File.join(ROOT_DIR, %w(app cmd_parse.kpeg))} " +
186
189
  "--output #{temp_file}")
187
190
  end
188
191
 
@@ -214,7 +217,7 @@ Rake::RDocTask.new("rdoc") do |rdoc|
214
217
 
215
218
  rdoc.rdoc_files.include(%w(lib/trepanning.rb processor/*.rb
216
219
  processor/command/*.rb
217
- app/*.rb intf/*.rb io/*.rb
220
+ app/*.rb intf/*.rb io/*.rb
218
221
  ))
219
222
  end
220
223
 
@@ -240,5 +243,5 @@ task :rm_tilde_backups do
240
243
  end
241
244
 
242
245
  desc 'Remove built files'
243
- task :clean => [:clobber_package, :clobber_rdoc, :rm_patch_residue,
246
+ task :clean => [:clobber_package, :clobber_rdoc, :rm_patch_residue,
244
247
  :rm_tilde_backups]
data/app/client.rb CHANGED
@@ -1,18 +1,25 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net>
2
+ # Copyright (C) 2011, 2012 Rocky Bernstein <rockyb@rubyforge.net>
3
3
  require 'rubygems'; require 'require_relative'
4
4
  require_relative 'default' # default debugger settings
5
+ require_relative '../lib/trepanning' # main Trepan object & initialization
5
6
  require_relative '../interface/comcodes' # communication codes
6
7
 
7
8
  module Trepanning
8
9
  include Trepanning::RemoteCommunication
9
10
  def start_client(options)
11
+ puts "Client option given"
12
+ user_opts = {}
13
+ %w(readline).each do |opt|
14
+ user_opts[opt.to_sym] = options[opt.to_sym]
15
+ end
10
16
  dbgr = Trepan.new(:client => true,
11
17
  :cmdfiles => [],
12
18
  :initial_dir => options[:chdir],
13
19
  :nx => true,
14
20
  :host => options[:host],
15
- :port => options[:port]
21
+ :port => options[:port],
22
+ :user_opts => user_opts
16
23
  )
17
24
  intf = dbgr.intf[-1]
18
25
  while true
@@ -25,6 +32,11 @@ module Trepanning
25
32
  # p [control_code, line]
26
33
  case control_code
27
34
  when PRINT
35
+
36
+ # FIXME: don't know why server sometimes adds a gratuituous space.
37
+ # the space is added somewhere inside TCPSocket.print
38
+ line = line[0..-2] if line.end_with?("\n ")
39
+
28
40
  print line
29
41
  when CONFIRM_TRUE
30
42
  response = intf.confirm(line, true)
@@ -33,8 +45,7 @@ module Trepanning
33
45
  response = intf.confirm(line, true)
34
46
  intf.write_remote(CONFIRM_REPLY, response ? 'Y' : 'N')
35
47
  when PROMPT
36
- # require 'trepanning'
37
- # debugger
48
+ # Printing of prompt has been handled already by PRINT.
38
49
  begin
39
50
  command = intf.read_command(line)
40
51
  rescue EOFError