debase 0.0.7 → 0.0.8
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.
- checksums.yaml +4 -4
- data/ext/context.c +19 -0
- data/ext/debase_internals.c +23 -2
- data/ext/debase_internals.h +1 -0
- data/lib/debase/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06e75fc48a88bfcfad884d59e6050959aa4cdb7c
|
4
|
+
data.tar.gz: af560cc09d27d0576772ff203c3e70c780f25c7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dba74eaed514dc5e96c5264b09f9dd1b20c3e36ab1d283dd22ef7a621dcf4c0b58f3ef1c48f78db89e243eda997b068d2026f5ef8c0548489dcdb8d5101965f4
|
7
|
+
data.tar.gz: 92b07150601593a8f34012a3f625cc2739f70978fd38cae398e63295ae7c372d4a3fdb1c7c6c04db29e23bc4c4df6f0f5178386bca2b7668f8422bb3bfb69ca1
|
data/ext/context.c
CHANGED
@@ -46,6 +46,7 @@ fill_stack(debug_context_t *context, const rb_debug_inspector_t *inspector) {
|
|
46
46
|
|
47
47
|
locations = rb_debug_inspector_backtrace_locations(inspector);
|
48
48
|
stack_size = (int)RARRAY_LEN(locations);
|
49
|
+
context->stack_size = stack_size;
|
49
50
|
|
50
51
|
for (i = 0; i < stack_size; i++) {
|
51
52
|
frame = ALLOC(debug_frame_t);
|
@@ -142,6 +143,7 @@ context_create(VALUE thread, VALUE cDebugThread) {
|
|
142
143
|
context->last_file = NULL;
|
143
144
|
context->last_line = -1;
|
144
145
|
context->stop_frame = -1;
|
146
|
+
context->thread_pause = 0;
|
145
147
|
reset_stepping_stop_points(context);
|
146
148
|
if(rb_obj_class(thread) == cDebugThread) CTX_FL_SET(context, CTX_FL_IGNORE);
|
147
149
|
return Data_Wrap_Struct(cContext, Context_mark, Context_free, context);
|
@@ -255,6 +257,22 @@ Context_stop_reason(VALUE self)
|
|
255
257
|
return ID2SYM(rb_intern(symbol));
|
256
258
|
}
|
257
259
|
|
260
|
+
static VALUE
|
261
|
+
Context_pause(VALUE self)
|
262
|
+
{
|
263
|
+
debug_context_t *context;
|
264
|
+
|
265
|
+
Data_Get_Struct(self, debug_context_t, context);
|
266
|
+
|
267
|
+
if (context->thread == rb_thread_current())
|
268
|
+
{
|
269
|
+
return Qfalse;
|
270
|
+
}
|
271
|
+
|
272
|
+
context->thread_pause = 1;
|
273
|
+
return Qtrue;
|
274
|
+
}
|
275
|
+
|
258
276
|
static VALUE
|
259
277
|
Context_stop_next(int argc, VALUE *argv, VALUE self)
|
260
278
|
{
|
@@ -344,6 +362,7 @@ Init_context(VALUE mDebase)
|
|
344
362
|
rb_define_method(cContext, "step", Context_stop_next, -1);
|
345
363
|
rb_define_method(cContext, "step_over", Context_step_over, -1);
|
346
364
|
rb_define_method(cContext, "stop_frame=", Context_stop_frame, 1);
|
365
|
+
rb_define_method(cContext, "pause", Context_pause, 0);
|
347
366
|
|
348
367
|
idAlive = rb_intern("alive?");
|
349
368
|
|
data/ext/debase_internals.c
CHANGED
@@ -151,9 +151,21 @@ stop_inspector(VALUE data)
|
|
151
151
|
return Qnil;
|
152
152
|
}
|
153
153
|
|
154
|
+
static int
|
155
|
+
remove_pause_flag(VALUE thread, VALUE context_object, VALUE ignored)
|
156
|
+
{
|
157
|
+
debug_context_t *context;
|
158
|
+
|
159
|
+
Data_Get_Struct(context_object, debug_context_t, context);
|
160
|
+
context->thread_pause = 0;
|
161
|
+
|
162
|
+
return ST_CONTINUE;
|
163
|
+
}
|
164
|
+
|
154
165
|
static void
|
155
166
|
call_at_line(debug_context_t *context, char *file, int line, VALUE context_object)
|
156
167
|
{
|
168
|
+
rb_hash_foreach(contexts, remove_pause_flag, 0);
|
157
169
|
CTX_FL_UNSET(context, CTX_FL_STEPPED);
|
158
170
|
CTX_FL_UNSET(context, CTX_FL_FORCE_MOVE);
|
159
171
|
context->last_file = file;
|
@@ -187,8 +199,17 @@ process_line_event(VALUE trace_point, void *data)
|
|
187
199
|
update_stack_size(context);
|
188
200
|
print_event(tp, context);
|
189
201
|
|
190
|
-
|
191
|
-
|
202
|
+
if (context->thread_pause)
|
203
|
+
{
|
204
|
+
context->stop_next = 1;
|
205
|
+
context->dest_frame = -1;
|
206
|
+
moved = 1;
|
207
|
+
}
|
208
|
+
else
|
209
|
+
{
|
210
|
+
moved = context->last_line != line || context->last_file == NULL ||
|
211
|
+
strcmp(context->last_file, file) != 0;
|
212
|
+
}
|
192
213
|
|
193
214
|
if(context->dest_frame == -1 || context->stack_size == context->dest_frame)
|
194
215
|
{
|
data/ext/debase_internals.h
CHANGED
data/lib/debase/version.rb
CHANGED
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.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Ushakov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debugger-ruby_core_source
|