-
Notifications
You must be signed in to change notification settings - Fork 137
gemspec: Explicitly empty executables list #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This gem exposes no executables.
ko1
added a commit
that referenced
this pull request
May 10, 2021
Show more pretty backtrace like: ``` (rdbg) bt =>#0 block{|i=0, j=nil|} (3 levels) in foo at ~/src/rb/target.rb:12 #1 [C] Integer#times at ~/src/rb/target.rb:11 #2 rescue in rescue in block (2 levels) in foo at ~/src/rb/target.rb:11 #3 rescue in block (2 levels) in foo at ~/src/rb/target.rb:8 #4 block (2 levels) in foo at ~/src/rb/target.rb:5 #5 [C] Integer#times at ~/src/rb/target.rb:4 #6 block{|e=2|} in foo at ~/src/rb/target.rb:4 #7 [C] Range#each at ~/src/rb/target.rb:3 #8 [C] Enumerable#map at ~/src/rb/target.rb:3 #9 Object#foo(a=3) at ~/src/rb/target.rb:3 #10 <main> at ~/src/rb/target.rb:20 ```
ko1
added a commit
that referenced
this pull request
Jun 17, 2021
``` [1, 10] in target.rb 1| 2| def foo 3| p 1 => 4| raise 'foo' 5| end 6| 7| foo 8| __END__ 9| 10| pid = fork do =>#0 Object#foo at target.rb:4 #1 <main> at target.rb:7 Stop by #0 BP - Catch "RuntimeError" (rdbg) i =>#0 Object#foo at target.rb:4 %self => main %raised => #<RuntimeError: foo> ```
ko1
added a commit
that referenced
this pull request
Jun 18, 2021
on C frame, frame.iseq is nil. ``` $ cat target.rb sleep $ exe/rdbg target.rb -n ^C# No sourcefile available for target.rb =>#0 [C] Kernel#sleep at target.rb:1 #1 <main> at target.rb:1 Stop by SIGINT (rdbg) n ["/mnt/c/ko1/src/rb/ruby-debug/lib/debug/thread_client.rb", 598, #<NoMethodError: undefined method `traceable_lines_norec' for nil:NilClass>, ["/mnt/c/ko1/src/rb/ruby-debug/lib/debug/thread_client.rb:444:in `wait_next_action'", "/mnt/c/ko1/src/rb/ruby-debug/lib/debug/thread_client.rb:175:in `on_suspend'", "/mnt/c/ko1/src/rb/ruby-debug/lib/debug/thread_client.rb:121:in `on_trap'", "/mnt/c/ko1/src/rb/ruby-debug/lib/debug/session.rb:1029:in `block in console'", "target.rb:1:in `sleep'", "target.rb:1:in `<main>'"]] Traceback (most recent call last): 5: from target.rb:1:in `<main>' 4: from target.rb:1:in `sleep' 3: from /mnt/c/ko1/src/rb/ruby-debug/lib/debug/session.rb:1029:in `block in console' 2: from /mnt/c/ko1/src/rb/ruby-debug/lib/debug/thread_client.rb:121:in `on_trap' 1: from /mnt/c/ko1/src/rb/ruby-debug/lib/debug/thread_client.rb:175:in `on_suspend' /mnt/c/ko1/src/rb/ruby-debug/lib/debug/thread_client.rb:444:in `wait_next_action': undefined method `traceable_lines_norec' for nil:NilClass (NoMethodError) ```
ko1
added a commit
that referenced
this pull request
Jul 8, 2021
``` [master]$ exe/rdbg target.rb -e 'b 6;; c' DEBUGGER: Session start (pid: 6762) [1, 10] in target.rb 1| => 2| def foo 3| bar 4| end 5| 6| def bar 7| baz 8| end 9| 10| def baz =>#0 <main> at target.rb:2 (rdbg:commands) b 6 (rdbg:commands) c [2, 11] in target.rb 2| def foo 3| bar 4| end 5| 6| def bar => 7| baz 8| end 9| 10| def baz 11| p :baz =>#0 Object#bar at target.rb:7 #1 Object#foo at target.rb:3 # and 1 frames (use `bt' command for all frames) Stop by #0 BP - Line /mnt/c/ko1/src/rb/ruby-debug/target.rb:6 (call) (rdbg) bt =>#0 Object#bar at target.rb:7 #1 Object#foo at target.rb:3 #2 <main> at target.rb:14 (rdbg) bt /bar|main/ =>#0 Object#bar at target.rb:7 #2 <main> at target.rb:14 ```
ko1
added a commit
that referenced
this pull request
Jul 28, 2021
postmortem mode enables to see an environment (backtrace, local variables and so on) when it exit by some exception. ``` DEBUGGER: Session start (pid: 29868) [1, 8] in target.rb 1| => 2| def foo a 3| raise 'foo' 4| end 5| 6| foo(10) 7| 8| __END__ =>#0 <main> at target.rb:2 (rdbg:commands) config postmortem=true postmortem = true # CONTROL: Enable postmortem debug (default: false) (rdbg:commands) c Enter postmortem mode with #<RuntimeError: foo> target.rb:3:in `foo' target.rb:6:in `<main>' [1, 8] in target.rb 1| 2| def foo a => 3| raise 'foo' 4| end 5| 6| foo(10) 7| 8| __END__ =>#0 Object#foo(a=10) at target.rb:3 #1 <main> at target.rb:6 (rdbg:postmortem) i %self = main a = 10 ```
ko1
added a commit
that referenced
this pull request
Oct 20, 2021
This commit allows to debug multi-process by forking. If one process waiting for the input for REPL, all processes (called process group in the source code) waits for entering new interactive session (called subsession in the source code). In other words, the process group has a global lock and a process needs to acquire the lock to enter an subsession. `parent_on_fork` configuration becomes obsolete (will be removed soon) and `fork_mode` is introduced. On the REPL, you will see PID and `$0` information on the prompt on multi-process mode: ``` [1, 6] in target.rb 1| fork{ 2| $0 = 'child_process' => 3| binding.b 4| } 5| 6| __END__ =>#0 block in <main> at target.rb:3 #1 [C] Kernel#fork at /mnt/c/ko1/src/rb/ruby-debug/lib/debug/session.rb:2037 # and 1 frames (use `bt' command for all frames) (rdbg@child_process#15907) ```
ko1
added a commit
that referenced
this pull request
Oct 20, 2021
This commit allows to debug multi-process by forking. If one process waiting for the input for REPL, all processes (called process group in the source code) waits for entering new interactive session (called subsession in the source code). In other words, the process group has a global lock and a process needs to acquire the lock to enter an subsession. `parent_on_fork` configuration becomes obsolete (will be removed soon) and `fork_mode` is introduced. On the REPL, you will see PID and `$0` information on the prompt on multi-process mode: ``` [1, 6] in target.rb 1| fork{ 2| $0 = 'child_process' => 3| binding.b 4| } 5| 6| __END__ =>#0 block in <main> at target.rb:3 #1 [C] Kernel#fork at /mnt/c/ko1/src/rb/ruby-debug/lib/debug/session.rb:2037 # and 1 frames (use `bt' command for all frames) (rdbg@child_process#15907) ```
ko1
added a commit
that referenced
this pull request
Oct 20, 2021
This commit allows to debug multi-process by forking. If one process waiting for the input for REPL, all processes (called process group in the source code) waits for entering new interactive session (called subsession in the source code). In other words, the process group has a global lock and a process needs to acquire the lock to enter an subsession. `parent_on_fork` configuration becomes obsolete (will be removed soon) and `fork_mode` is introduced. On the REPL, you will see PID and `$0` information on the prompt on multi-process mode: ``` [1, 6] in target.rb 1| fork{ 2| $0 = 'child_process' => 3| binding.b 4| } 5| 6| __END__ =>#0 block in <main> at target.rb:3 #1 [C] Kernel#fork at /mnt/c/ko1/src/rb/ruby-debug/lib/debug/session.rb:2037 # and 1 frames (use `bt' command for all frames) (rdbg@child_process#15907) ```
mame
added a commit
to mame/debug
that referenced
this pull request
Jun 4, 2025
The debug gem can abort when stepping into a rescue clause: ``` $ ruby -Ilib exe/rdbg rescue-test.rb [1, 7] in rescue-test.rb => 1| 1.times do 2| begin 3| raise 4| rescue 5| p 1 6| end 7| end =>#0 <main> at rescue-test.rb:1 (rdbg) s # step command [1, 7] in rescue-test.rb 1| 1.times do 2| begin => 3| raise 4| rescue 5| p 1 6| end 7| end =>#0 block in <main> at rescue-test.rb:3 ruby#1 Integer#times at <internal:numeric>:257 # and 1 frames (use `bt' command for all frames) (rdbg) s # step command /home/mame/work/debug/lib/debug/thread_client.rb:85:in 'DEBUGGER__::ThreadClient#default_frame_formatter': undefined method '+' for nil (NoMethodError) "#{colorize_blue("block")}#{args_str} in #{colorize_blue(block_loc + level)}" ^ from /home/mame/work/debug/lib/debug/thread_client.rb:755:in 'Method#call' from /home/mame/work/debug/lib/debug/thread_client.rb:755:in 'DEBUGGER__::ThreadClient#frame_str' from /home/mame/work/debug/lib/debug/thread_client.rb:742:in 'block in DEBUGGER__::ThreadClient#show_frames' from <internal:numeric>:257:in 'Integer#times' from /home/mame/work/debug/lib/debug/thread_client.rb:739:in 'DEBUGGER__::ThreadClient#show_frames' from /home/mame/work/debug/lib/debug/thread_client.rb:304:in 'DEBUGGER__::ThreadClient#suspend' from /home/mame/work/debug/lib/debug/thread_client.rb:358:in 'block in DEBUGGER__::ThreadClient#step_tp' from rescue-test.rb:5:in 'block in <main>' from <internal:numeric>:257:in 'Integer#times' from rescue-test.rb:1:in '<main>' rescue-test.rb:3:in 'block in <main>': unhandled exception from <internal:numeric>:257:in 'Integer#times' from rescue-test.rb:1:in '<main>' ``` This is caused by the design issue of the debug inspector API. See ruby/ruby#13508 This changeset fixes the issue by using a newly-introduced debug inspector API, namely `rb_debug_inspector_frame_loc_get`.
mame
added a commit
to mame/debug
that referenced
this pull request
Jun 4, 2025
``` $ ruby -Ilib exe/rdbg rescue-test.rb [1, 7] in rescue-test.rb => 1| 1.times do 2| begin 3| raise 4| rescue 5| p 1 6| end 7| end =>#0 <main> at rescue-test.rb:1 (rdbg) s # step command [1, 7] in rescue-test.rb 1| 1.times do 2| begin => 3| raise 4| rescue 5| p 1 6| end 7| end =>#0 block in <main> at rescue-test.rb:3 ruby#1 Integer#times at <internal:numeric>:257 # and 1 frames (use `bt' command for all frames) (rdbg) s # step command /home/mame/work/debug/lib/debug/thread_client.rb:85:in 'DEBUGGER__::ThreadClient#default_frame_formatter': undefined method '+' for nil (NoMethodError) "#{colorize_blue("block")}#{args_str} in #{colorize_blue(block_loc + level)}" ^ from /home/mame/work/debug/lib/debug/thread_client.rb:755:in 'Method#call' from /home/mame/work/debug/lib/debug/thread_client.rb:755:in 'DEBUGGER__::ThreadClient#frame_str' from /home/mame/work/debug/lib/debug/thread_client.rb:742:in 'block in DEBUGGER__::ThreadClient#show_frames' from <internal:numeric>:257:in 'Integer#times' from /home/mame/work/debug/lib/debug/thread_client.rb:739:in 'DEBUGGER__::ThreadClient#show_frames' from /home/mame/work/debug/lib/debug/thread_client.rb:304:in 'DEBUGGER__::ThreadClient#suspend' from /home/mame/work/debug/lib/debug/thread_client.rb:358:in 'block in DEBUGGER__::ThreadClient#step_tp' from rescue-test.rb:5:in 'block in <main>' from <internal:numeric>:257:in 'Integer#times' from rescue-test.rb:1:in '<main>' rescue-test.rb:3:in 'block in <main>': unhandled exception from <internal:numeric>:257:in 'Integer#times' from rescue-test.rb:1:in '<main>' ``` This is because `rb_debug_inspector_backtrace_locations` returned a modified backtrace, which skips rescue/ensure frames, but `rb_debug_inspector_frame_XXX_get`'s index is considered for a raw backtrace, which includes rescue/ensure frames. The problem wil be fixed by ruby/ruby#13510. However, now the backtrace includes rescue/ensure frames, so some tests in debug gem fails. This fixes the test failures.
mame
added a commit
that referenced
this pull request
Jun 4, 2025
``` $ ruby -Ilib exe/rdbg rescue-test.rb [1, 7] in rescue-test.rb => 1| 1.times do 2| begin 3| raise 4| rescue 5| p 1 6| end 7| end =>#0 <main> at rescue-test.rb:1 (rdbg) s # step command [1, 7] in rescue-test.rb 1| 1.times do 2| begin => 3| raise 4| rescue 5| p 1 6| end 7| end =>#0 block in <main> at rescue-test.rb:3 #1 Integer#times at <internal:numeric>:257 # and 1 frames (use `bt' command for all frames) (rdbg) s # step command /home/mame/work/debug/lib/debug/thread_client.rb:85:in 'DEBUGGER__::ThreadClient#default_frame_formatter': undefined method '+' for nil (NoMethodError) "#{colorize_blue("block")}#{args_str} in #{colorize_blue(block_loc + level)}" ^ from /home/mame/work/debug/lib/debug/thread_client.rb:755:in 'Method#call' from /home/mame/work/debug/lib/debug/thread_client.rb:755:in 'DEBUGGER__::ThreadClient#frame_str' from /home/mame/work/debug/lib/debug/thread_client.rb:742:in 'block in DEBUGGER__::ThreadClient#show_frames' from <internal:numeric>:257:in 'Integer#times' from /home/mame/work/debug/lib/debug/thread_client.rb:739:in 'DEBUGGER__::ThreadClient#show_frames' from /home/mame/work/debug/lib/debug/thread_client.rb:304:in 'DEBUGGER__::ThreadClient#suspend' from /home/mame/work/debug/lib/debug/thread_client.rb:358:in 'block in DEBUGGER__::ThreadClient#step_tp' from rescue-test.rb:5:in 'block in <main>' from <internal:numeric>:257:in 'Integer#times' from rescue-test.rb:1:in '<main>' rescue-test.rb:3:in 'block in <main>': unhandled exception from <internal:numeric>:257:in 'Integer#times' from rescue-test.rb:1:in '<main>' ``` This is because `rb_debug_inspector_backtrace_locations` returned a modified backtrace, which skips rescue/ensure frames, but `rb_debug_inspector_frame_XXX_get`'s index is considered for a raw backtrace, which includes rescue/ensure frames. The problem wil be fixed by ruby/ruby#13510. However, now the backtrace includes rescue/ensure frames, so some tests in debug gem fails. This fixes the test failures.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This gem exposes no executables.