debug 1.4.0 → 1.9.2

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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +210 -6
  3. data/Gemfile +2 -0
  4. data/LICENSE.txt +0 -0
  5. data/README.md +161 -85
  6. data/Rakefile +33 -10
  7. data/TODO.md +8 -8
  8. data/debug.gemspec +9 -7
  9. data/exe/rdbg +23 -4
  10. data/ext/debug/debug.c +111 -21
  11. data/ext/debug/extconf.rb +23 -0
  12. data/ext/debug/iseq_collector.c +2 -0
  13. data/lib/debug/abbrev_command.rb +77 -0
  14. data/lib/debug/breakpoint.rb +102 -74
  15. data/lib/debug/client.rb +46 -12
  16. data/lib/debug/color.rb +0 -0
  17. data/lib/debug/config.rb +129 -36
  18. data/lib/debug/console.rb +46 -40
  19. data/lib/debug/dap_custom/traceInspector.rb +336 -0
  20. data/lib/debug/frame_info.rb +40 -25
  21. data/lib/debug/irb_integration.rb +37 -0
  22. data/lib/debug/local.rb +17 -11
  23. data/lib/debug/open.rb +0 -0
  24. data/lib/debug/open_nonstop.rb +0 -0
  25. data/lib/debug/prelude.rb +3 -2
  26. data/lib/debug/server.rb +126 -56
  27. data/lib/debug/server_cdp.rb +673 -248
  28. data/lib/debug/server_dap.rb +497 -261
  29. data/lib/debug/session.rb +899 -441
  30. data/lib/debug/source_repository.rb +122 -49
  31. data/lib/debug/start.rb +1 -1
  32. data/lib/debug/thread_client.rb +460 -155
  33. data/lib/debug/tracer.rb +10 -16
  34. data/lib/debug/version.rb +1 -1
  35. data/lib/debug.rb +7 -2
  36. data/misc/README.md.erb +106 -56
  37. metadata +14 -24
  38. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -24
  39. data/.github/ISSUE_TEMPLATE/custom.md +0 -10
  40. data/.github/ISSUE_TEMPLATE/feature_request.md +0 -14
  41. data/.github/pull_request_template.md +0 -9
  42. data/.github/workflows/ruby.yml +0 -34
  43. data/.gitignore +0 -12
  44. data/bin/console +0 -14
  45. data/bin/gentest +0 -30
  46. data/bin/setup +0 -8
  47. data/lib/debug/bp.vim +0 -68
