Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions exe/rdbg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ when :start
exec(env, cmd, *ARGV)

when :attach
require_relative "../lib/debug/session"
require_relative "../lib/debug/client"
::DEBUGGER__::CONFIG.set_config(**config)

Expand Down
27 changes: 5 additions & 22 deletions lib/debug/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -471,32 +471,15 @@ def self.create_unix_domain_socket_name(base_dir = unix_domain_socket_dir)

def self.parse_help
helps = Hash.new{|h, k| h[k] = []}
desc = cat = nil
cmds = Hash.new

File.read(File.join(__dir__, 'session.rb'), encoding: Encoding::UTF_8).each_line do |line|
case line
when /\A\s*### (.+)/
cat = $1
break if $1 == 'END'
when /\A when (.+)/
next unless cat
next unless desc
ws = $1.split(/,\s*/).map{|e| e.gsub('\'', '')}
helps[cat] << [ws, desc]
desc = nil
max_w = ws.max_by{|w| w.length}
ws.each{|w|
cmds[w] = max_w
}
when /\A\s+# (\s*\*.+)/
if desc
desc << "\n" + $1
else
desc = $1
end
DEBUGGER__::Session::COMMAND_SET.values.uniq.each do |command|
command.names.each do |name|
cmds[name] = command.name
end
helps[command.category] << [command.names, command.doc]
end

@commands = cmds
@helps = helps
end
Expand Down
Loading