vscode-rdbg icon indicating copy to clipboard operation
vscode-rdbg copied to clipboard

Can't debug pod (CocoaPods), [Error on session] Error: connection closed

Open LancerTZ opened this issue 2 years ago • 3 comments

Can't debug pod within VSCode, here is some related info

launch.json

{
    "name": "rdbg Podfile",
    "type": "rdbg",
    "request": "launch",
    "script": "/usr/local/bin/pod",
    "env": {
        "LANG": "en_US.UTF-8"
    },
    "cwd": "${workspaceRoot}",
    "args": [
        "install",
        "--verbose",
        "--repo-update",
    ]
}

rdbg ext log (rdbg version 1.7.2)

"Running: rdbg --command --open --stop-at-load -- ruby /usr/local/bin/pod install --verbose --repo-update"
[Start session]
{"d":{},"f":"5751f0b3-aff2-4e4a-af98-a4bc56369aa1","g":"rdbg","h":"rdbg Podfile","i":{"uri":{"$mid":1,"fsPath":"/xxx","external":"file:///xxx","path":"/xxx","scheme":"file"},"name":"ios","index":0},"j":{"name":"rdbg Podfile","type":"rdbg","request":"launch","script":"/usr/local/bin/pod","env":{"LANG":"en_US.UTF-8"},"cwd":"/xxx","args":["install","--verbose","--repo-update"],"__configurationTarget":6}}
[Error on session]
Error: connection closed
e: {}

gem env

RubyGems Environment:
  - RUBYGEMS VERSION: 3.1.4
  - RUBY VERSION: 2.6.10 (2022-04-12 patchlevel 210) [universal.arm64e-darwin22]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.6.0
  - USER INSTALLATION DIRECTORY: /Users/tragedystar/.gem/ruby/2.6.0
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /Users/tragedystar/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-22
  - GEM PATHS:
     - /Library/Ruby/Gems/2.6.0
     - /Users/tragedystar/.gem/ruby/2.6.0
     - /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["https://gems.ruby-china.com/"]
     - :concurrent_downloads => 8
  - REMOTE SOURCES:
     - https://gems.ruby-china.com/
  - SHELL PATH:
     - /opt/homebrew/bin
     - /opt/homebrew/sbin
     - /usr/local/bin
     - /System/Cryptexes/App/usr/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /usr/local/go/bin
     - /Library/Apple/usr/bin
     - /Users/tragedystar/.fig/bin
     - /Users/tragedystar/.local/bin

LancerTZ avatar Apr 12 '23 09:04 LancerTZ

Could you run rdbg command on your terminal?

ko1 avatar Apr 12 '23 09:04 ko1

yes, but I don't know how to attach debugger to rdbg

% rdbg --version
rdbg 1.7.2
% rdbg --command --open --stop-at-load -- ruby /usr/local/bin/pod install --verbose --repo-update
DEBUGGER: Debugger can attach via UNIX domain socket (/var/folders/6w/z5r2zbcx6jlb_5sf0lny36nr0000gn/T/ruby-debug-sock-501/ruby-debug-tragedystar-30329)
DEBUGGER: wait for debugger connection...

LancerTZ avatar Apr 12 '23 10:04 LancerTZ

Could you try to use rdbg -A to attach on CLI? If it successes, you can use debug command on REPL (like break file:line to set breakpoints, and c to continue the program).

ko1 avatar Apr 14 '23 05:04 ko1