byebug 2.2.2 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -147,45 +147,50 @@ module Byebug
147
147
  # Implements byebug "show" command.
148
148
  class ShowCommand < Command
149
149
 
150
- Subcommands =
151
- [
152
- ['args', 2,
153
- 'Show argument list to the program being debugged when it is started',
154
- 'Follow this command with any number of args to be passed to the ' \
155
- 'program'],
156
- ['autoeval', 4, 'Show whether unrecognized commands are evaluated'],
157
- ['autolist', 4, 'Show whether "list" command is run on stopping'],
158
- ['autoirb', 4, 'Show whether IRB is invoked on stopping'],
159
- ['autoreload', 4, 'Show whether source code is reloaded when changed'],
160
- ['basename', 1, 'Show whether basename is used when reporting files'],
161
- ['callstyle', 2, 'Show paramater style used when showing call frames'],
162
- ['commands', 2, 'Show the history of commands you typed',
163
- 'You can supply a command number to start with'],
164
- ['forcestep', 1,
165
- 'Show whether "next/step" commands are set to always move to a line'],
166
- ['fullpath', 2, 'Show whether full paths are displayed in frames'],
167
- ['history', 2, 'Generic command to show command history parameters',
168
- 'show history filename -- Show the filename in which to record the ' \
169
- 'command history' \
170
- 'show history save -- Show whether history record should be saved ' \
171
- 'on exit' \
172
- 'show history size -- Show the size of the command history'],
173
- ['linetrace', 3, 'Show line execution tracing status'],
174
- ['linetrace_plus', 10,
175
- 'Show whether different consecutive lines are shown in tracing'],
176
- ['listsize', 3, 'Show number of source lines to list by default'],
177
- ['post-mortem', 3, 'Show whether we should go into post-mortem ' \
178
- 'debugging on an uncaught exception'],
179
- ['stack_on_error', 1, 'Show whether a stack trace is displayed ' \
180
- 'when "eval" raises an exception'],
181
- ['verbose', 4, true,
182
- 'Show whether verbose output for debugging byebug itself is enabled'],
183
- ['version', 1, 'Show byebug\'s version'],
184
- ['width', 1, 'Show the number of characters per line for byebug']
185
- ].map do |name, min, short_help, long_help|
186
- Subcmd.new(name, min, short_help, long_help)
150
+ Subcommands = [
151
+ ['args' , 2 , 'Show argument list to the program being ' \
152
+ 'debugged when it is started' ],
153
+ ['autoeval' , 4 , 'Show whether unrecognized commands are ' \
154
+ 'evaluated' ],
155
+ ['autolist' , 4 , 'Show whether "list" command is run on stopping' ],
156
+ ['autoirb' , 4 , 'Show whether IRB is invoked on stopping' ],
157
+ ['autoreload' , 4 , 'Show whether source code is reloaded when ' \
158
+ 'changed' ],
159
+ ['basename' , 1 , 'Show whether basename is used when reporting' \
160
+ ' files' ],
161
+ ['callstyle' , 2 , 'Show parameter style used when showing call' \
162
+ ' frames' ],
163
+ ['commands' , 2 , 'Show the history of commands you typed. You ' \
164
+ 'can supply a command number to start with' ],
165
+ ['forcestep' , 1 , 'Show whether "next/step" commands are set to' \
166
+ ' always move to a line' ],
167
+ ['fullpath' , 2 , 'Show whether full paths are displayed in frames'],
168
+ ['history' , 2 , 'Show command history configurations. ' ],
169
+ ['linetrace' , 3 , 'Show line execution tracing status' ],
170
+ ['linetrace_plus', 10, 'Show whether different consecutive lines are' \
171
+ ' shown in tracing' ],
172
+ ['listsize' , 3 , 'Show number of source lines to list by default' ],
173
+ ['post_mortem' , 3 , 'Show whether we should go into post-mortem ' \
174
+ 'debugging on an uncaught exception' ],
175
+ ['stack_on_error', 1 , 'Show whether a stack trace is displayed when' \
176
+ ' "eval" raises an exception' ],
177
+ ['verbose' , 4 , 'Show whether verbose output for debugging ' \
178
+ 'byebug itself is enabled' ],
179
+ ['version' , 1 , 'Show byebug\'s version' ],
180
+ ['width' , 1 , 'Show the number of characters per line for ' \
181
+ 'byebug' ]
182
+ ].map do |name, min, help|
183
+ Subcmd.new(name, min, help)
187
184
  end unless defined?(Subcommands)
188
185
 
186
+ ShowHistorySubcommands = [
187
+ ['filename', 1, 'Show the filename in which to record command history' ],
188
+ ['save' , 1, 'Show whether history record should be saved on exit' ],
189
+ ['size' , 1, 'Show the size of the command history' ]
190
+ ].map do |name, min, help|
191
+ Subcmd.new(name, min, help)
192
+ end unless defined?(SetHistorySubcommands)
193
+
189
194
  self.allow_in_control = true
190
195
 
191
196
  def regexp
@@ -15,7 +15,7 @@ module Byebug
15
15
  print "#{show_setting('linetrace')}\n"
16
16
  elsif @match[1] =~ /var(?:iable)?/
17
17
  varname = @match[2]
18
- if debug_eval("defined?(#{varname})")
18
+ if bb_eval("defined?(#{varname})")
19
19
  if @match[3] && @match[3] !~ /(:?no)?stop/
20
20
  errmsg "expecting \"stop\" or \"nostop\"; got \"#{@match[3]}\"\n"
21
21
  else
@@ -5,10 +5,10 @@ module Byebug
5
5
  ary.sort!
6
6
  for v in ary
7
7
  begin
8
- s = debug_eval(v.to_s, b).inspect
8
+ s = bb_eval(v.to_s, b).inspect
9
9
  rescue
10
10
  begin
11
- s = debug_eval(v.to_s, b).to_s
11
+ s = bb_eval(v.to_s, b).to_s
12
12
  rescue
13
13
  s = "*Error in evaluation*"
14
14
  end
@@ -18,7 +18,7 @@ module Byebug
18
18
  end
19
19
  end
20
20
  def var_class_self
21
- obj = debug_eval('self')
21
+ obj = bb_eval('self')
22
22
  var_list(obj.class.class_variables, get_binding)
23
23
  end
24
24
  def var_global
@@ -57,9 +57,9 @@ module Byebug
57
57
  end
58
58
 
59
59
  def execute
60
- obj = debug_eval(@match.post_match)
60
+ obj = bb_eval(@match.post_match)
61
61
  if obj.kind_of? Module
62
- constants = debug_eval("#{@match.post_match}.constants")
62
+ constants = bb_eval("#{@match.post_match}.constants")
63
63
  constants.sort!
64
64
  for c in constants
65
65
  next if c =~ /SCRIPT/
@@ -108,7 +108,7 @@ module Byebug
108
108
  end
109
109
 
110
110
  def execute
111
- obj = debug_eval(@match.post_match.empty? ? 'self' : @match.post_match)
111
+ obj = bb_eval(@match.post_match.empty? ? 'self' : @match.post_match)
112
112
  var_list(obj.instance_variables, obj.instance_eval{binding()})
113
113
  end
114
114
 
@@ -167,7 +167,7 @@ module Byebug
167
167
  return
168
168
  end
169
169
  puts @match.post_match
170
- obj = debug_eval("#{@match.post_match}.classtree")
170
+ obj = bb_eval("#{@match.post_match}.classtree")
171
171
  if obj
172
172
  print obj
173
173
  else
@@ -10,6 +10,9 @@ module Byebug
10
10
  # If in remote mode, wait for the remote connection
11
11
  attr_accessor :wait_connection
12
12
 
13
+ # The actual port that the server is started at
14
+ attr_accessor :actual_port
15
+
13
16
  #
14
17
  # Starts a remote byebug
15
18
  #
@@ -25,6 +28,7 @@ module Byebug
25
28
  proceed = ConditionVariable.new
26
29
 
27
30
  server = TCPServer.new(host, port)
31
+ self.actual_port = server.addr[1]
28
32
  @thread = DebugThread.new do
29
33
  while (session = server.accept)
30
34
  self.interface = RemoteInterface.new(session)
@@ -1,3 +1,3 @@
1
1
  module Byebug
2
- VERSION = '2.2.2'
2
+ VERSION = '2.3.0'
3
3
  end
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -43,13 +43,10 @@ class TestHelp < TestDsl::TestCase
43
43
  end
44
44
 
45
45
  describe 'when typed with command and subcommand' do
46
- it "must show subcommand's long help" do
46
+ it "must show subcommand's help" do
47
47
  enter 'help info breakpoints'
48
48
  debug_file 'help'
49
- check_output_includes \
50
- "Status of user-settable breakpoints.\n" \
51
- "Without argument, list info about all breakpoints. " \
52
- "With an integer argument, list info on that breakpoint."
49
+ check_output_includes "Status of user-settable breakpoints.\n"
53
50
  end
54
51
  end
55
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: byebug
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Rodriguez
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-09-25 00:00:00.000000000 Z
13
+ date: 2013-10-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: columnize
@@ -152,14 +152,6 @@ files:
152
152
  - lib/byebug/remote.rb
153
153
  - lib/byebug/version.rb
154
154
  - logo.png
155
- - old_doc/byebug.1
156
- - old_doc/byebug.texi
157
- - old_doc/gcd.rb
158
- - old_doc/hanoi.rb
159
- - old_doc/primes.rb
160
- - old_doc/test-triangle.rb
161
- - old_doc/tri3.rb
162
- - old_doc/triangle.rb
163
155
  - test/breakpoints_test.rb
164
156
  - test/conditions_test.rb
165
157
  - test/continue_test.rb
@@ -176,6 +168,8 @@ files:
176
168
  - test/examples/finish.rb
177
169
  - test/examples/frame.rb
178
170
  - test/examples/frame_deep.rb
171
+ - test/examples/gcd.rb
172
+ - test/examples/hanoi.rb
179
173
  - test/examples/help.rb
180
174
  - test/examples/info.rb
181
175
  - test/examples/info2.rb
@@ -183,6 +177,7 @@ files:
183
177
  - test/examples/list.rb
184
178
  - test/examples/method.rb
185
179
  - test/examples/post_mortem.rb
180
+ - test/examples/primes.rb
186
181
  - test/examples/quit.rb
187
182
  - test/examples/reload.rb
188
183
  - test/examples/repl.rb
@@ -193,9 +188,12 @@ files:
193
188
  - test/examples/show.rb
194
189
  - test/examples/source.rb
195
190
  - test/examples/stepping.rb
191
+ - test/examples/test-triangle.rb
196
192
  - test/examples/thread.rb
197
193
  - test/examples/tmate.rb
198
194
  - test/examples/trace.rb
195
+ - test/examples/tri3.rb
196
+ - test/examples/triangle.rb
199
197
  - test/examples/variables.rb
200
198
  - test/finish_test.rb
201
199
  - test/frame_test.rb
@@ -242,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
240
  version: '0'
243
241
  requirements: []
244
242
  rubyforge_project:
245
- rubygems_version: 2.1.4
243
+ rubygems_version: 2.0.3
246
244
  signing_key:
247
245
  specification_version: 4
248
246
  summary: Ruby 2.0 fast debugger - base + cli
@@ -263,6 +261,8 @@ test_files:
263
261
  - test/examples/finish.rb
264
262
  - test/examples/frame.rb
265
263
  - test/examples/frame_deep.rb
264
+ - test/examples/gcd.rb
265
+ - test/examples/hanoi.rb
266
266
  - test/examples/help.rb
