class Byebug::InfoCommand
Show info about different aspects of the debugger.
def description
def description <<-EOD.gsub(/^ {8}/, '') info[ subcommand] Generic command for showing things about the program being debugged. EOD end
def execute
def execute return puts(InfoCommand.help) unless @match[1] args = @match[1].split(/[ \t]+/) param = args.shift subcmd = Command.find(Subcommands, param) return errmsg "Unknown info command #{param}\n" unless subcmd if @state.context send("info_#{subcmd.name}", *args) else errmsg "info_#{subcmd.name} not available without a context.\n" end end
def help(subcmds = [])
def help(subcmds = []) return description + format_subcmds if subcmds.empty? subcmd = subcmds.first return format_subcmd(subcmd) unless 'file' == subcmd && subcmds[2] subsubcmd = Command.find(InfoFileSubcommands, subcmds[2]) return "\nInvalid \"file\" attribute \"#{args[2]}\"." unless subsubcmd subsubcmd.short_help end
def info_file(*args)
def info_file(*args) return info_files unless args[0] mode = args[1] || 'basic' subcmd = Command.find(InfoFileSubcommands, mode) return errmsg "Invalid parameter #{args[1]}\n" unless subcmd if %w(all basic).member?(subcmd.name) info_file_path(args[0]) info_file_lines(args[0]) if subcmd.name == 'all' info_file_breakpoints(args[0]) info_file_mtime(args[0]) info_file_sha1(args[0]) end else puts("File #{args[0]}") if subcmd.name != 'path' send("info_file_#{subcmd.name}", args[0]) end end
def names
def names %w(info) end
def regexp
def regexp /^\s* i(?:nfo)? (?:\s+(.+))? \s*$/x end