Skip to content

First breakpoint is skipped on a remote development environment #900

Closed

Description

@andyw8

Describe the bug

Breakpoint skipped when running on a remote development environment

To Reproduce

  1. Go to https://github.com/github/codespaces-rails to start with a new Rails app.

  2. Choose Use This Template -> Open in a Codespace

  3. Create the following in .vscode/launch.json

       {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
          {
            "type": "rdbg",
            "name": "Run the current file with rdbg",
            "useBundler": true,
            "request": "launch",
            "command": "ruby",
            "script": "${file}",
          },
        ]
    }
  4. Create the following in test.rb.

    a=1
    binding.b
    binding.b
  5. Ensure v0.1.0 of the vscode-rdbg extension is installed.

  6. Switch to test.rb and choose "Run the current file with rdbg". Observe that it correctly stops at the first breakpoint.

  7. Stop the debugger.

  8. Add sleep 1 on a new line after a=1

  9. Choose "Run the current file with rdbg" again.

  10. Observe that it incorrectly skips the first breakpoint and stops at the second.

Your environment

  • ruby -v: ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
  • rdbg -v: rdbg 1.7.1

Expected behavior

It should stop at the first breakpoint.

Activity

  1. changed the title [-]First breakpoint is skipped when running via `bin/rails runner` on a remote development environment[/-] [+]First breakpoint is skipped[/+] on Feb 17, 2023
  2. changed the title [-]First breakpoint is skipped[/-] [+]First breakpoint is skipped on a remote development environment[/+] on Feb 22, 2023
  3. andyw8 commented on Feb 23, 2023

    @andyw8
    ContributorAuthor

    Some further findings on this:

    It seems like a race condition. If I add sleep 0.1 before this line:

    DEBUGGER__.debug{ "readline: #{msg.inspect}" }

    then it stops at the first breakpoint.

    I'm wondering if could relate to #131

    Also:

    • It doesn't occur when useTerminal is enabled.

    (cc @st0012)

  4. andyw8 commented on Feb 23, 2023

    @andyw8
    ContributorAuthor

    Additionally, if I set this to false, it seems to illustrate that it does stop on the first breakpoint, but immediately continues.

    [1, 4] in /workspaces/codespaces-rails/test.rb
         1| a = 1
         2| sleep 1
    =>   3| binding.b
         4| binding.b
    =>#0	<main> at /workspaces/codespaces-rails/test.rb:3
    (rdbg:#debugger) eval $stdout.sync=true
    [1, 4] in /workspaces/codespaces-rails/test.rb
         1| a = 1
         2| sleep 1
         3| binding.b
    =>   4| binding.b
    
  5. added
    bugSomething isn't working
    on Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions