trepanning 2.15.33 → 2.15.35

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e00fc82ddd7fc2774cfabfc75c3f6351ce6a9e21
4
- data.tar.gz: 5288b85fe907200db5002ebb8d27952d08eb89bc
3
+ metadata.gz: 881c378f5a00c045da7730303e3edbc6571f3d05
4
+ data.tar.gz: 30f530b6ade78288c1658b134b4d6e8e0424d4e5
5
5
  SHA512:
6
- metadata.gz: 14b6a7fedac002c92523f975d8ad38a4cbfa3392bc05dd720cab6a4afea63fcaa79415a46fc15e2868843b6b588cb291efbcacfe39dfd85dc2a5b8e87bd58ffd
7
- data.tar.gz: 28777e369fa958cbc2d3ed508d8f0d5da015c7fb4c3541432f0820486c579c01b74e0992fc4641b77cb1f491b3dacdaa154cf679620cb98fe4418b0701b42653
6
+ metadata.gz: a1f06de92e91df34d0c6cdbb3397dc07bbafd04c2a095af4a1c66677de66c2f9e6877715053e51e12ed9026bc0d62d11fb1fc2339becfa7154f5bc94612929e8
7
+ data.tar.gz: f35612f05b692c8b132e33bb2b37c1a227c39cae8da422d8064eeb1a180f7a46ee0a13481c016f7b85a5619e0c4450c48af8c89ce2ca21b5e20dfff608bf23ec
data/ChangeLog CHANGED
@@ -1,6 +1,25 @@
1
+ 2015-03-12 rocky <rockyb@rubyforge.org>
2
+
3
+ * app/options.rb, trepanning.gemspec: Get ready for release 2.15.35
4
+
5
+ 2015-03-12 rocky <rockyb@rubyforge.org>
6
+
7
+ * app/markdown.rb, processor/command/list.rb, processor/frame.rb,
8
+ processor/list.rb, test/unit/test-cmd-parse_list_cmd.rb: markdown:
9
+ remove stray space after `` list: subsequent list command continue
10
+ from where we last left off.
11
+
12
+ 2015-03-12 rocky <rockyb@rubyforge.org>
13
+
14
+ * processor.rb: empty string repeats last command.
15
+
16
+ 2015-03-12 rocky <rockyb@rubyforge.org>
17
+
18
+ * trepanning.gemspec: Use markdown in spec description.
19
+
1
20
  2015-03-08 rocky <rockyb@rubyforge.org>
2
21
 
3
- * NEWS, app/options.rb: Get ready for release 2.15.33
22
+ * ChangeLog, NEWS, app/options.rb: Get ready for release 2.15.33
4
23
 
5
24
  2015-03-08 rocky <rockyb@rubyforge.org>
6
25
 
@@ -53,7 +53,7 @@ module Redcarpet
53
53
 
54
54
  def codespan(text)
55
55
  if ansi?
56
- Term::ANSIColor.underline + text + Term::ANSIColor.reset + "\n"
56
+ Term::ANSIColor.underline + text + Term::ANSIColor.reset
57
57
  else
58
58
  "'" + text + "'"
59
59
  end
@@ -155,7 +155,9 @@ if __FILE__ == $0
155
155
  include Trepan::Markdown
156
156
  string = <<EOF
157
157
  # HI
158
- This is a paragraph
158
+ This is a paragraph.
159
+
160
+ A `b`, `c`, d
159
161
 
160
162
  **This** is another *paragraph*.
161
163
  EOF
@@ -8,7 +8,7 @@ require 'optparse'
8
8
  class Trepan
9
9
  require_relative 'default'
10
10
 
11
- VERSION = '2.15.33'
11
+ VERSION = '2.15.35'
12
12
  PROGRAM = 'trepan'
13
13
 
14
14
  def self.show_version
@@ -156,6 +156,7 @@ class Trepan
156
156
  end
157
157
  if @current_command.empty?
158
158
  next unless @last_command && intf.interactive?;
159
+ @current_command = @last_command
159
160
  end
160
161
  next if @current_command[0..0] == '#' # Skip comment lines
161
162
  break
@@ -9,8 +9,9 @@ class Trepan::Command::ListCommand < Trepan::Command
9
9
  unless defined?(HELP)
10
10
  NAME = File.basename(__FILE__, '.rb')
11
11
  HELP = <<-HELP
12
- **#{NAME}[>]** [*module*] [*first* [*num*]]
13
- **#{NAME}[>]** *location [*num*]
12
+ **#{NAME}**[**>**] [*module*] [*first* [*num*]]
13
+
14
+ **#{NAME}**[**>**] *location* [*num*]
14
15
 
