Skip to content
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

Debugger stops at unexpected places. #552

Closed
ono-max opened this issue Mar 1, 2022 · 3 comments · Fixed by #665
Closed

Debugger stops at unexpected places. #552

ono-max opened this issue Mar 1, 2022 · 3 comments · Fixed by #665
Milestone

Comments

@ono-max
Copy link
Member

ono-max commented Mar 1, 2022

Your environment

  • ruby -v:
    ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin21]
  • rdbg -v:

Describe the bug
Debugger stops at unexpected place as follows:

Screen Shot 2022-03-01 at 13 09 56

$ exe/rdbg target.rb --open=vscode
DEBUGGER: Debugger can attach via UNIX domain socket (/var/folders/5j/z2c9zm7124q81f_py4xmd3scp7w9j7/T/ruby-debug-sock-746464807/ruby-debug-naotto-68997)
DEBUGGER: wait for debugger connection...
Launching: code /var/folders/5j/z2c9zm7124q81f_py4xmd3scp7w9j7/T/ruby-debug-vscode-20220301-68997-z4ogr0/ /var/folders/5j/z2c9zm7124q81f_py4xmd3scp7w9j7/T/ruby-debug-vscode-20220301-68997-z4ogr0/README.rb
DEBUGGER: Connected.
puts: => nil
puts: [620, 629] in ~/.rbenv/versions/3.1.0/lib/ruby/3.1.0/pp.rb
puts:    620|
puts:    621|   # prints arguments in pretty form.
puts:    622|   #
puts:    623|   # pp returns argument(s).
puts:    624|   def pp(*objs)
puts: => 625|     objs.each {|obj|
puts:    626|       PP.pp(obj)
puts:    627|     }
puts:    628|     objs.size <= 1 ? objs.first : objs
puts:    629|   end
puts: =>#0	Kernel#pp(objs=[1]) at ~/.rbenv/versions/3.1.0/lib/ruby/3.1.0/pp.rb:625
puts:   #1	<main> at target.rb:1
1
puts: [623, 631] in ~/.rbenv/versions/3.1.0/lib/ruby/3.1.0/pp.rb
puts:    623|   # pp returns argument(s).
puts:    624|   def pp(*objs)
puts:    625|     objs.each {|obj|
puts:    626|       PP.pp(obj)
puts:    627|     }
puts: => 628|     objs.size <= 1 ? objs.first : objs
puts:    629|   end
puts:    630|   module_function :pp
puts:    631| end
puts: =>#0	Kernel#pp(objs=[1]) at ~/.rbenv/versions/3.1.0/lib/ruby/3.1.0/pp.rb:628
puts:   #1	<main> at target.rb:1
puts: [624, 631] in ~/.rbenv/versions/3.1.0/lib/ruby/3.1.0/pp.rb
puts:    624|   def pp(*objs)
puts:    625|     objs.each {|obj|
puts:    626|       PP.pp(obj)
puts:    627|     }
puts:    628|     objs.size <= 1 ? objs.first : objs
puts: => 629|   end
puts:    630|   module_function :pp
puts:    631| end
puts: =>#0	Kernel#pp(objs=[1]) at ~/.rbenv/versions/3.1.0/lib/ruby/3.1.0/pp.rb:629 #=> 1
puts:   #1	<main> at target.rb:1
puts: # No sourcefile available for <internal:kernel>
puts: =>#0	Kernel#class at <internal:kernel>:20

To Reproduce

  1. StepInto
  2. Set the breakpoint at line 628.
  3. Continue
  4. StepInto
  5. StepInto
p 1

Expected behavior
The debugger should not stop there.

Additional context
This bug happens in Chrome DevTools, too.

@ono-max ono-max changed the title Debugger stops at unexpected places. Debugger stops at unexpected places in VSCode. Mar 7, 2022
@ono-max ono-max changed the title Debugger stops at unexpected places in VSCode. Debugger stops at unexpected places. Mar 7, 2022
@ko1
Copy link
Collaborator

ko1 commented Mar 25, 2022

Sorry I can't understand the issue.
Can we share your target.rb?

@ono-max
Copy link
Member Author

ono-max commented Mar 25, 2022

target.rb is as follows:

pp 1

@ko1
Copy link
Collaborator

ko1 commented Mar 25, 2022

Thank you I can repro.

@ko1 ko1 added this to the v1.6.0 milestone Mar 25, 2022
ko1 added a commit that referenced this issue Jun 30, 2022
`CONFIG.skip_all` is called to ignore cleanup code.

fix #552
@ko1 ko1 closed this as completed in #665 Jun 30, 2022
ko1 added a commit that referenced this issue Jun 30, 2022
`CONFIG.skip_all` is called to ignore cleanup code.

fix #552
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants