Class: Debugger::RemoteInterface

Inherits:
Interface show all
Defined in:
lib/ruby-debug/interface.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes inherited from Interface

#have_readline

Instance Method Summary collapse

Methods inherited from Interface

#afmt, #aprint, #errmsg, #print_debug

Constructor Details

#initialize(socket) ⇒ RemoteInterface

Returns a new instance of RemoteInterface.



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/ruby-debug/interface.rb', line 147

def initialize(socket)
  @command_queue = []
  @socket = socket
  @history_save = false
  @history_length = 256
  @histfile = ''
  # Do we read the histfile?
#       open(@histfile, 'r') do |file|
#         file.each do |line|
#           line.chomp!
#           Readline::HISTORY << line
#         end
#       end if File.exist?(@histfile)
  @restart_file = nil
end

Instance Attribute Details

#command_queueObject

Returns the value of attribute command_queue.



141
142
143
# File 'lib/ruby-debug/interface.rb', line 141

def command_queue
  @command_queue
end

#histfileObject

Returns the value of attribute histfile.



142
143
144
# File 'lib/ruby-debug/interface.rb', line 142

def histfile
  @histfile
end

#history_lengthObject

Returns the value of attribute history_length.



144
145
146
# File 'lib/ruby-debug/interface.rb', line 144

def history_length
  @history_length
end

#history_saveObject

Returns the value of attribute history_save.



143
144
145
# File 'lib/ruby-debug/interface.rb', line 143

def history_save
  @history_save
end

#restart_fileObject

Returns the value of attribute restart_file.



145
146
147
# File 'lib/ruby-debug/interface.rb', line 145

def restart_file
  @restart_file
end

Instance Method Details

#closeObject



163
164
165
166
# File 'lib/ruby-debug/interface.rb', line 163

def close
  @socket.close
rescue Exception
end

#confirm(prompt) ⇒ Object



168
169
170
# File 'lib/ruby-debug/interface.rb', line 168

def confirm(prompt)
  send_command "CONFIRM #{prompt}"
end

#finalizeObject



172
173
# File 'lib/ruby-debug/interface.rb', line 172

def finalize
end


183
184
185
# File 'lib/ruby-debug/interface.rb', line 183

def print(*args)
  @socket.printf(*escape_input(args))
end

#read_command(prompt) ⇒ Object



175
176
177
# File 'lib/ruby-debug/interface.rb', line 175

def read_command(prompt)
  send_command "PROMPT #{prompt}"
end

#readline_support?Boolean

Returns:

  • (Boolean)


179
180
181
# File 'lib/ruby-debug/interface.rb', line 179

def readline_support?
  false
end