15
16
  List source code.
16
17
 
@@ -22,13 +23,13 @@ changing, then that is start the line after we last one previously
22
23
  shown.
23
24
 
24
25
  If the command has a ">" suffix, then line centering is disabled and
25
- listing begins at the specificed location.
26
+ listing begins at the specified location.
26
27
 
27
28
  The number of lines to show is controlled by the debugger "listsize"
28
29
  setting. Use 'set max list' or 'show max list' to see or set the
29
30
  value.
30
31
 
31
- \"#{NAME} -\" shows lines before a previous listing.
32
+ `#{NAME} -` shows lines before a previous listing.
32
33
 
33
34
  A *location* is a either:
34
35
 
@@ -170,6 +171,8 @@ See also:
170
171
  msg(s + "\t" + line, {:unlimited => true})
171
172
  @proc.line_no = lineno
172
173
  end
174
+ @proc.list_lineno += listsize + center_correction + 1
175
+ @proc.list_lineno = max_line if @proc.list_lineno > max_line
173
176
  rescue => e
174
177
  errmsg e.to_s if settings[:debugexcept]
175
178
  end
@@ -14,8 +14,9 @@ class Trepan
14
14
  # frame index in a "backtrace" command
15
15
  attr_accessor :frame_index
16
16
  attr_accessor :hide_level
17
+ attr_accessor :list_lineno
17
18
 
18
- # Hash[thread_id] -> FixNum, the level of the last frame to
19
+ # Hash[thread_id] -> Fixnum, the level of the last frame to
19
20
  # show. If we called the debugger directly, then there is
20
21
  # generally a portion of a backtrace we don't want to show. We
21
22
  # don't need to store this for all threads, just those we want to
@@ -54,7 +55,7 @@ class Trepan
54
55
  print_stack_trace_from_to(frame_num, frame_num, frame, opts)
55
56
  print_location
56
57
  end
57
- @line_no = frame_line() - 1
58
+ @list_lineno = @line_no = frame_line() - 1
58
59
  @frame
59
60
  else
60
61
  nil
@@ -126,6 +127,7 @@ class Trepan
126
127
  else
127
128
  @hidelevels[@current_thread]
128
129
  end
130
+ @list_lineno = frame_line()
129
131
 
130
132
  end
131
133
 
@@ -17,9 +17,9 @@ class Trepan
17
17
  end
18
18
 
19
19
  def frame_filename
20
-
20
+
21
21
  container = frame_container(frame, false)
22
-
22
+
23
23
  # FIXME: put into a helper routine
24
24
  # See also duplicate code in print_location
25
25
  if container[0] != 'file'
@@ -35,7 +35,7 @@ class Trepan
35
35
  end
36
36
  container = try_container if try_container[0] == 'file'
37
37
  end
38
-
38
+
39
39
  return container[1]
40
40
  end
41
41
 
@@ -47,7 +47,7 @@ class Trepan
47
47
  iseq = nil
48
48
  if position_str.empty?
49
49
  filename = frame_filename
50
- first = [1, frame_line - center_correction].max
50
+ first = [1, @list_lineno - center_correction].max
51
51
  else
52
52
  ## FIXME: push into parse
53
53
  if RbConfig::CONFIG['target_os'].start_with?('mingw') and
@@ -70,7 +70,7 @@ class Trepan
70
70
  elsif position == '.'
71
71
  return no_frame_msg_for_list unless frame_line
72
72
  if (second = list_cmd_parse.num)
73
- first = frame_line
73
+ first = frame_line
74
74
  last = adjust_last(first, second)
75
75
  else
76
76
  first = [1, frame_line - center_correction].max
@@ -79,21 +79,21 @@ class Trepan
79
79
  end
80
80
  filename = frame_filename
81
81
  else
82
- meth_or_frame, filename, offset, offset_type =
82
+ meth_or_frame, filename, offset, offset_type =
83
83
  parse_position(position)
84
84
  return [nil] * 4 unless filename
85
85
  if offset_type == :line
86
86
  first = offset
87
87
  elsif meth_or_frame
88
88
  if iseq = meth_or_frame.iseq
89
- iseq, first, vm_offset =
89
+ iseq, first, vm_offset =
90
90
  position_to_line_and_offset(iseq, filename, position, offset_type)
91
91
  unless first
92
92
  errmsg("Unable to get location in #{meth_or_frame}")
93
- return [nil] * 4
93
+ return [nil] * 4
94
94
  end
95
95
  end
96
- elsif !offset
96
+ elsif !offset
97
97
  first = 1
98
98
  else
