ruby-debug-ide 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/ruby-debug.rb CHANGED
@@ -110,7 +110,7 @@ module Debugger
110
110
  host ||= 'localhost' # nil does not seem to work for IPv6, localhost does
111
111
  end
112
112
  Debugger.print_debug("Waiting for connection on '#{host}:#{port}'")
113
- $stderr.puts "Fast Debugger (ruby-debug-ide 0.2.1) listens on #{host}:#{port}"
113
+ $stderr.puts "Fast Debugger (ruby-debug-ide 0.3.0) listens on #{host}:#{port}"
114
114
  server = TCPServer.new(host, port)
115
115
  while (session = server.accept)
116
116
  begin
@@ -7,19 +7,19 @@ module Debugger
7
7
  end
8
8
 
9
9
  def execute
10
- excn = @match[1]
11
- unless excn
10
+ exception_class_name = @match[1]
11
+ unless exception_class_name
12
12
  errmsg "Exception class must be specified for 'catch' command"
13
13
  else
14
14
  binding = @state.context ? get_binding : TOPLEVEL_BINDING
15
- unless debug_eval("#{excn}.is_a?(Class)", binding)
16
- print_msg "Warning #{excn} is not known to be a Class"
15
+ unless debug_eval("#{exception_class_name}.is_a?(Class)", binding)
16
+ print_msg "Warning #{exception_class_name} is not known to be a Class"
17
17
  end
18
- Debugger.add_catchpoint(excn)
19
- print_msg "Set catchpoint %s.", excn
18
+ Debugger.add_catchpoint(exception_class_name)
19
+ print_catchpoint_set(exception_class_name)
20
20
  end
21
21
  end
22
-
22
+
23
23
  class << self
24
24
  def help_command
25
25
  'catch'
@@ -22,6 +22,7 @@ module Debugger
22
22
  while input = @interface.read_command
23
23
  # escape % since print_debug might use printf
24
24
  @printer.print_debug "Processing: #{input.gsub('%', '%%')}"
25
+ # sleep 0.3
25
26
  catch(:debug_error) do
26
27
  if cmd = ctrl_cmds.find{|c| c.match(input) }
27
28
  cmd.execute
@@ -31,6 +32,8 @@ module Debugger
31
32
  end
32
33
  end
33
34
  rescue IOError, Errno::EPIPE
35
+ @printer.print_error "INTERNAL ERROR!!! #{$!}\n" rescue nil
36
+ @printer.print_error $!.backtrace.map{|l| "\t#{l}"}.join("\n") rescue nil
34
37
  rescue Exception
35
38
  @printer.print_error "INTERNAL ERROR!!! #{$!}\n" rescue nil
36
39
  @printer.print_error $!.backtrace.map{|l| "\t#{l}"}.join("\n") rescue nil
@@ -106,7 +106,7 @@ module Debugger
106
106
  end
107
107
  else
108
108
  has_children = !value.instance_variables.empty? || !value.class.class_variables.empty?
109
- value_str = value.to_s || 'nil'
109
+ value_str = value.to_s || 'nil' rescue "<#to_s method raised exception: #$!>"
110
110
  unless value_str.is_a?(String)
111
111
  value_str = "ERROR: #{value.class}.to_s method returns #{value_str.class}. Should return String."
112
112
  end
@@ -147,7 +147,11 @@ module Debugger
147
147
  def print_contdition_set(bp_id)
148
148
  print "<conditionSet bp_id=\"%d\"/>", bp_id
149
149
  end
150
-
150
+
151
+ def print_catchpoint_set(exception_class_name)
152
+ print "<catchpointSet exception=\"%s\"/>", exception_class_name
153
+ end
154
+
151
155
  def print_expressions(exps)
152
156
  print_element "expressions" do
153
157
  exps.each_with_index do |(exp, value), idx|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-debug-ide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Barchfeld, Martin Krauskopf
@@ -9,7 +9,7 @@ autorequire: ruby-debug-base
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-07-31 00:00:00 +02:00
12
+ date: 2008-09-08 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.10.1
23
+ version: 0.10.2
24
24
  version:
25
25
  description: An interface which glues ruby-debug to IDEs like Eclipse (RDT) and NetBeans.
26
26
  email: rubyeclipse-dev-list@sourceforge.net
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  requirements: []
77
77
 
78
78
  rubyforge_project: debug-commons
79
- rubygems_version: 1.2.0
79
+ rubygems_version: 1.2.0.1863
80
80
  signing_key:
81
81
  specification_version: 2
82
82
  summary: IDE interface for ruby-debug.