Getting emacs realgud:pry to work

264 Views Asked by At

Need some help getting realgud to play nice with pry-remote.

This is a sample ruby file (x.rb)

require 'pry-remote'

class Foo
  def initialize(x, y)
    binding.remote_pry
    puts "hello"
  end
end

Foo.new(1,3)

In a shell buffer:

bash: ruby x.rb
[pry-remote] Waiting for client on druby://127.0.0.1:9876

# check that I have a listening process
bash: ss -nlt
State      Recv-Q Send-Q        Local Address:Port          Peer Address:Port
LISTEN     0      128               127.0.0.1:9876                     *:*

In emacs:

M-x realgud:pry
pry-remote ; enter this at the prompt

This is what I see in emacs;

File Edit Options Buffers Tools Inf-Ruby Debugger Help

    32:   end
    33:
    34:   return_value
    35: end

=>[0G[1] pry(#<PryNav::Tracer>)>

-=--:**--F1  *pry +No filename+ shell*   Bot L53    (Comint:r
      stop unless RUBY_VERSION == '1.9.2'

      return_value = nil
      command = catch(:breakout_nav) do      # Coordinates w$
        return_value = yield
=>      {}    # Nothing thrown == no navigational command
      end

-=--:%%--F1  tracer.rb      24% L21    (Ruby ShortKeys) ---

My question is: why am I seeing the breakpoint in tracer.rb? How do I get the breakpoint to be in my source file?

Hitting 'n' twice in the source window causes the shell buffer to echo the following, but there is no change in the source window itself.

=>[0G[1] pry(#<PryNav::Tracer>)> next 1
next 1

Also, the 'u' and 'd' keystrokes yield

Command down is not implemented for this debugger
Command up is not implemented for this debugger
0

There are 0 best solutions below