99
99
  errmsg("Unable to parse list position #{position_str}")
@@ -105,7 +105,7 @@ class Trepan
105
105
  first, last = [first + last, first] if last < 0
106
106
  last = adjust_last(first, last)
107
107
  else
108
- first = [1, first - center_correction].max
108
+ first = [1, first - center_correction].max
109
109
  last = first + listsize - 1 unless last
110
110
  end
111
111
  if filename
@@ -115,12 +115,12 @@ class Trepan
115
115
  end
116
116
  return [iseq, filename, first, last]
117
117
  end
118
-
118
+
119
119
  def no_frame_msg_for_list
120
120
  errmsg("No Ruby program loaded.")
121
121
  return nil, nil, nil, nil
122
122
  end
123
-
123
+
124
124
  end
125
125
  end
126
126
 
@@ -129,18 +129,18 @@ if __FILE__ == $0
129
129
  if !(ARGV.size == 1 && ARGV[0] == 'noload')
130
130
  ARGV[0..-1] = ['noload']
131
131
  load(__FILE__)
132
- else
132
+ else
133
133
  require 'thread_frame'
134
134
  require_relative '../app/mock'
135
135
  require_relative './default'
136
136
  require_relative 'frame'
137
137
 
138
138
  # FIXME: Have to include before defining CmdProcessor!
139
- require_relative '../processor'
139
+ require_relative '../processor'
140
140
 
141
141
  cmdproc = Trepan::CmdProcessor.new(Trepan::MockCore.new())
142
142
  cmdproc.frame_initialize
143
- cmdproc.instance_variable_set('@settings',
143
+ cmdproc.instance_variable_set('@settings',
144
144
  Trepan::CmdProcessor::DEFAULT_SETTINGS)
145
145
  cmdproc.frame_setup(RubyVM::Frame.current)
146
146
  def foo; 5 end
@@ -15,7 +15,7 @@ class TestCommandParseListCmd < Test::Unit::TestCase
15
15
  listsize = 10
16
16
  line = __LINE__+5
17
17
  load 'tmpdir.rb'
18
- [['', [short_file, line, line+listsize-1]],
18
+ [['.', [short_file, line+5, line+listsize-1+5]],
19
19
  ["#{__FILE__}:10", [short_file, 5, 14]],
20
20
  ["#{__FILE__} 10", [short_file, 5, 14]],
21
21
  ['tmpdir.rb', ['tmpdir.rb', 1, listsize]],
@@ -10,14 +10,15 @@ Gem::Specification.new do |spec|
10
10
  spec.authors = ['R. Bernstein']
11
11
  spec.date = Time.now
12
12
  spec.description = <<-EOF
13
- A Ruby debugger with both high and low-level debugging support.
13
+ == Description
14
+
15
+ A gdb-like Ruby debugger with both high and low-level debugging support.
14
16
 
15
17
  To provide the advanced features this version works only with a
16
18
  patched MRI Ruby 2.1.5 runtime.
17
19
 
18
- This version works only with a patched version of Ruby 2.1.5
19
- For a version that works with Ruby 1.9.3 look install a version
20
- starting with 1.93.
20
+ For a version that works with Ruby 1.9.3, install a version
21
+ starting with 1.93
21
22
  EOF
22
23
  spec.add_dependency('redcarpet', '~> 3.2')
23
24
  spec.add_dependency('columnize', '~> 0.9')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trepanning
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.15.33
4
+ version: 2.15.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - R. Bernstein
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-08 00:00:00.000000000 Z
11
+ date: 2015-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redcarpet
@@ -81,14 +81,15 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: |
84
- A Ruby debugger with both high and low-level debugging support.
84
+ == Description
85
+
86
+ A gdb-like Ruby debugger with both high and low-level debugging support.
85
87
 
86
88
  To provide the advanced features this version works only with a
87
89
  patched MRI Ruby 2.1.5 runtime.
88
90
 
89
- This version works only with a patched version of Ruby 2.1.5
90
- For a version that works with Ruby 1.9.3 look install a version
91
- starting with 1.93.
91
+ For a version that works with Ruby 1.9.3, install a version
92
+ starting with 1.93
92
93
  email: rockyb@rubyforge.net
93
94
  executables:
94
95
  - trepan
@@ -459,7 +460,7 @@ rdoc_options:
459
460
  - "--main"
460
461
  - README
461
462
  - "--title"
462
- - Trepan 2.15.33 Documentation
463
+ - Trepan 2.15.35 Documentation
463
464
  require_paths:
464
465
  - lib
465
466
  required_ruby_version: !ruby/object:Gem::Requirement