rhomobile-debug 1.0.5 → 1.0.6

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.
Files changed (3) hide show
  1. data/CHANGELOG +3 -0
  2. data/lib/debugger.rb +26 -21
  3. metadata +4 -4
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ ## 1.0.6
2
+ * Step Into / Step Over commands fixed
3
+
1
4
  ## 1.0.5
2
5
  * Unnecessary warnings removed from application log
3
6
 
data/lib/debugger.rb CHANGED
@@ -71,7 +71,7 @@ def get_variables(scope)
71
71
  prefix = "#{$_classname}."
72
72
  vartype = "C"
73
73
  elsif (scope =~ /^IVARS/)
74
- if ($_classname =~ /^\s*$/) or ($_methodname =~ /^\s*$/)
74
+ if ($_classname =~ /^\s*$/) || ($_methodname =~ /^\s*$/)
75
75
  return
76
76
  end
77
77
  cmd = "instance_variables"
@@ -136,7 +136,7 @@ def debug_handle_cmd(inline)
136
136
  $_breakpoints_enabled = false
137
137
  debugger_log(DEBUGGER_LOG_LEVEL_DEBUG, "Breakpoints disabled")
138
138
  processed = true
139
- elsif inline and (cmd =~ /^STEPOVER/)
139
+ elsif inline && (cmd =~ /^STEPOVER/)
140
140
  $_s.write("STEPOVER start\n")
141
141
  log_command(cmd)
142
142
  $_step = 2
@@ -145,7 +145,7 @@ def debug_handle_cmd(inline)
145
145
  wait = false
146
146
  debugger_log(DEBUGGER_LOG_LEVEL_DEBUG, "Step over")
147
147
  processed = true
148
- elsif inline and (cmd =~ /^STEPRET/)
148
+ elsif inline && (cmd =~ /^STEPRET/)
149
149
  log_command(cmd)
150
150
  if $_call_stack < 1
151
151
  $_step = 0
@@ -159,7 +159,7 @@ def debug_handle_cmd(inline)
159
159
  wait = false
160
160
  debugger_log(DEBUGGER_LOG_LEVEL_DEBUG, "Step return" + comment)
161
161
  processed = true
162
- elsif inline and (cmd =~ /^STEP/)
162
+ elsif inline && (cmd =~ /^STEP/)
163
163
  log_command(cmd)
164
164
  $_step = 1
165
165
  $_step_level = -1
@@ -167,7 +167,7 @@ def debug_handle_cmd(inline)
167
167
  wait = false
168
168
  debugger_log(DEBUGGER_LOG_LEVEL_DEBUG, "Step into")
169
169
  processed = true
170
- elsif inline and (cmd =~ /^CONT/)
170
+ elsif inline && (cmd =~ /^CONT/)
171
171
  log_command(cmd)
172
172
  wait = false
173
173
  $_step = 0
@@ -186,12 +186,12 @@ def debug_handle_cmd(inline)
186
186
  debugger_log(DEBUGGER_LOG_LEVEL_DEBUG, "Terminating...")
187
187
  processed = true
188
188
  System.exit
189
- elsif inline and (cmd =~ /^EVL?:/)
189
+ elsif inline && (cmd =~ /^EVL?:/)
190
190
  log_command(cmd)
191
191
  processed = true
192
192
  debugger_log(DEBUGGER_LOG_LEVEL_DEBUG, "Calc evaluation...")
193
193
  execute_cmd cmd.sub(/^EVL?:/,""), (cmd =~ /^EVL:/ ? true : false)
194
- elsif inline and (cmd =~ /^[GLCI]VARS/)
194
+ elsif inline && (cmd =~ /^[GLCI]VARS/)
195
195
  log_command(cmd)
196
196
  debugger_log(DEBUGGER_LOG_LEVEL_DEBUG, "Get variables...")
197
197
  get_variables cmd
