rbx-trepanning 0.0.8-universal-rubinius-1.2 → 0.1.0-universal-rubinius-1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +762 -238
- data/NEWS +44 -0
- data/Rakefile +61 -32
- data/app/breakpoint.rb +2 -0
- data/app/brkptmgr.rb +9 -11
- data/app/client.rb +0 -1
- data/app/cmd_parse.kpeg +21 -4
- data/app/cmd_parse.rb +10 -10
- data/app/cmd_parser.rb +1029 -840
- data/app/complete.rb +1 -1
- data/app/display.rb +38 -0
- data/app/file.rb +24 -0
- data/app/frame.rb +11 -4
- data/app/irb.rb +41 -39
- data/app/iseq.rb +71 -0
- data/app/options.rb +55 -30
- data/app/rbx-llvm.rb +0 -2
- data/app/run.rb +13 -9
- data/app/util.rb +55 -5
- data/bin/trepanx +3 -3
- data/data/irbrc +13 -13
- data/{interface/base_intf.rb → interface.rb} +5 -1
- data/interface/client.rb +4 -0
- data/interface/script.rb +13 -5
- data/interface/server.rb +5 -1
- data/interface/user.rb +8 -1
- data/{io/base_io.rb → io.rb} +0 -0
- data/io/input.rb +1 -1
- data/io/null_output.rb +28 -24
- data/io/string_array.rb +2 -3
- data/io/tcpclient.rb +1 -1
- data/io/tcpserver.rb +1 -1
- data/lib/trepanning.rb +11 -13
- data/{processor/main.rb → processor.rb} +50 -54
- data/processor/breakpoint.rb +150 -137
- data/processor/{command/base/cmd.rb → command.rb} +1 -1
- data/processor/command/alias.rb +14 -3
- data/processor/command/backtrace.rb +2 -1
- data/processor/command/base/subcmd.rb +1 -5
- data/processor/command/base/submgr.rb +5 -2
- data/processor/command/base/subsubcmd.rb +1 -1
- data/processor/command/base/subsubmgr.rb +4 -4
- data/processor/command/break.rb +1 -1
- data/processor/command/complete.rb +2 -1
- data/processor/command/condition.rb +2 -2
- data/processor/command/continue.rb +4 -4
- data/processor/command/delete.rb +34 -20
- data/processor/command/directory.rb +4 -4
- data/processor/command/disable.rb +71 -0
- data/processor/command/disassemble.rb +55 -22
- data/processor/command/display.rb +3 -1
- data/processor/command/down.rb +8 -8
- data/processor/command/edit.rb +74 -0
- data/processor/command/enable.rb +43 -0
- data/processor/command/eval.rb +37 -15
- data/processor/command/exit.rb +25 -6
- data/processor/command/finish.rb +5 -5
- data/processor/command/frame.rb +2 -2
- data/processor/command/help.rb +7 -9
- data/processor/command/help/README +10 -0
- data/processor/command/help/command.txt +37 -27
- data/processor/command/help/examples.txt +16 -0
- data/processor/command/help/filename.txt +1 -1
- data/processor/command/help/suffixes.txt +17 -0
- data/processor/command/info.rb +3 -1
- data/processor/command/info_subcmd/files.rb +3 -2
- data/processor/command/info_subcmd/frame.rb +2 -1
- data/processor/command/info_subcmd/line.rb +17 -28
- data/processor/command/info_subcmd/locals.rb +22 -0
- data/processor/command/{show_subcmd → info_subcmd}/macro.rb +4 -4
- data/processor/command/info_subcmd/program.rb +2 -0
- data/processor/command/info_subcmd/ruby.rb +2 -0
- data/processor/command/info_subcmd/source.rb +75 -0
- data/processor/command/info_subcmd/stack.rb +25 -0
- data/processor/command/info_subcmd/variables.rb +23 -36
- data/processor/command/info_subcmd/variables_subcmd/.gitignore +2 -0
- data/processor/command/info_subcmd/variables_subcmd/class.rb +42 -0
- data/processor/command/info_subcmd/variables_subcmd/constant.rb +42 -0
- data/processor/command/info_subcmd/variables_subcmd/globals.rb +69 -0
- data/processor/command/info_subcmd/variables_subcmd/instance.rb +42 -0
- data/processor/command/info_subcmd/variables_subcmd/locals.rb +80 -0
- data/processor/command/kill.rb +8 -9
- data/processor/command/list.rb +101 -167
- data/processor/command/macro.rb +28 -10
- data/processor/command/next.rb +2 -1
- data/processor/command/nexti.rb +1 -1
- data/processor/command/parsetree.rb +51 -0
- data/processor/command/pr.rb +1 -2
- data/processor/command/ps.rb +1 -1
- data/processor/command/restart.rb +2 -2
- data/processor/command/save.rb +1 -1
- data/processor/command/server.rb +1 -1
- data/processor/command/set_subcmd/abbrev.rb +25 -0
- data/processor/command/set_subcmd/auto.rb +7 -1
- data/processor/command/set_subcmd/auto_subcmd/eval.rb +1 -2
- data/processor/command/set_subcmd/auto_subcmd/irb.rb +2 -3
- data/processor/command/set_subcmd/auto_subcmd/list.rb +2 -3
- data/processor/command/set_subcmd/different.rb +1 -1
- data/processor/command/set_subcmd/highlight.rb +7 -1
- data/processor/command/set_subcmd/reload.rb +42 -0
- data/processor/command/set_subcmd/timer.rb +58 -0
- data/processor/command/set_subcmd/trace.rb +4 -3
- data/processor/command/{irb.rb → shell.rb} +22 -19
- data/processor/command/show_subcmd/abbrev.rb +20 -0
- data/processor/command/show_subcmd/{alias.rb → aliases.rb} +2 -2
- data/processor/command/show_subcmd/auto_subcmd/eval.rb +2 -6
- data/processor/command/show_subcmd/directories.rb +22 -0
- data/processor/command/show_subcmd/hidelevel.rb +1 -1
- data/processor/command/show_subcmd/highlight.rb +2 -1
- data/processor/command/show_subcmd/reload.rb +18 -0
- data/processor/command/show_subcmd/timer.rb +18 -0
- data/processor/command/source.rb +9 -9
- data/processor/command/step.rb +1 -1
- data/processor/command/tbreak.rb +3 -2
- data/processor/command/unalias.rb +11 -6
- data/processor/command/undisplay.rb +13 -9
- data/processor/command/up.rb +13 -14
- data/processor/default.rb +47 -44
- data/processor/disassemble.rb +48 -35
- data/processor/display.rb +38 -3
- data/processor/eval.rb +54 -53
- data/processor/eventbuf.rb +69 -69
- data/processor/frame.rb +186 -187
- data/processor/help.rb +6 -4
- data/processor/hook.rb +103 -102
- data/processor/list.rb +123 -0
- data/processor/load_cmds.rb +9 -1
- data/processor/location.rb +193 -188
- data/processor/mock.rb +1 -7
- data/processor/msg.rb +56 -42
- data/processor/running.rb +26 -15
- data/processor/stepping.rb +2 -1
- data/processor/subcmd.rb +18 -43
- data/processor/validate.rb +41 -30
- data/processor/virtual.rb +33 -0
- data/rbx-trepanning.gemspec +7 -8
- data/sample/rocky-trepanx-colors.rb +0 -1
- data/test/data/fname-with-blank.right +2 -0
- data/test/data/inline-call.right +11 -10
- data/test/data/quit.right +1 -0
- data/test/example/debugger-stop.rb +1 -1
- data/test/example/goto2goto.rb +11 -0
- data/test/functional/fn_helper.rb +2 -2
- data/test/functional/test-list.rb +7 -6
- data/test/integration/helper.rb +5 -5
- data/test/unit/cmd-helper.rb +2 -6
- data/test/unit/test-app-cmd_parser.rb +3 -2
- data/test/unit/test-app-display.rb +22 -0
- data/test/unit/test-app-options.rb +14 -10
- data/test/unit/test-app-run.rb +0 -2
- data/test/unit/test-app-util.rb +21 -4
- data/test/unit/test-base-cmd.rb +5 -7
- data/test/unit/test-base-subcmd.rb +1 -5
- data/test/unit/test-base-submgr.rb +1 -1
- data/test/unit/test-base-subsubcmd.rb +0 -4
- data/test/unit/test-bin-trepanx.rb +2 -2
- data/test/unit/test-cmd-break.rb +2 -0
- data/test/unit/test-cmd-edit.rb +34 -0
- data/test/unit/test-cmd-kill.rb +11 -4
- data/test/unit/test-cmd-parse_list_cmd.rb +36 -0
- data/test/unit/test-command.rb +45 -0
- data/test/unit/test-completion.rb +1 -1
- data/test/unit/test-proc-eval.rb +1 -2
- data/test/unit/test-proc-frame.rb +5 -3
- data/test/unit/test-proc-list.rb +55 -0
- data/test/unit/test-proc-load_cmds.rb +4 -3
- data/test/unit/test-proc-location.rb +32 -29
- data/test/unit/test-proc-main.rb +1 -5
- data/test/unit/test-proc-validate.rb +14 -4
- data/test/unit/test-subcmd-help.rb +1 -5
- metadata +73 -107
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
|
+
require 'rubygems'; require 'require_relative'
|
4
|
+
require_relative '../base/subcmd'
|
5
|
+
|
6
|
+
class Trepan::Subcommand::ShowAbbrev < Trepan::ShowBoolSubcommand
|
7
|
+
unless defined?(HELP)
|
8
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
9
|
+
HELP = "Show whether we allow abbreviate debugger command names"
|
10
|
+
MIN_ABBREV = 'ab'.size
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
if __FILE__ == $0
|
16
|
+
# Demo it.
|
17
|
+
$0 = __FILE__ + 'notagain' # So we don't run this agin
|
18
|
+
require_relative '../../mock'
|
19
|
+
cmd = MockDebugger::sub_setup(Trepan::Subcommand::ShowAbbrev)
|
20
|
+
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'rubygems'; require 'require_relative'
|
4
4
|
require_relative '../base/subcmd'
|
5
5
|
|
6
|
-
class Trepan::Subcommand::
|
6
|
+
class Trepan::Subcommand::ShowAliases < Trepan::Subcommand
|
7
7
|
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
8
8
|
unless defined?(HELP)
|
9
9
|
HELP = <<-EOH
|
@@ -32,7 +32,7 @@ all alias names
|
|
32
32
|
elsif @proc.aliases.empty?
|
33
33
|
msg "No aliases defined."
|
34
34
|
else
|
35
|
-
section "List of
|
35
|
+
section "List of alias names currently defined:"
|
36
36
|
msg columnize_commands(@proc.aliases.keys.sort)
|
37
37
|
end
|
38
38
|
end
|
@@ -5,15 +5,11 @@ require_relative '../../base/subsubcmd'
|
|
5
5
|
|
6
6
|
class Trepan::SubSubcommand::ShowAutoEval < Trepan::ShowBoolSubSubcommand
|
7
7
|
unless defined?(HELP)
|
8
|
-
HELP = "
|
9
|
-
|
10
|
-
Set this on if you want things that don't look like debugger command to be eval'd
|
11
|
-
as a string."
|
12
|
-
|
8
|
+
HELP = "Show evaluation of unrecognized debugger commands"
|
13
9
|
MIN_ABBREV = 'ev'.size
|
14
10
|
NAME = File.basename(__FILE__, '.rb')
|
15
11
|
PREFIX = %W(show auto #{NAME})
|
16
|
-
SHORT_HELP
|
12
|
+
SHORT_HELP = HELP
|
17
13
|
end
|
18
14
|
|
19
15
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
|
+
require 'rubygems'; require 'require_relative'
|
4
|
+
require_relative '../base/subcmd'
|
5
|
+
|
6
|
+
class Trepan::Subcommand::ShowDirectories < Trepan::Subcommand
|
7
|
+
unless defined?(HELP)
|
8
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
9
|
+
HELP = "Show current search path for finding source files"
|
10
|
+
MIN_ABBREV = 'dir'.size
|
11
|
+
end
|
12
|
+
|
13
|
+
def run(args)
|
14
|
+
msg "Source directories searched: #{settings[:directory]}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
if __FILE__ == $0
|
19
|
+
# Demo it.
|
20
|
+
require_relative '../../mock'
|
21
|
+
cmd = MockDebugger::sub_setup(Trepan::Subcommand::ShowDirectories)
|
22
|
+
end
|
@@ -6,7 +6,7 @@ require_relative '../base/subsubcmd'
|
|
6
6
|
class Trepan::Subcommand::ShowHidelevel < Trepan::ShowIntSubcommand
|
7
7
|
unless defined?(HELP)
|
8
8
|
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
9
|
-
HELP
|
9
|
+
HELP = 'Show the number of stack levels to hide'
|
10
10
|
MIN_ABBREV = 'hide'.size
|
11
11
|
end
|
12
12
|
def run(args)
|
@@ -7,7 +7,8 @@ require_relative '../base/subsubmgr'
|
|
7
7
|
class Trepan::Subcommand::ShowHighlight < Trepan::ShowBoolSubcommand
|
8
8
|
unless defined?(HELP)
|
9
9
|
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
10
|
-
HELP
|
10
|
+
HELP = 'Show whether we use terminal highlighting'
|
11
|
+
MIN_ABBREV = 'high'.size
|
11
12
|
end
|
12
13
|
|
13
14
|
def run(args)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
|
+
require 'rubygems'; require 'require_relative'
|
4
|
+
require_relative '../base/subcmd'
|
5
|
+
|
6
|
+
class Trepan::Subcommand::ShowReload < Trepan::ShowBoolSubcommand
|
7
|
+
unless defined?(SHORT_HELP)
|
8
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
9
|
+
HELP = "Show whether to reread source text when it changes"
|
10
|
+
MIN_ABBREV = 're'.size
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
if __FILE__ == $0
|
15
|
+
# Demo it.
|
16
|
+
require_relative '../../mock'
|
17
|
+
cmd = MockDebugger::sub_setup(Trepan::Subcommand::ShowReload, false)
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
|
+
require 'rubygems'; require 'require_relative'
|
4
|
+
require_relative '../base/subcmd'
|
5
|
+
|
6
|
+
class Trepan::Subcommand::ShowTimer < Trepan::ShowBoolSubcommand
|
7
|
+
unless defined?(HELP)
|
8
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
9
|
+
HELP = "Show status of the timing hook"
|
10
|
+
MIN_ABBREV = 'ti'.size
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
if __FILE__ == $0
|
15
|
+
# Demo it.
|
16
|
+
require_relative '../../mock'
|
17
|
+
cmd = MockDebugger::sub_setup(Trepan::Subcommand::ShowTimer)
|
18
|
+
end
|
data/processor/command/source.rb
CHANGED
@@ -4,7 +4,7 @@ require 'optparse'
|
|
4
4
|
|
5
5
|
# Our local modules
|
6
6
|
require 'rubygems'; require 'require_relative'
|
7
|
-
require_relative '
|
7
|
+
require_relative '../command'
|
8
8
|
require_relative '../../interface/script'
|
9
9
|
require_relative '../../io/null_output'
|
10
10
|
require_relative '../../app/default'
|
@@ -59,28 +59,28 @@ unless option -c or --continue is given.
|
|
59
59
|
def parse_options(options, args) # :nodoc
|
60
60
|
seen_yes_no = false
|
61
61
|
parser = OptionParser.new do |opts|
|
62
|
-
opts.on(
|
63
|
-
|
62
|
+
opts.on('-c', '--[no-]continue',
|
63
|
+
'Continue in the face of errors') do
|
64
64
|
|v|
|
65
65
|
options[:abort_on_error] = !v
|
66
66
|
end
|
67
|
-
opts.on(
|
68
|
-
|
67
|
+
opts.on('-v',
|
68
|
+
'--[no-]verbose', 'echo each command as it is executed') do
|
69
69
|
|v|
|
70
70
|
options[:verbose] = v
|
71
71
|
end
|
72
|
-
opts.on(
|
72
|
+
opts.on('-N', '--no', "Use 'no' in any confirmation prompts") do
|
73
73
|
|v|
|
74
74
|
if seen_yes_no
|
75
|
-
msg(
|
75
|
+
msg('Yes/No option already seen. This option (no) ignored.')
|
76
76
|
end
|
77
77
|
options[:confirm_val] = false
|
78
78
|
end
|
79
|
-
opts.on(
|
79
|
+
opts.on('-q', '--[no-]quiet', 'Silence debugger output') do
|
80
80
|
|v|
|
81
81
|
options[:quiet] = v
|
82
82
|
end
|
83
|
-
opts.on(
|
83
|
+
opts.on('-Y', '--yes', "Use 'yes' in any confirmation prompts") do
|
84
84
|
|v|
|
85
85
|
if seen_yes_no
|
86
86
|
msg("Yes/No option already seen. This option, --yes, ignored.")
|
data/processor/command/step.rb
CHANGED
data/processor/command/tbreak.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
require 'rubygems'; require 'require_relative'
|
2
|
-
require_relative '
|
2
|
+
require_relative '../command'
|
3
3
|
require_relative 'break'
|
4
4
|
|
5
5
|
class Trepan::Command::SetTempBreakpointCommand <
|
6
6
|
Trepan::Command::BreakCommand
|
7
|
-
ALIASES =
|
7
|
+
ALIASES = []
|
8
8
|
CATEGORY = 'breakpoints'
|
9
9
|
NAME = File.basename(__FILE__, '.rb')
|
10
10
|
HELP = <<-HELP
|
11
11
|
Same as break, but the breakpoint is deleted when it is hit.
|
12
|
+
See also "break".
|
12
13
|
HELP
|
13
14
|
SHORT_HELP = 'Set a temporary breakpoint'
|
14
15
|
|
@@ -1,17 +1,18 @@
|
|
1
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
1
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
2
2
|
require 'rubygems'; require 'require_relative'
|
3
|
-
require_relative '
|
3
|
+
require_relative '../command'
|
4
|
+
require_relative '../../app/complete'
|
4
5
|
|
5
6
|
class Trepan::Command::UnaliasCommand < Trepan::Command
|
6
7
|
|
7
8
|
unless defined?(HELP)
|
8
|
-
HELP =
|
9
|
-
|
9
|
+
HELP = <<-HELP
|
10
|
+
unalias ALIAS
|
10
11
|
|
11
|
-
Remove alias
|
12
|
+
Remove alias ALIAS
|
12
13
|
|
13
14
|
See also 'alias'.
|
14
|
-
|
15
|
+
HELP
|
15
16
|
|
16
17
|
CATEGORY = 'support'
|
17
18
|
MIN_ARGS = 1
|
@@ -21,6 +22,10 @@ See also 'alias'.
|
|
21
22
|
SHORT_HELP = 'Remove an alias'
|
22
23
|
end
|
23
24
|
|
25
|
+
def complete(prefix)
|
26
|
+
Trepan::Complete.complete_token(@proc.aliases.keys, prefix)
|
27
|
+
end
|
28
|
+
|
24
29
|
# Run command.
|
25
30
|
def run(args)
|
26
31
|
args[1..-1].each do |arg|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require 'rubygems'; require 'require_relative'
|
4
|
-
require_relative '
|
4
|
+
require_relative '../command'
|
5
5
|
|
6
6
|
# undisplay display-number...
|
7
7
|
class Trepan::Command::UndisplayCommand < Trepan::Command
|
@@ -9,37 +9,41 @@ class Trepan::Command::UndisplayCommand < Trepan::Command
|
|
9
9
|
unless defined?(HELP)
|
10
10
|
NAME = File.basename(__FILE__, '.rb')
|
11
11
|
HELP = <<EOH
|
12
|
-
|
12
|
+
#{NAME} DISPLAY_NUMBER ...
|
13
13
|
Cancel some expressions to be displayed when program stops.
|
14
14
|
Arguments are the code numbers of the expressions to stop displaying.
|
15
15
|
No argument means cancel all automatic-display expressions.
|
16
16
|
"delete display" has the same effect as this command.
|
17
|
-
|
17
|
+
Use "info display" to see current list of display numbers.
|
18
18
|
EOH
|
19
19
|
|
20
|
-
ALIASES = %w(und)
|
21
20
|
CATEGORY = 'data'
|
22
21
|
NEED_STACK = false
|
23
22
|
SHORT_HELP = 'Cancel some expressions to be displayed when program stops'
|
24
23
|
end
|
25
24
|
|
25
|
+
def complete(prefix)
|
26
|
+
@proc.displays.nums.map{|disp| disp.to_s}
|
27
|
+
end
|
28
|
+
|
26
29
|
def run(args)
|
27
30
|
|
28
31
|
if args.size == 1
|
29
|
-
|
30
|
-
|
32
|
+
if confirm('Delete all displays?', false)
|
33
|
+
@proc.displays.clear
|
34
|
+
return
|
35
|
+
end
|
31
36
|
end
|
32
37
|
opts = {}
|
33
38
|
args[1..-1].each do |arg|
|
34
|
-
opts
|
39
|
+
opts = {:msg_on_error => '%s must be a display number' % arg}
|
35
40
|
i = @proc.get_an_int(arg, opts)
|
36
41
|
if i
|
37
42
|
unless @proc.displays.delete_index(i)
|
38
|
-
errmsg("
|
43
|
+
errmsg("No display number %d." % i)
|
39
44
|
return
|
40
45
|
end
|
41
46
|
end
|
42
|
-
return false
|
43
47
|
end
|
44
48
|
end
|
45
49
|
end
|
data/processor/command/up.rb
CHANGED
@@ -1,17 +1,16 @@
|
|
1
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
1
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
2
2
|
require 'rubygems'; require 'require_relative'
|
3
|
-
require_relative '
|
3
|
+
require_relative '../command'
|
4
|
+
require_relative '../../app/util'
|
4
5
|
|
5
|
-
# up command. Like 'down'
|
6
|
+
# up command. Like 'down' but the direction (set by DIRECTION) is different.
|
6
7
|
#
|
7
8
|
# NOTE: The down command subclasses this, so beware when changing!
|
8
9
|
class Trepan::Command::UpCommand < Trepan::Command
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
NAME = File.basename(__FILE__, '.rb')
|
14
|
-
HELP = <<-HELP
|
11
|
+
Trepan::Util.suppress_warnings {
|
12
|
+
NAME = File.basename(__FILE__, '.rb')
|
13
|
+
HELP = <<-HELP
|
15
14
|
#{NAME} [count]
|
16
15
|
|
17
16
|
Move the current frame up in the stack trace (to an older frame). 0 is
|
@@ -20,12 +19,12 @@ the most recent frame. If no count is given, move up 1.
|
|
20
19
|
See also 'down' and 'frame'.
|
21
20
|
HELP
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
ALIASES = %w(u)
|
23
|
+
CATEGORY = 'stack'
|
24
|
+
MAX_ARGS = 1 # Need at most this many
|
25
|
+
NEED_STACK = true
|
26
|
+
SHORT_HELP = 'Move frame in the direction of the caller of the last-selected frame'
|
27
|
+
}
|
29
28
|
|
30
29
|
def complete(prefix)
|
31
30
|
@proc.frame_complete(prefix, @direction)
|
data/processor/default.rb
CHANGED
@@ -1,54 +1,57 @@
|
|
1
1
|
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
2
2
|
require 'rubygems'; require 'require_relative'
|
3
3
|
require_relative '../app/default'
|
4
|
-
|
5
|
-
|
4
|
+
require_relative 'virtual'
|
5
|
+
class Trepan::CmdProcessor < Trepan::VirtualCmdProcessor
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
DEFAULT_SETTINGS = {
|
8
|
+
:abbrev => true, # Allow abbreviations of debugger commands?
|
9
|
+
:autoeval => true, # Ruby eval non-debugger commands
|
10
|
+
:autoirb => false, # Go into IRB in debugger command loop
|
11
|
+
:autolist => false, # Run 'list'
|
12
|
+
|
13
|
+
:basename => false, # Show basename of filenames only
|
14
|
+
:confirm => true, # Confirm potentially dangerous operations?
|
15
|
+
:different => 'nostack', # stop *only* when different position?
|
16
|
+
|
17
|
+
:debugdbgr => false, # Debugging the debugger
|
18
|
+
:debugexcept => true, # Internal debugging of command exceptions
|
19
|
+
:debugmacro => false, # debugging macros
|
20
|
+
:debugskip => false, # Internal debugging of step/next skipping
|
21
|
+
:directory => # last-resort path-search for files
|
22
|
+
'$rbx:$cdir:$cwd', # that are not fully qualified.
|
11
23
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
# debug nesting and
|
38
|
-
:save_cmdfile => nil, # If set, debugger command file to be
|
39
|
-
# used on restart
|
40
|
-
:timer => false, # show elapsed time between events
|
41
|
-
:traceprint => false, # event tracing printing
|
42
|
-
:tracebuffer => false, # save events to a trace buffer.
|
43
|
-
:user_cmd_dir => File.join(Trepan::HOME_DIR, 'tepanx', 'command'),
|
44
|
-
# User command directory
|
45
|
-
|
46
|
-
# Rubinius-specific user variables
|
47
|
-
:show_ip => false,
|
48
|
-
:show_bytecode => false,
|
24
|
+
:hidestack => nil, # Fixnum. How many hidden outer
|
25
|
+
# debugger stack frames to hide?
|
26
|
+
# nil or -1 means compute value. 0
|
27
|
+
# means hide none. Less than 0 means show
|
28
|
+
# all stack entries.
|
29
|
+
:hightlight => false, # Use terminal highlight?
|
30
|
+
|
31
|
+
:maxlist => 10, # Number of source lines to list
|
32
|
+
:maxstack => 10, # backtrace limit
|
33
|
+
:maxstring => 150, # Strings which are larger than this
|
34
|
+
# will be truncated to this length when
|
35
|
+
# printed
|
36
|
+
:maxwidth => (ENV['COLUMNS'] || '80').to_i,
|
37
|
+
:prompt => 'trepanx', # core part of prompt. Additional info like
|
38
|
+
# debug nesting and thread name is fixed
|
39
|
+
# and added on.
|
40
|
+
:reload => false, # Reread source file if we determine
|
41
|
+
# it has changed?
|
42
|
+
:save_cmdfile => nil, # If set, debugger command file to be
|
43
|
+
# used on restart
|
44
|
+
:timer => false, # show elapsed time between events
|
45
|
+
:traceprint => false, # event tracing printing
|
46
|
+
:tracebuffer => false, # save events to a trace buffer.
|
47
|
+
:user_cmd_dir => File.join(%W(#{Trepan::HOME_DIR} trepanx command)),
|
48
|
+
# User command directory
|
49
49
|
|
50
|
+
# Rubinius-specific user variables
|
51
|
+
:show_ip => false,
|
52
|
+
:show_bytecode => false,
|
53
|
+
|
50
54
|
} unless defined?(CmdProcessor::DEFAULT_SETTINGS)
|
51
|
-
end
|
52
55
|
end
|
53
56
|
|
54
57
|
if __FILE__ == $0
|