debase 0.2.2.beta1 → 0.2.2.beta2

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: 0a204eeb87e5c5825daab8bd4c2227232bdd3ecf
4
- data.tar.gz: b1388e1f9c6e8742f77f4f2f1846fda3ead02e2a
3
+ metadata.gz: fa9243251fe06c4d8edb12a8d66ef5a156846577
4
+ data.tar.gz: 590470f369f6f81a1740bf9e99e8aa4667227696
5
5
  SHA512:
6
- metadata.gz: 1bbfedb73da5c7bc16e49731ccabade30e09a2713e09708ba7aab85d982c06e3661f08c68712b76c779068253047ded44c31b518900bea9653ede6111dc18169
7
- data.tar.gz: 08f470b94fc465b657eefc74af3a7a0cc4b647fe017cf85d5b52f8f451dda5effa9ede5e92284d3c8a6e0dddc4c03342f4157f3eb6e9f9ebfef02a47fd1cafe9
6
+ metadata.gz: 933431d52c9e29ed084926f2c48fd6a7be6b44f3f801f3e73c0c3a9558743fc3e4ed7d9552b07d84591a1f045d26baf4aeeade4a81fd95b2733987c61a0a9c70
7
+ data.tar.gz: 52e8bd5c6bd39553feb8e3f9fcb720a6f3b4743cf80333311c7ad660ec44c9b3152a08155ac9bbe75e9fa675720d8b852a34feeed6f185a2e50be4e05bf45203
data/ext/breakpoint.c CHANGED
@@ -26,7 +26,7 @@ catchpoint_hit_count(VALUE catchpoints, VALUE exception, VALUE *exception_name)
26
26
  return Qnil;
27
27
  expn_class = rb_obj_class(exception);
28
28
  ancestors = rb_mod_ancestors(expn_class);
29
- for(i = 0; i < RARRAY_LEN(ancestors); i++)
29
+ for(i = 0; i < RARRAY_LENINT(ancestors); i++)
30
30
  {
31
31
  aclass = rb_ary_entry(ancestors, i);
32
32
  mod_name = rb_mod_name(aclass);
@@ -83,7 +83,7 @@ Breakpoint_remove(VALUE self, VALUE breakpoints, VALUE id_value)
83
83
 
84
84
  id = FIX2INT(id_value);
85
85
 
86
- for(i = 0; i < RARRAY_LEN(breakpoints); i++)
86
+ for(i = 0; i < RARRAY_LENINT(breakpoints); i++)
87
87
  {
88
88
  breakpoint_object = rb_ary_entry(breakpoints, i);
89
89
  Data_Get_Struct(breakpoint_object, breakpoint_t, breakpoint);
@@ -207,7 +207,7 @@ breakpoint_find(VALUE breakpoints, VALUE source, VALUE pos)
207
207
 
208
208
  file = RSTRING_PTR(source);
209
209
  line = FIX2INT(pos);
210
- for(i = 0; i < RARRAY_LEN(breakpoints); i++)
210
+ for(i = 0; i < RARRAY_LENINT(breakpoints); i++)
211
211
  {
212
212
  breakpoint_object = rb_ary_entry(breakpoints, i);
213
213
  if (check_breakpoint_by_pos(breakpoint_object, file, line))
data/ext/context.c CHANGED
@@ -29,7 +29,7 @@ fill_frame(debug_frame_t *frame, const char* file, int line, VALUE binding, VALU
29
29
  frame->file = file;
30
30
  frame->line = line;
31
31
  frame->binding = binding;
32
- frame->self = self;
32
+ frame->self = self;
33
33
  }
34
34
 
35
35
  extern void
@@ -45,7 +45,7 @@ fill_stack(debug_context_t *context, const rb_debug_inspector_t *inspector) {
45
45
  int i;
46
46
 
47
47
  locations = rb_debug_inspector_backtrace_locations(inspector);
48
- stack_size = locations == Qnil ? 0 : (int)RARRAY_LEN(locations);
48
+ stack_size = locations == Qnil ? 0 : RARRAY_LENINT(locations);
49
49
  context->stack_size = stack_size;
50
50
 
51
51
  for (i = 0; i < stack_size; i++) {
@@ -138,7 +138,7 @@ context_create(VALUE thread, VALUE cDebugThread) {
138
138
  context = ALLOC(debug_context_t);
139
139
  context->stack_size = 0;
140
140
  locations = rb_funcall(thread, rb_intern("backtrace_locations"), 1, INT2FIX(1));
141
- context->calced_stack_size = locations != Qnil ? (int)RARRAY_LEN(locations) : 0;
141
+ context->calced_stack_size = locations != Qnil ? RARRAY_LENINT(locations) : 0;
142
142
  context->stack = NULL;
143
143
  context->thnum = ++thnum_current;
144
144
  context->thread = thread;
@@ -162,7 +162,7 @@ print_event(rb_trace_point_t *tp, debug_context_t *context)
162
162
  locations = rb_funcall(context->thread, rb_intern("backtrace_locations"), 1, INT2FIX(1));
163
163
  fprintf(stderr, " calced_stack_size=%d, stack_size=%d, real_stack_size=%d\n",
164
164
  context->calced_stack_size, context->stack_size,
165
- locations != Qnil ? (int)RARRAY_LEN(locations) : 0);
165
+ locations != Qnil ? RARRAY_LENINT(locations) : 0);
166
166
  }
167
167
  }
168
168
 
@@ -1,17 +1,9 @@
1
1
  module Debase
2
2
  class Context
3
3
  def frame_locals(frame_no=0)
4
- result = {}
5
- binding = frame_binding(frame_no)
6
- locals = eval("local_variables", binding)
7
- if locals.respond_to?(:each)
8
- locals.each do |local|
9
- result[local.to_s] = safe_eval(local.to_s, binding)
10
- end
11
- else
12
- result[locals.to_s] = safe_eval(locals.to_s, binding)
13
- end
14
- result
4
+ frame_binding(frame_no).eval('local_variables.inject({}){|h, v| h[v.to_s] = eval(v.to_s); h}')
5
+ rescue => e
6
+ {'debase-debug' => "*Evaluation error: '#{e}'" }
15
7
  end
16
8
 
17
9
  def frame_class(frame_no=0)
@@ -46,16 +38,5 @@ module Debase
46
38
  def at_return(file, line)
47
39
  handler.at_return(self, file, line)
48
40
  end
49
-
50
- private
51
-
52
- def safe_eval(expr, binding)
53
- begin
54
- eval(expr, binding)
55
- rescue => e
56
- "*Evaluation error: '#{e}'"
57
- end
58
- end
59
-
60
41
  end
61
42
  end
@@ -1,3 +1,3 @@
1
1
  module Debase
2
- VERSION = "0.2.2.beta1" unless defined? VERSION
2
+ VERSION = "0.2.2.beta2" unless defined? VERSION
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2.beta1
4
+ version: 0.2.2.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Ushakov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-04 00:00:00.000000000 Z
11
+ date: 2015-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase-ruby_core_source