@@ -220,22 +220,27 @@ $_tracefunc = lambda{|event, file, line, id, bind, classname|
220
220
  $_methodname = id;
221
221
  file = file.to_s.gsub('\\', '/')
222
222
 
223
- if file[0, $_app_path.length] == $_app_path
223
+ if (file[0, $_app_path.length] == $_app_path) || (!(file.index("./").nil?))
224
224
 
225
225
  if event =~ /^line/
226
226
 
227
227
  unhandled = true
228
- step_stop = ($_step > 0) and (($_step_level < 0) or ($_call_stack <= $_step_level))
228
+ step_stop = ($_step > 0) && (($_step_level < 0) || ($_call_stack <= $_step_level))
229
229
 
230
- a = step_stop.to_s
231
- #$_s.write('[Debugger][2] file = ' + file.to_s + ' step = ' + a.to_s + "\n")
230
+ #$_s.write('[Debugger][2] file = ' + file.to_s + ' line = ' + line.to_s + "\n")
232
231
 
233
- if (step_stop or ($_breakpoints_enabled and (not $_breakpoint.empty?)))
234
- filename = file[$_app_path.length, file.length-$_app_path.length]
232
+ if (step_stop || ($_breakpoints_enabled && (!($_breakpoint.empty?))))
233
+ filename = ""
234
+
235
+ if !(file.index("./").nil?)
236
+ filename = "/" + file[file.index("./") + 2, file.length]
237
+ else
238
+ filename = file[$_app_path.length, file.length-$_app_path.length]
239
+ end
235
240
 
236
241
  ln = line.to_i.to_s
237
- if (step_stop or ($_breakpoints_enabled and ($_breakpoint.has_key?(filename + ':' + ln))))
238
- #$_s.write('[Debugger][3] step = ' + file.to_s + ' line = ' + line.to_s + "\n")
242
+ if step_stop || ($_breakpoints_enabled && ($_breakpoint.has_key?(filename + ':' + ln)))
243
+ # $_s.write('[Debugger][3] step = ' + filename.to_s + ' line = ' + line.to_s + "\n")
239
244
 
240
245
  fn = filename.gsub(/:/, '|')
241
246
  cl = classname.to_s.gsub(/:/,'#')
@@ -253,7 +258,7 @@ $_tracefunc = lambda{|event, file, line, id, bind, classname|
253
258
 
254
259
  if app_type.eql? "rhodes"
255
260
  if System::get_property('main_window_closed')
256
- $_s.write("QUIT\n") if (not $_s.nil?)
261
+ $_s.write("QUIT\n") if !($_s.nil?)
257
262
  $_wait = false
258
263
  end
259
264
  end
@@ -293,8 +298,8 @@ begin
293
298
  debug_port_env = ENV['rho_debug_port']
294
299
  debug_path_env = ENV['ROOT_PATH']
295
300
 
296
- debug_host = (debug_host_env.nil? or debug_host_env == "") ? '127.0.0.1' : debug_host_env
297
- debug_port = (debug_port_env.nil? or debug_port_env == "") ? 9000 : debug_port_env
301
+ debug_host = ((debug_host_env.nil?) || (debug_host_env == "")) ? '127.0.0.1' : debug_host_env
302
+ debug_port = ((debug_port_env.nil?) || (debug_port_env == "")) ? 9000 : debug_port_env
298
303
 
299
304
  debugger_log(DEBUGGER_LOG_LEVEL_INFO, "host=" + debug_host_env.to_s)
300
305
  debugger_log(DEBUGGER_LOG_LEVEL_INFO, "port=" + debug_port_env.to_s)
@@ -314,11 +319,11 @@ begin
314
319
  $_cmd = ""
315
320
  $_app_path = ""
316
321
 
317
- $_app_path = (debug_path_env.nil? or debug_path_env == "") ? "" : debug_path_env
322
+ $_app_path = ((debug_path_env.nil?) || (debug_path_env == "")) ? "" : debug_path_env
318
323
  $_s.write("DEBUG PATH=" + $_app_path.to_s + "\n")
319
324
 
320
325
  at_exit {
321
- $_s.write("QUIT\n") if (not $_s.nil?)
326
+ $_s.write("QUIT\n") if !($_s.nil?)
322
327
  }
323
328
 
324
329
  set_trace_func $_tracefunc
@@ -327,7 +332,7 @@ begin
327
332
  while true
328
333
  debug_read_cmd($_s,true)
329
334
  while debug_handle_cmd(false) do end
330
- if ($_cmd !~ /^\s*$/) and (Thread.main.stop?)
335
+ if ($_cmd !~ /^\s*$/) && (Thread.main.stop?)
331
336
  #$_s.write("[manage thread] set wait = true\n")
332
337
  $_wait = true
333
338
  Thread.main.wakeup
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhomobile-debug
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 5
10
- version: 1.0.5
9
+ - 6
10
+ version: 1.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rhomobile
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-21 00:00:00 -07:00
18
+ date: 2011-12-27 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies: []
21
21