trepanning 0.0.9 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +237 -0
- data/NEWS +8 -0
- data/Rakefile +3 -2
- data/app/breakpoint.rb +8 -8
- data/app/brkptmgr.rb +86 -85
- data/app/client.rb +60 -0
- data/app/core.rb-consider +198 -0
- data/app/default.rb +17 -7
- data/app/disassemble.rb +12 -2
- data/app/options.rb +51 -20
- data/app/yarv.rb +183 -0
- data/bin/trepan +15 -9
- data/data/custom_require.rb +44 -0
- data/data/irbrc +41 -0
- data/data/prelude.rb +38 -0
- data/interface/base_intf.rb +10 -4
- data/interface/client.rb +79 -0
- data/interface/comcodes.rb +18 -0
- data/interface/server.rb +142 -0
- data/io/base_io.rb +57 -3
- data/io/tcpclient.rb +122 -0
- data/io/tcpfns.rb +31 -0
- data/io/tcpserver.rb +137 -0
- data/lib/trepanning.rb +57 -28
- data/processor/command/base/cmd.rb +10 -6
- data/processor/command/base/subcmd.rb +13 -1
- data/processor/command/directory.rb +15 -8
- data/processor/command/disassemble.rb +3 -2
- data/processor/command/help.rb +71 -19
- data/processor/command/info_subcmd/args.rb +2 -3
- data/processor/command/info_subcmd/breakpoints.rb +2 -3
- data/processor/command/info_subcmd/file.rb +2 -3
- data/processor/command/info_subcmd/frame.rb +2 -3
- data/processor/command/info_subcmd/iseq.rb +4 -5
- data/processor/command/info_subcmd/locals.rb +2 -3
- data/processor/command/info_subcmd/program.rb +2 -3
- data/processor/command/info_subcmd/registers.rb +2 -3
- data/processor/command/info_subcmd/return.rb +2 -3
- data/processor/command/info_subcmd/thread.rb +2 -3
- data/processor/command/list.rb +10 -6
- data/processor/command/reload.rb +1 -1
- data/processor/command/reload_subcmd/command.rb +29 -16
- data/processor/command/server.rb +70 -0
- data/processor/command/set_subcmd/auto.rb +2 -3
- data/processor/command/set_subcmd/basename.rb +2 -3
- data/processor/command/set_subcmd/debug.rb +2 -3
- data/processor/command/set_subcmd/different.rb +2 -3
- data/processor/command/set_subcmd/events.rb +2 -3
- data/processor/command/set_subcmd/hidelevel.rb +6 -7
- data/processor/command/set_subcmd/highlight.rb +32 -0
- data/processor/command/set_subcmd/max.rb +2 -3
- data/processor/command/set_subcmd/return.rb +2 -3
- data/processor/command/set_subcmd/sp.rb +2 -3
- data/processor/command/set_subcmd/substitute.rb +2 -3
- data/processor/command/set_subcmd/timer.rb +2 -3
- data/processor/command/set_subcmd/trace.rb +3 -4
- data/processor/command/show_subcmd/alias.rb +3 -3
- data/processor/command/show_subcmd/args.rb +2 -3
- data/processor/command/show_subcmd/auto.rb +1 -2
- data/processor/command/show_subcmd/basename.rb +2 -3
- data/processor/command/show_subcmd/debug.rb +1 -2
- data/processor/command/show_subcmd/different.rb +2 -1
- data/processor/command/show_subcmd/events.rb +2 -2
- data/processor/command/show_subcmd/hidelevel.rb +2 -3
- data/processor/command/show_subcmd/highlight.rb +23 -0
- data/processor/command/show_subcmd/macro.rb +2 -1
- data/processor/command/show_subcmd/max.rb +2 -3
- data/processor/command/show_subcmd/trace.rb +2 -3
- data/processor/command/source.rb +78 -28
- data/processor/default.rb +3 -2
- data/processor/load_cmds.rb +39 -19
- data/processor/location.rb +11 -7
- data/processor/main.rb +31 -15
- data/processor/mock.rb +22 -7
- data/processor/msg.rb +24 -8
- data/test/data/fname-with-blank.right +3 -0
- data/test/data/quit.right +2 -0
- data/test/functional/test-break-long.rb +87 -0
- data/test/functional/tmp/b3.rb +5 -0
- data/test/functional/tmp/immediate-bug1.rb +9 -0
- data/test/integration/helper.rb +14 -11
- data/test/integration/test-fname-with-blank.rb +5 -1
- data/test/integration/test-quit.rb +6 -2
- data/test/unit/cmd-helper.rb +9 -4
- data/test/unit/mock-helper.rb +9 -0
- data/test/unit/test-app-brkpt.rb +4 -4
- data/test/unit/test-app-brkptmgr.rb +2 -2
- data/test/unit/test-app-file.rb +0 -1
- data/test/unit/test-app-options.rb +26 -5
- data/test/unit/test-base-subcmd.rb +0 -1
- data/test/unit/test-cmd-alias.rb +0 -1
- data/test/unit/test-cmd-break.rb +0 -4
- data/test/unit/test-cmd-endisable.rb +1 -3
- data/test/unit/test-cmd-help.rb +0 -1
- data/test/unit/test-cmd-kill.rb +4 -5
- data/test/unit/test-cmd-quit.rb +4 -7
- data/test/unit/test-cmd-source.rb +33 -0
- data/test/unit/test-cmd-step.rb +0 -2
- data/test/unit/test-io-tcp.rb +32 -0
- data/test/unit/test-io-tcpclient.rb +53 -0
- data/test/unit/test-io-tcpserver.rb +49 -0
- data/test/unit/test-proc-main.rb +2 -2
- metadata +195 -175
- data/processor/command/stepi.rb +0 -63
- data/test/functional/tmp/b1.rb +0 -5
- data/test/functional/tmp/s1.rb +0 -9
- data/test/functional/tmp/t2.rb +0 -6
- data/test/integration/try-test-enable.rb +0 -11
@@ -1,11 +1,12 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require 'linecache'
|
4
4
|
require_relative '../base/subcmd'
|
5
5
|
require_relative '../../../app/file'
|
6
6
|
|
7
7
|
class Trepan::Subcommand::InfoFile < Trepan::Subcommand
|
8
8
|
unless defined?(HELP)
|
9
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
9
10
|
DEFAULT_FILE_ARGS = %w(size sha1)
|
10
11
|
|
11
12
|
HELP =
|
@@ -28,9 +29,7 @@ all -- All of the above information.
|
|
28
29
|
If no sub-options are given #{DEFAULT_FILE_ARGS.join(' ')} are assumed.
|
29
30
|
"
|
30
31
|
MIN_ABBREV = 'fi'.size # Note we have "info frame"
|
31
|
-
NAME = File.basename(__FILE__, '.rb')
|
32
32
|
NEED_STACK = false
|
33
|
-
PREFIX = %w(info file)
|
34
33
|
end
|
35
34
|
|
36
35
|
include Trepanning
|
@@ -1,14 +1,13 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subcmd'
|
4
4
|
|
5
5
|
class Trepan::Subcommand::InfoFrame < Trepan::Subcommand
|
6
6
|
unless defined?(HELP)
|
7
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
7
8
|
HELP = 'Show all information about the selected frame'
|
8
9
|
MIN_ABBREV = 'fr'.size # Note we have "info file"
|
9
|
-
NAME = File.basename(__FILE__, '.rb')
|
10
10
|
NEED_STACK = true
|
11
|
-
PREFIX = %w(info frame)
|
12
11
|
end
|
13
12
|
|
14
13
|
def run(args)
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subcmd'
|
4
4
|
require 'pp'
|
5
5
|
|
6
6
|
class Trepan::Subcommand::InfoIseq < Trepan::Subcommand
|
7
7
|
unless defined?(HELP)
|
8
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
8
9
|
HELP =
|
9
10
|
'info iseq [METHOD|.]
|
10
11
|
|
@@ -16,9 +17,7 @@ Examples:
|
|
16
17
|
info iseq require_relative
|
17
18
|
'
|
18
19
|
MIN_ABBREV = 'is'.size
|
19
|
-
NAME = File.basename(__FILE__, '.rb')
|
20
20
|
NEED_STACK = true
|
21
|
-
PREFIX = %w(info iseq)
|
22
21
|
SHORT_HELP = 'Information about an instruction sequence'
|
23
22
|
end
|
24
23
|
|
@@ -59,9 +58,9 @@ Examples:
|
|
59
58
|
msg "\nCompile options:"
|
60
59
|
msg iseq.compile_options.pretty_inspect
|
61
60
|
end
|
62
|
-
if iseq.
|
61
|
+
if iseq.eval_source
|
63
62
|
msg "Source string:"
|
64
|
-
msg @proc.safe_rep(iseq.
|
63
|
+
msg @proc.safe_rep(iseq.eval_source.inspect)
|
65
64
|
end
|
66
65
|
else
|
67
66
|
mess = "Can't find instruction sequence"
|
@@ -1,17 +1,16 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require 'columnize'
|
4
4
|
require_relative '../base/subcmd'
|
5
5
|
require_relative '../../../app/frame'
|
6
6
|
|
7
7
|
class Trepan::Subcommand::InfoLocals < Trepan::Subcommand
|
8
8
|
unless defined?(HELP)
|
9
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
9
10
|
HELP = 'Show local variables of the current stack frame'
|
10
11
|
MAX_ARGS = 1
|
11
12
|
MIN_ABBREV = 'lo'.size
|
12
|
-
NAME = File.basename(__FILE__, '.rb')
|
13
13
|
NEED_STACK = true
|
14
|
-
PREFIX = %w(info locals)
|
15
14
|
end
|
16
15
|
|
17
16
|
include Trepan::Frame
|
@@ -1,14 +1,13 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subcmd'
|
4
4
|
|
5
5
|
class Trepan::Subcommand::InfoProgram < Trepan::Subcommand
|
6
6
|
unless defined?(HELP)
|
7
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
7
8
|
HELP = 'Information about debugged program and its environment'
|
8
9
|
MIN_ABBREV = 'pr'.size
|
9
|
-
NAME = File.basename(__FILE__, '.rb')
|
10
10
|
NEED_STACK = true
|
11
|
-
PREFIX = %w(info program)
|
12
11
|
end
|
13
12
|
|
14
13
|
def run(args)
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subsubcmd'
|
4
4
|
require_relative '../base/subsubmgr'
|
5
5
|
|
6
6
|
class Trepan::SubSubcommand::InfoRegisters < Trepan::SubSubcommandMgr
|
7
7
|
unless defined?(HELP)
|
8
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
8
9
|
HELP =
|
9
10
|
'List of contents for the registers of the current stack frame.
|
10
11
|
If a register name given, only only that register is show.
|
@@ -19,9 +20,7 @@ Examples:
|
|
19
20
|
'
|
20
21
|
|
21
22
|
MIN_ABBREV = 'reg'.size # Note we have "info return"
|
22
|
-
NAME = File.basename(__FILE__, '.rb')
|
23
23
|
NEED_STACK = true
|
24
|
-
PREFIX = %w(info registers)
|
25
24
|
end
|
26
25
|
|
27
26
|
def run(args)
|
@@ -1,14 +1,13 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subcmd'
|
4
4
|
|
5
5
|
class Trepan::Subcommand::InfoReturn < Trepan::Subcommand
|
6
6
|
unless defined?(HELP)
|
7
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
7
8
|
HELP = 'Show the value about to be returned'
|
8
9
|
MIN_ABBREV = 'ret'.size # Note we have "info registers"
|
9
|
-
NAME = File.basename(__FILE__, '.rb')
|
10
10
|
NEED_STACK = true
|
11
|
-
PREFIX = %w(info return)
|
12
11
|
end
|
13
12
|
|
14
13
|
def run(args)
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subcmd'
|
4
4
|
require_relative '../../../app/thread'
|
5
5
|
require_relative '../../../app/frame'
|
6
6
|
|
7
7
|
class Trepan::Subcommand::InfoThread < Trepan::Subcommand
|
8
8
|
unless defined?(HELP)
|
9
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
9
10
|
HELP =
|
10
11
|
'info thread [THREAD-ARG1 THREAD-ARG2.. ]
|
11
12
|
|
@@ -26,9 +27,7 @@ Examples:
|
|
26
27
|
info thread 92562770 # ifnormation for thread with object id 92562770
|
27
28
|
'
|
28
29
|
MIN_ABBREV = 'thr'.size
|
29
|
-
NAME = File.basename(__FILE__, '.rb')
|
30
30
|
NEED_STACK = true
|
31
|
-
PREFIX = %w(info thread)
|
32
31
|
SHORT_HELP = 'Show frame(s) for threads'
|
33
32
|
end
|
34
33
|
|
data/processor/command/list.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
1
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
2
2
|
# -*- coding: utf-8 -*-
|
3
3
|
require 'linecache'
|
4
4
|
require_relative 'base/cmd'
|
@@ -22,8 +22,8 @@ previously shown.
|
|
22
22
|
If the command has a '>' suffix, then line centering is disabled and
|
23
23
|
listing begins at the specificed location.
|
24
24
|
|
25
|
-
The number of
|
26
|
-
setting. Use 'set
|
25
|
+
The number of lines to show is controlled by the debugger "listsize"
|
26
|
+
setting. Use 'set max list' or 'show max list' to see or set the
|
27
27
|
value.
|
28
28
|
|
29
29
|
\"#{NAME} -\" shows lines before a previous listing.
|
@@ -234,13 +234,17 @@ disabled.
|
|
234
234
|
end
|
235
235
|
|
236
236
|
begin
|
237
|
+
opts = {
|
238
|
+
:reload_on_change => @proc.reload_on_change,
|
239
|
+
:output => settings[:highlight]
|
240
|
+
}
|
237
241
|
first.upto(last).each do |lineno|
|
238
|
-
line = LineCache::getline(container[1], lineno,
|
239
|
-
@proc.reload_on_change).chomp
|
242
|
+
line = LineCache::getline(container[1], lineno, opts)
|
240
243
|
unless line
|
241
244
|
msg('[EOF]')
|
242
245
|
break
|
243
246
|
end
|
247
|
+
line.chomp!
|
244
248
|
s = '%3d' % lineno
|
245
249
|
s = s + ' ' if s.size < 4
|
246
250
|
s += if breaklist.member?(lineno)
|
@@ -253,7 +257,7 @@ disabled.
|
|
253
257
|
end
|
254
258
|
s += (frame && lineno == @proc.frame_line &&
|
255
259
|
container == frame.source_container) ? '->' : a_pad
|
256
|
-
msg(s + "\t" + line)
|
260
|
+
msg(s + "\t" + line, {:unlimited => true})
|
257
261
|
@proc.line_no = lineno
|
258
262
|
end
|
259
263
|
rescue => e
|
data/processor/command/reload.rb
CHANGED
@@ -1,19 +1,37 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subcmd'
|
4
4
|
|
5
5
|
class Trepan::Subcommand::ReloadCommand < Trepan::Subcommand
|
6
6
|
unless defined?(HELP)
|
7
|
-
|
7
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
8
|
+
HELP = <<-HELP
|
9
|
+
reload command [file-or-directory ...]
|
10
|
+
|
11
|
+
Loads or reloads debugger commands. If no parameters are passed all
|
12
|
+
commands are reloaded. If a parameters are passed each is expected to
|
13
|
+
be a either a Ruby file which implements a series of debugger
|
14
|
+
commands by defining Trepan::Command classes, or a directory which contains
|
15
|
+
files that implements debugger commands.
|
16
|
+
HELP
|
8
17
|
MIN_ABBREV = 'co'.size # Note we have "info file"
|
9
|
-
NAME = File.basename(__FILE__, '.rb')
|
10
18
|
NEED_STACK = true
|
11
|
-
|
19
|
+
SHORT_HELP = 'Reload debugger commmands from debugger directories'
|
12
20
|
end
|
13
21
|
|
14
22
|
def run(args)
|
15
|
-
|
16
|
-
|
23
|
+
if args.size == 2
|
24
|
+
@proc.load_cmds_initialize
|
25
|
+
msg('Debugger commands reloaded.')
|
26
|
+
elsif args.size > 2
|
27
|
+
args[2..-1].each do |name|
|
28
|
+
if @proc.load_debugger_commands(name)
|
29
|
+
msg "Debugger command file #{name} loaded."
|
30
|
+
else
|
31
|
+
errmsg "Can't load file or directory #{name}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
17
35
|
end
|
18
36
|
|
19
37
|
end
|
@@ -21,14 +39,9 @@ end
|
|
21
39
|
if __FILE__ == $0
|
22
40
|
# Demo it.
|
23
41
|
require_relative '../../mock'
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
subcommand = Trepan::Subcommand::ReloadCommand.new(cmd)
|
30
|
-
testcmdMgr = Trepan::Subcmd.new(subcommand)
|
31
|
-
|
32
|
-
name = File.basename(__FILE__, '.rb')
|
33
|
-
subcommand.summary_help(name)
|
42
|
+
cmd = MockDebugger::sub_setup(Trepan::Subcommand::ReloadCommand, false)
|
43
|
+
cmd.run(cmd.prefix)
|
44
|
+
dir = File.dirname(__FILE__)
|
45
|
+
cmd.run(cmd.prefix + [File.join(%W(#{dir} .. list.rb))])
|
46
|
+
cmd.run(cmd.prefix + [File.join(%W(#{dir} nonexistent-command.rb))])
|
34
47
|
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
|
+
require 'optparse'
|
4
|
+
require_relative 'base/cmd'
|
5
|
+
require_relative '../../app/default'
|
6
|
+
require_relative '../../interface/server' # server interface (remote debugging)
|
7
|
+
class Trepan::Command::ServerCommand < Trepan::Command
|
8
|
+
|
9
|
+
unless defined?(HELP)
|
10
|
+
CATEGORY = 'support'
|
11
|
+
DEFAULT_OPTIONS = {
|
12
|
+
:host => Trepan::DEFAULT_SETTINGS[:host],
|
13
|
+
:port => Trepan::DEFAULT_SETTINGS[:port]
|
14
|
+
}
|
15
|
+
MAX_ARGS = 4 # Need at most this many
|
16
|
+
NAME = File.basename(__FILE__, '.rb')
|
17
|
+
HELP = <<-HELP
|
18
|
+
#{NAME} [{--port|-p} NUM] [{--host|-h} HOST-OR-IP]
|
19
|
+
|
20
|
+
Put session into server mode which allows an out-of-process or remote
|
21
|
+
connection to the debugged program. --port and --host can be supplied
|
22
|
+
to specify the port number to use and the host name for TCP
|
23
|
+
connections. If neither is given, the default host (#{Trepan::DEFAULT_SETTINGS[:host]})
|
24
|
+
and the default port (#{Trepan::DEFAULT_SETTINGS[:port]}) are used.
|
25
|
+
|
26
|
+
Examples:
|
27
|
+
#{NAME} # Accept remote connections using defaults
|
28
|
+
#{NAME} --port 123 # Accept remote connections on port 123
|
29
|
+
#{NAME} --host my.host.net --port 2048
|
30
|
+
#{NAME} -h my.host.net -p 2048 # same as above
|
31
|
+
HELP
|
32
|
+
|
33
|
+
SHORT_HELP = 'Go into out-of-process debugging (server) mode'
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
def parse_options(options, args) # nodoc
|
38
|
+
parser = OptionParser.new do |opts|
|
39
|
+
opts.on("-h", "--host NAME", String,
|
40
|
+
"Host or IP used in TCP connections for --server or --client. " +
|
41
|
+
"Default is #{DEFAULT_SETTINGS[:host].inspect}.") do
|
42
|
+
|name_or_ip|
|
43
|
+
options[:host] = name_or_ip
|
44
|
+
end
|
45
|
+
opts.on("-p", "--port NUMBER", Integer,
|
46
|
+
"Port number used in TCP connections for --server or --client. " +
|
47
|
+
"Default is #{DEFAULT_SETTINGS[:port]}.") do
|
48
|
+
|num|
|
49
|
+
options[:port] = num
|
50
|
+
end
|
51
|
+
end
|
52
|
+
parser.parse(args)
|
53
|
+
return options
|
54
|
+
end
|
55
|
+
|
56
|
+
# This method runs the command
|
57
|
+
def run(args) # :nodoc
|
58
|
+
options = parse_options(DEFAULT_OPTIONS.dup, args[1..-1])
|
59
|
+
msg("starting debugger in out-of-process mode on host #{options[:host].inspect}, " +
|
60
|
+
"port: #{options[:port]}")
|
61
|
+
@proc.dbgr.intf << Trepan::ServerInterface.new(nil, nil, options)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
if __FILE__ == $0
|
66
|
+
require_relative '../mock'
|
67
|
+
dbgr, cmd = MockDebugger::setup
|
68
|
+
# cmd.run([cmd.name])
|
69
|
+
# cmd.run([cmd.name, '--server'])
|
70
|
+
end
|
@@ -1,13 +1,12 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subsubcmd'
|
4
4
|
require_relative '../base/subsubmgr'
|
5
5
|
|
6
6
|
class Trepan::SubSubcommand::SetAuto < Trepan::SubSubcommandMgr
|
7
7
|
unless defined?(HELP)
|
8
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
8
9
|
HELP = 'Set controls for things with some sort of "automatic" default behavior'
|
9
|
-
NAME = File.basename(__FILE__, '.rb')
|
10
|
-
PREFIX = %w(set auto)
|
11
10
|
end
|
12
11
|
end
|
13
12
|
|
@@ -1,14 +1,13 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subcmd'
|
4
4
|
|
5
5
|
class Trepan::Subcommand::SetBasename < Trepan::SetBoolSubcommand
|
6
6
|
unless defined?(HELP)
|
7
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
7
8
|
HELP = "Set to show only file basename in showing file names"
|
8
9
|
IN_LIST = true
|
9
10
|
MIN_ABBREV = 'ba'.size
|
10
|
-
NAME = File.basename(__FILE__, '.rb')
|
11
|
-
PREFIX = %w(set basename)
|
12
11
|
end
|
13
12
|
|
14
13
|
end
|
@@ -1,13 +1,12 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subsubcmd'
|
4
4
|
require_relative '../base/subsubmgr'
|
5
5
|
|
6
6
|
class Trepan::SubSubcommand::SetDebug < Trepan::SubSubcommandMgr
|
7
7
|
unless defined?(HELP)
|
8
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
8
9
|
HELP = 'Set internal debugger settings'
|
9
|
-
NAME = File.basename(__FILE__, '.rb')
|
10
|
-
PREFIX = %w(set debug)
|
11
10
|
end
|
12
11
|
end
|
13
12
|
|
@@ -1,9 +1,10 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require_relative '../base/subcmd'
|
4
4
|
|
5
5
|
class Trepan::Subcommand::SetDifferent < Trepan::SetBoolSubcommand
|
6
6
|
unless defined?(HELP)
|
7
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
7
8
|
HELP = "
|
8
9
|
set different [on|off|nostack]
|
9
10
|
|
@@ -32,8 +33,6 @@ override this setting."
|
|
32
33
|
|
33
34
|
IN_LIST = true
|
34
35
|
MIN_ABBREV = 'dif'.size
|
35
|
-
NAME = File.basename(__FILE__, '.rb')
|
36
|
-
PREFIX = %w(set different)
|
37
36
|
SHORT_HELP = "Set to make sure 'next/step' move to a new position."
|
38
37
|
end
|
39
38
|
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
|
2
|
+
# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
|
3
3
|
require 'trace'
|
4
4
|
require 'columnize'
|
5
5
|
require_relative '../base/subcmd'
|
6
6
|
|
7
7
|
class Trepan::Subcommand::SetEvents < Trepan::Subcommand
|
8
8
|
unless defined?(HELP)
|
9
|
+
Trepanning::Subcommand.set_name_prefix(__FILE__, self)
|
9
10
|
HELP = "set events {event-name[,] ...}
|
10
11
|
|
11
12
|
Set trace events that the debugger will stop on
|
@@ -21,8 +22,6 @@ Examples:
|
|
21
22
|
set ev call, c_call, return, c_return, c_return, insn
|
22
23
|
"
|
23
24
|
MIN_ABBREV = 'ev'.size
|
24
|
-
NAME = File.basename(__FILE__, '.rb')
|
25
|
-
PREFIX = %w(set events)
|
26
25
|
SHORT_HELP = 'Set trace events we may stop on.'
|
27
26
|
end
|
28
27
|
|