Sha256: 1d7afe8e1e637a366a6d5d2181a76c0dc91941d123f9852a017a21995206d172
Contents?: true
Size: 1.08 KB
Versions: 12
Compression:
Stored size: 1.08 KB
Contents
# -*- coding: utf-8 -*- # Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net> require_relative '../../base/subsubcmd' class Trepan::SubSubcommand::SetDebugDbgr < Trepan::SetBoolSubSubcommand unless defined?(HELP) NAME = File.basename(__FILE__, '.rb') PREFIX = %W(set debug #{NAME}) HELP = "#{PREFIX.join(" ")} [on|off] Facilitates debugging the debugger. Global variables $trepan_cmdproc and $trepan_frame are set to the current values of @frame and self when the command processor was entered." MIN_ABBREV = 'db'.size SHORT_HELP = 'Set debugging debugger' end def run(args) super @proc.cmdloop_prehooks.insert_if_new(-1, *@proc.debug_dbgr_hook) @proc.debug_dbgr_hook[1].call end end if __FILE__ == $0 # Demo it. require_relative '../../../mock' require_relative '../debug' cmd = MockDebugger::subsub_setup(Trepan::SubSubcommand::SetDebug, Trepan::SubSubcommand::SetDebugDbgr) %w(off on 0 1).each { |arg| cmd.run([cmd.name, arg]) } puts '-' * 10 puts cmd.save_command.join("\n") end
Version data entries
12 entries across 12 versions & 1 rubygems