debase 0.2.3.beta5 → 0.2.3

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: 682d6984f0e5b33479f3c5138c7af974e59597cf
4
- data.tar.gz: ed9e19b600656cbd66f46c29673c1f557db8e51b
3
+ metadata.gz: 804974bdb7f42d640f15e77579d6bd3efccc8ebc
4
+ data.tar.gz: 7bf3e160c4c602873c271e791a279c2211e09b65
5
5
  SHA512:
6
- metadata.gz: c128d2bfbc14ba0078f5605fbd9b2213eb77fcee710621efb9938d86923b1159707ea743a322e89f6b084089b7c6d1d1b3aec59acbd786578a8b6a0f2a739db6
7
- data.tar.gz: df4677f7266bdee7fe11fbb9157544a01233c65707dcb312927962591897a9187a412a976d8e98686a53645228313077c769f91a5e5b519ff72f9716b80aaae5
6
+ metadata.gz: a70e957bfe8a777a8a3c62f25aca86012cd831589f0c265428c1d81122d811774b0dabc5748a6a7f812cbac0f9d0df863793e13de2c8b4977d3ab9f7dc1e840d
7
+ data.tar.gz: 0aaa866f084dd6634eee79ae37b7fdb556a636faf5ca0d39982e35e02e7c5eeb185c824d7f12c69a738da52f4b13229cde057957d275b9a800c170a70021d905
@@ -147,6 +147,7 @@ context_create(VALUE thread, VALUE cDebugThread) {
147
147
  context->stack_size = 0;
148
148
  locations = rb_funcall(thread, rb_intern("backtrace_locations"), 1, INT2FIX(1));
149
149
  context->calced_stack_size = locations != Qnil ? RARRAY_LENINT(locations) : 0;
150
+ context->init_stack_size = -1;
150
151
 
151
152
  context->stack = NULL;
152
153
  context->thnum = ++thnum_current;
@@ -154,6 +155,8 @@ context_create(VALUE thread, VALUE cDebugThread) {
154
155
  context->flags = 0;
155
156
  context->last_file = NULL;
156
157
  context->last_line = -1;
158
+ context->hit_user_code = 0;
159
+ context->script_finished = 0;
157
160
  context->stop_frame = -1;
158
161
  context->thread_pause = 0;
159
162
  context->stop_reason = CTX_STOP_NONE;
@@ -303,6 +303,8 @@ remove_pause_flag(VALUE thread, VALUE context_object, VALUE ignored)
303
303
  static void
304
304
  call_at_line(debug_context_t *context, char *file, int line, VALUE context_object)
305
305
  {
306
+ context->hit_user_code = 1;
307
+
306
308
  rb_hash_foreach(contexts, remove_pause_flag, 0);
307
309
  CTX_FL_UNSET(context, CTX_FL_STEPPED);
308
310
  CTX_FL_UNSET(context, CTX_FL_FORCE_MOVE);
@@ -331,6 +333,13 @@ process_line_event(VALUE trace_point, void *data)
331
333
  tp = TRACE_POINT;
332
334
  path = rb_tracearg_path(tp);
333
335
 
336
+ if(context->stack_size <= context->init_stack_size && context->hit_user_code) {
337
+ context->script_finished = 1;
338
+ }
339
+ if(context->script_finished) {
340
+ return;
341
+ }
342
+
334
343
  if (is_path_accepted(path)) {
335
344
 
336
345
  lineno = rb_tracearg_lineno(tp);
@@ -340,6 +349,10 @@ process_line_event(VALUE trace_point, void *data)
340
349
  update_stack_size(context);
341
350
  print_event(tp, context);
342
351
 
352
+ if(context->init_stack_size == -1) {
353
+ context->init_stack_size = context->stack_size;
354
+ }
355
+
343
356
  if (context->thread_pause) {
344
357
  context->stop_next = 1;
345
358
  context->dest_frame = -1;
@@ -60,6 +60,9 @@ typedef struct debug_context {
60
60
 
61
61
  char *last_file;
62
62
  int last_line;
63
+ int init_stack_size;
64
+ int script_finished;
65
+ int hit_user_code;
63
66
  } debug_context_t;
64
67
 
65
68
  typedef struct
@@ -1,3 +1,3 @@
1
1
  module Debase
2
- VERSION = "0.2.3.beta5" unless defined? VERSION
2
+ VERSION = "0.2.3" 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.3.beta5
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Ushakov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-29 00:00:00.000000000 Z
11
+ date: 2019-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase-ruby_core_source
@@ -132,9 +132,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
132
  version: '2.0'
133
133
  required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  requirements:
135
- - - ">"
135
+ - - ">="
136
136
  - !ruby/object:Gem::Version
137
- version: 1.3.1
137
+ version: '0'
138
138
  requirements: []
139
139
  rubyforge_project: debase
140
140
  rubygems_version: 2.6.10