@@ -1,9 +0,0 @@
1
- Thanks for your Pull Request 🎉
2
-
3
- **Please follow these instructions to help us review it more efficiently:**
4
-
5
- - Add references of related issues/PRs in the description if available.
6
- - If you're updating the readme file, make sure you followed [the instruction here](https://github.com/ruby/debug/blob/master/CONTRIBUTING.md#to-update-readme).
7
-
8
- ## Description
9
- Describe your changes:
@@ -1,34 +0,0 @@
1
- # This workflow uses actions that are not certified by GitHub.
2
- # They are provided by a third-party and are governed by
3
- # separate terms of service, privacy policy, and support
4
- # documentation.
5
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
-
8
- name: Ruby
9
-
10
- on:
11
- push:
12
- branches: [ master ]
13
- pull_request:
14
- branches: [ master ]
15
-
16
- jobs:
17
- test:
18
-
19
- runs-on: ubuntu-latest
20
- strategy:
21
- matrix:
22
- ruby-version: ['2.6', '2.7', '3.0', 'head', 'debug']
23
-
24
- steps:
25
- - uses: actions/checkout@v2
26
- - name: Set up Ruby
27
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
28
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
29
- uses: ruby/setup-ruby@v1
30
- with:
31
- ruby-version: ${{ matrix.ruby-version }}
32
- bundler-cache: true # runs 'bundle install' and caches installed gems automatically
33
- - name: Run tests
34
- run: bundle exec rake
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
- *.bundle
10
- /Gemfile.lock
11
- /lib/debug/debug.so
12
- .ruby-version
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "debug"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/gentest DELETED
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'optparse'
4
-
5
- require_relative '../test/tool/test_builder'
6
-
7
- options = {}
8
-
9
- OptionParser.new do |opt|
10
- opt.banner = 'Usage: bin/gentest [file] [option]'
11
- opt.on('-m METHOD', 'Method name in the test file') do |m|
12
- options[:method] = m
13
- end
14
- opt.on('-c CLASS', 'Class name in the test file') do |c|
15
- options[:class] = c
16
- end
17
- opt.on('--open=FRONTEND', 'Start remote debugging with opening the network port.',
18
- 'Currently, only vscode is supported.') do |f|
19
- options[:open] = f.downcase
20
- end
21
- opt.parse!(ARGV)
22
- end
23
-
24
- exit if ARGV.empty?
25
-
26
- if options[:open] == 'vscode'
27
- DEBUGGER__::DAPTestBuilder.new(ARGV, options[:method], options[:class]).start
28
- else
29
- DEBUGGER__::LocalTestBuilder.new(ARGV, options[:method], options[:class]).start
30
- end
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/lib/debug/bp.vim DELETED
@@ -1,68 +0,0 @@
1
- let g:rdb_bps = {}
2
-
3
- function SET_BP()
4
- let signed = sign_getplaced(bufname(), {'lnum': line('.')})
5
- if empty(signed[0]['signs'])
6
- call sign_place(0, '', 'signBP', bufname(), {'lnum': line('.')})
7
- else
8
- "echo signed[0]['signs']
9
- call sign_unplace('', {'buffer': bufname(), 'id': signed[0]['signs'][0]['id']})
10
- endif
11
- endfunction
12
-
13
- function UPDATE_BPS()
14
- let signs = sign_getplaced(bufname())
15
- let key = expand('%:p')
16
-
17
- if empty(signs[0]['signs'])
18
- let removed = remove(g:rdb_bps, key)
19
- else
20
- let g:rdb_bps[key] = signs[0]['signs']
21
- endif
22
- endfunction
23
-
24
- function APPLY_BPS()
25
- let key = expand('%:p')
26
- if has_key(g:rdb_bps, key)
27
- for b in g:rdb_bps[key]
28
- call sign_place(0, '', 'signBP', bufname(), {'lnum': b['lnum']})
29
- endfor
30
- endif
31
- endfunction
32
-
33
- function WRITE_BPS()
34
- call writefile([json_encode(g:rdb_bps)], '.rdb_breakpoints.json')
35
- endfunction
36
-
37
- " load
38
- try
39
- let json = readfile('.rdb_breakpoints.json')
40
- let g:rdb_bps = json_decode(json[0])
41
- " {"/full/path/to/file1": [{"lnum": 10}, ...], ...}
42
- catch /Can't open/
43
- let g:rdb_bps = {}
44
- catch /Invalid arguments for function json_decode/
45
- let g:rdb_bps = {}
46
- endtry
47
-
48
- sign define signBP text=BR
49
-
50
- call APPLY_BPS()
51
-
52
- autocmd BufReadPost * call APPLY_BPS()
53
- autocmd BufUnload * call UPDATE_BPS()
54
- autocmd VimLeave * call WRITE_BPS()
55
-
56
- function! s:ruby_bp_settings() abort
57
- echomsg "Type <Space> to toggle break points and <q> to quit"
58
-
59
- if &readonly
60
- nnoremap <silent> <buffer> <Space> :call SET_BP()<CR>
61
- nnoremap <silent> <buffer> q :<C-u>quit<CR>
62
- endif
63
- endfunction
64
-
65
- " autocmd FileType ruby call s:ruby_bp_settings()
66
- autocmd BufEnter *.rb call s:ruby_bp_settings()
67
-
68
- call s:ruby_bp_settings()