deivid-rodriguez/byebug

Unable to call Byebug.start_server (from byebug/remote)

mistydemeo opened this issue · 0 comments

Problem description

Using Ruby 2.7.1 and Byebug 11.1.3, I'm unable to use Byebug's Byebug.start_server. start_server is defined in byebug-remote. Attempting to call this method leads to the following exception:

NameError: uninitialized constant Byebug::Remote::Server::DebugThread
  /Users/mistydemeo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-11.1.3/lib/byebug/remote/server.rb:35:in `start'
  /Users/mistydemeo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-11.1.3/lib/byebug/remote.rb:49:in `start_control'
  /Users/mistydemeo/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/byebug-11.1.3/lib/byebug/remote.rb:40:in `start_server'
  exe/byebug_test:6:in `<top (required)>'

DebugThread is used here: https://github.com/deivid-rodriguez/byebug/blob/master/lib/byebug/remote/server.rb#L35

And defined in C here: https://github.com/deivid-rodriguez/byebug/blob/master/ext/byebug/context.c#L684

Expected behavior

The server correctly starts up.

Actual behavior

A NameError is raised immediately on startup.

Steps to reproduce the problem

The following simple repro is enough:

require "byebug"
require "byebug/context"
require "byebug/remote"
Byebug.start_server("127.0.0.1", 8989)

$stderr.puts("debugger listening on port #{Byebug.actual_port}")