267
267
  - test/examples/info.rb
268
268
  - test/examples/info2.rb
@@ -270,6 +270,7 @@ test_files:
270
270
  - test/examples/list.rb
271
271
  - test/examples/method.rb
272
272
  - test/examples/post_mortem.rb
273
+ - test/examples/primes.rb
273
274
  - test/examples/quit.rb
274
275
  - test/examples/reload.rb
275
276
  - test/examples/repl.rb
@@ -280,9 +281,12 @@ test_files:
280
281
  - test/examples/show.rb
281
282
  - test/examples/source.rb
282
283
  - test/examples/stepping.rb
284
+ - test/examples/test-triangle.rb
283
285
  - test/examples/thread.rb
284
286
  - test/examples/tmate.rb
285
287
  - test/examples/trace.rb
288
+ - test/examples/tri3.rb
289
+ - test/examples/triangle.rb
286
290
  - test/examples/variables.rb
287
291
  - test/finish_test.rb
288
292
  - test/frame_test.rb
@@ -1,196 +0,0 @@
1
- .TH byebug 1
2
- .SH NAME
3
- byebug \- Fast Ruby debugger
4
- .SH SYNOPSIS
5
- .B byebug
6
- [byebug-options]
7
- byebug
8
- [script-options...]
9
- .SH "DESCRIPTION"
10
- This manual page documents briefly the
11
- .BR byebug
12
- command.
13
- .PP
14
- .B byebug
15
- is a fast implementation of the standard Ruby byebug debug.rb. It
16
- is implemented by utilizing a Ruby C API hook, allows for remote
17
- debugging and can be used as the Ruby byebug backend interface for a
18
- development environment.
19
- .PP
20
- The commands generally follow gdb's command set unless there's good
21
- reason not to.
22
-
23
- .PP
24
- byebug can do four main kinds of things (plus other things in support of
25
- these) to help you catch bugs in the act:
26
-
27
- .TP
28
- \ \ \ \(bu
29
- Start or restart your Ruby script, specifying arguments that might
30
- affect its behavior.
31
-
32
- .TP
33
- \ \ \ \(bu
34
- Make your program stop at various points possibly determined by
35
- specified conditions.
36
-
37
- .TP
38
- \ \ \ \(bu
39
- Examine what has happened when your program has stopped.
40
-
41
- .TP
42
- \ \ \ \(bu
43
- Change things in your program, so you can experiment with correcting the
44
- effects of one bug and go on to learn about another.
45
- .PP
46
-
47
- Here are some of the most frequently-needed commands:
48
- .TP
49
- .B break \fR[\|\fIfile\fB:\fIline\fR\fR|\fIclass.method\fR] \fR[if \fIexpr\fR]
50
- \&
51
- Set a breakpoint at \c
52
- .I class.method\c
53
- \& or at the specified file and line.
54
- .TP
55
- .B continue \fR[\fIline\fR]
56
- Continue running your program (after stopping, e.g. at a
57
- breakpoint). If a line is given a one-time breakpoint is set there.
58
- .TP
59
- .B delete \fR[\fIbreakpoint-numbers\fR]
60
- \&
61
- Delete breakpoints by number. If no number is given delete all breakpoints.
62
- .TP
63
- .B down \fR[\|\fIcount\fR\|]
64
- Move down one block frame. If count is given move up that many frames. A negative number
65
- goes the other direction and is like the up command
66
- .TP
67
- .B finish
68
- Run until the completion of the current function or method.
69
- .TP
70
- .BI frame " frame-number"
71
- Set the stack frame to \fIframe-number\fR for purposes of examinine local variables. For positioning relative to the current frame, use
72
- .B up
73
- or
74
- .B down. A negative number starts counting from the other end.
75
- .TP
76
- .B help \fR[\|\fIname\fR\|]
77
- Show information about byebug command \c
78
- .I name\c
79
- \&, or general information
80
- about using byebug.
81
- .TP
82
- .B info \fR[\|\fIname\fR\|]
83
- Get the various information usually about the debugged program.
84
- .TP
85
- .B irb \fIcommand\fR
86
- Run an interactive ruby shell (irb) using the current environment.
87
- .TP
88
- .B list \fR[\|\fIfile\fB:\fIline\fR|\fIfunction]
89
- type the text of the program in the vicinity of where it is presently stopped
90
- or at the specified function or file and line.
91
- .TP
92
- .B next \fR[\|\fIcount\fR\|]
93
- Execute next program line(s) (after stopping); step \c
94
- .I over\c
95
- \& any
96
- function calls in the line.
97
- .TP
98
- .BI pp " expr"\c
99
- \&
100
- Pretty print the value of an expression.
101
- .TP
102
- .BI print " expr"\c
103
- \&
104
- Display the value of an expression.
105
- .TP
106
- .BI ps " expr"\c
107
- \&
108
- Print an array as a columized sorted list.
109
- .TP
110
- .B quit
111
- Exit byebug.
112
- .TP
113
- .B run \fR[\|\fIarglist\fR\|]
114
- (Re)start your program (with \c
115
- .I arglist\c
116
- \&, if specified). If you want byebug to get reloaded, use
117
- .B restart
118
- instead.
119
- .TP
120
- .B set
121
- Modify parts of byebug's environment.
122
- .TP
123
- .B show
124
- See byebug's environment settings
125
- .TP
126
- .BI source " filename"\c
127
- \&
128
- Read and execute the lines in file \fIfilename\fR as a series of byebug
129
- commands.
130
- .TP
131
- .B step \fR[\|\fIcount\fR\|]
132
- Execute next program line(s) (after stopping); step \c
133
- .I into\c
134
- \& any
135
- function calls in the line.
136
- .TP
137
- .B up \fR[\|\fIcount\fR\|]
138
- Move up one block frame. If count is given move up that many frames. A negative number
139
- goes the other direction and is like the down command
140
- .TP
141
- .B where \fR[\|\fIcount\fR\|]
142
- Display all or \fIcount\fR items of the program stack.
143
- .PP
144
- For full details on byebug, see \c
145
- https://github.com/cldwalker/byebug
146
- .SH OPTIONS
147
- .PP
148
- .TP 10
149
- .TP
150
- .B \-d | \-\-debug
151
- Set $DEBUG true.
152
- .TP
153
- .B \-I | \-\-include PATH
154
- Add PATH to $LOAD_PATH
155
- .TP
156
- .B \-m | \-\-post-mortem
157
- Activate post-mortem mode.
158
- .TP
159
- .B \-\-no\-stop
160
- Do not stop when script is loaded.
161
- .TP
162
- .B \-r | \-\-require SCRIPT
163
- Require the library, before executing your script.
164
- .TP
165
- .B \-\-script FILE
166
- Name of the script file to run.
167
- .TP
168
- .B \-x | \-\-trace
169
- Show lines before executing them.
170
- .TP
171
- .B \-\-no\-quit
172
- Do not quit when script terminates. Instead rerun the program.
173
- .TP
174
- .B \-\-version
175
- Show the version number and exit.
176
- .TP
177
- .B \-\-v
178
- Print the version number, then turn on verbose mode if a script name
179
- is given. If no script name is given just exit after printing the
180
- version number.
181
- .TP
182
- .B \-\-nx
183
- Don't execute commands found in any initialization files, e.g. .byebugrc.
184
- .TP
185
- .B \-\-script=FILE
186
- Name of the script file to run
187
- .TP
188
- .B \-\-help
189
- Show invocation help and exit.
190
- .PD
191
- .SH "SEE ALSO"
192
- .Sp
193
- https://github.com/deivid-rodriguez/byebug
194
- .SH AUTHOR
195
- byebug was written by Kent Siblev. This manual page was written by Rocky
196
- Bernstein <rocky@gnu.org>