Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

First stab at bindings to simuliate perldb. Alias help expanded. main…

….rb add interfaces accessor.
  • Loading branch information...
commit 3afc3667543cf548efb78c430800437e8ce7beb9 1 parent e230da4
@rocky authored
View
17 data/perldb.bindings
@@ -0,0 +1,17 @@
+# Aliases to simulate some of the Perl debugger command set
+alias = alias
+alias R restart
+alias b break
+alias c continue
+alias f list
+alias n next
+alias p pr
+alias q quit
+alias s step
+alias v list
+macro - Proc.new{|*args| "list -"}
+macro E Proc.new{|*args| "info thread"}
+macro L Proc.new{|*args| "info break"}
+macro T Proc.new{|*args| "info stack"}
+macro l Proc.new{|*args| "list>"}
+macro r Proc.new{|*args| %w(finish step)}
View
15 processor/command/alias.rb
@@ -8,7 +8,18 @@ class Trepan::Command::AliasCommand < Trepan::Command
HELP = <<-HELP
#{NAME} ALIAS COMMAND
-Add an alias for a COMMAND
+Add alias ALIAS for a debugger command COMMAND.
+
+Add an alias when you want to use a command abbreviation for a command
+that would otherwise be ambigous. For example, by default we make 's'
+be an alias of 'step' to force it to be used. Without the alias, "s"
+might be "step", "show", or "set" among others
+
+Example:
+
+alias cat list # "cat rubyfile.rb" is the same as "list rubyfile.rb"
+alias s step # "s" is now an alias for "step".
+ # The above examples done by default.
See also 'unalias' and 'show #{NAME}'.
HELP
@@ -24,7 +35,7 @@ def run(args)
if args.size == 1
@proc.commands['show'].run(%w(show alias))
elsif args.size == 2
- @proc.commands['show'].run(['show', 'alias', args[1]])
+ @proc.commands['show'].run(%W(show alias #{args[1]}))
else
junk, al, command = args
old_command = @proc.aliases[al]
View
6 processor/command/list.rb
@@ -6,8 +6,8 @@
class Trepan::Command::ListCommand < Trepan::Command
unless defined?(HELP)
- NAME = File.basename(__FILE__, '.rb')
- HELP = <<-HELP
+ NAME = File.basename(__FILE__, '.rb')
+ HELP = <<-HELP
#{NAME}[>] [MODULE] [FIRST [NUM]]
#{NAME}[>] LOCATION [NUM]
@@ -81,7 +81,7 @@ class Trepan::Command::ListCommand < Trepan::Command
disabled.
HELP
- ALIASES = %W(l #{NAME}> l>)
+ ALIASES = %W(l #{NAME}> l> cat)
CATEGORY = 'files'
MAX_ARGS = 3
SHORT_HELP = 'List source code'
View
1  processor/main.rb
@@ -34,6 +34,7 @@ class CmdProcessor < VirtualCmdProcessor
attr_accessor :event # Stop event. Same as @core.event
attr_reader :intf # Current interface
# Trepan::Core instance)
+ attr_reader :interfaces # Array of all interfaces
attr_accessor :leave_cmd_loop # Commands set this to signal to leave
# the command loop (which often continues to
# run the debugged program).
Please sign in to comment.
Something went wrong with that request. Please try again.