ruby-debug-base19 0.11.16 → 0.11.17
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.
- data/ext/ruby_debug/ruby_debug.c +21 -5
- data/ext/ruby_debug/ruby_debug.h +1 -0
- metadata +11 -4
data/ext/ruby_debug/ruby_debug.c
CHANGED
@@ -67,10 +67,11 @@ static VALUE create_binding(VALUE);
|
|
67
67
|
static VALUE debug_stop(VALUE);
|
68
68
|
static void save_current_position(debug_context_t *);
|
69
69
|
static VALUE context_copy_args(debug_frame_t *);
|
70
|
-
static VALUE context_copy_locals(debug_frame_t *, VALUE);
|
70
|
+
static VALUE context_copy_locals(debug_context_t *,debug_frame_t *, VALUE);
|
71
71
|
static void context_suspend_0(debug_context_t *);
|
72
72
|
static void context_resume_0(debug_context_t *);
|
73
73
|
static void copy_scalar_args(debug_frame_t *);
|
74
|
+
static void debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE klass);
|
74
75
|
|
75
76
|
typedef struct locked_thread_t {
|
76
77
|
VALUE thread_id;
|
@@ -382,6 +383,7 @@ debug_context_create(VALUE thread)
|
|
382
383
|
debug_context->stack_size = 0;
|
383
384
|
debug_context->thread_id = ref2id(thread);
|
384
385
|
debug_context->breakpoint = Qnil;
|
386
|
+
debug_context->stack = GET_THREAD()->stack;
|
385
387
|
if(rb_obj_class(thread) == cDebugThread)
|
386
388
|
CTX_FL_SET(debug_context, CTX_FL_IGNORE);
|
387
389
|
return Data_Wrap_Struct(cContext, debug_context_mark, debug_context_free, debug_context);
|
@@ -411,7 +413,7 @@ debug_context_dup(debug_context_t *debug_context, VALUE self)
|
|
411
413
|
old_frame = &(debug_context->frames[i]);
|
412
414
|
new_frame->dead = 1;
|
413
415
|
new_frame->info.copy.args = context_copy_args(old_frame);
|
414
|
-
new_frame->info.copy.locals = context_copy_locals(old_frame, self);
|
416
|
+
new_frame->info.copy.locals = context_copy_locals(debug_context, old_frame, self);
|
415
417
|
}
|
416
418
|
return Data_Wrap_Struct(cContext, debug_context_mark, debug_context_free, new_debug_context);
|
417
419
|
}
|
@@ -676,6 +678,17 @@ create_catch_table(debug_context_t *debug_context, unsigned long cont)
|
|
676
678
|
return(catch_table);
|
677
679
|
}
|
678
680
|
|
681
|
+
static int
|
682
|
+
set_thread_event_flag_i(st_data_t key, st_data_t val, st_data_t flag)
|
683
|
+
{
|
684
|
+
VALUE thval = key;
|
685
|
+
rb_thread_t *th;
|
686
|
+
GetThreadPtr(thval, th);
|
687
|
+
th->event_flags |= RUBY_EVENT_VM;
|
688
|
+
|
689
|
+
return(ST_CONTINUE);
|
690
|
+
}
|
691
|
+
|
679
692
|
static void
|
680
693
|
debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE klass)
|
681
694
|
{
|
@@ -744,6 +757,9 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
|
|
744
757
|
/* only the current thread can proceed */
|
745
758
|
locker = thread->self;
|
746
759
|
|
760
|
+
/* make sure all threads have event flag set so we'll get its events */
|
761
|
+
st_foreach(GET_VM()->living_threads, set_thread_event_flag_i, 0);
|
762
|
+
|
747
763
|
/* remove any frames that are now out of scope */
|
748
764
|
while(debug_context->stack_size > 0)
|
749
765
|
{
|
@@ -1845,7 +1861,7 @@ context_copy_args(debug_frame_t *debug_frame)
|
|
1845
1861
|
}
|
1846
1862
|
|
1847
1863
|
static VALUE
|
1848
|
-
context_copy_locals(debug_frame_t *debug_frame, VALUE self)
|
1864
|
+
context_copy_locals(debug_context_t *debug_context, debug_frame_t *debug_frame, VALUE self)
|
1849
1865
|
{
|
1850
1866
|
int i;
|
1851
1867
|
rb_control_frame_t *cfp;
|
@@ -1867,7 +1883,7 @@ context_copy_locals(debug_frame_t *debug_frame, VALUE self)
|
|
1867
1883
|
if ((iseq != NULL) && (iseq->local_table != NULL) && (iseq != cfp->iseq))
|
1868
1884
|
{
|
1869
1885
|
rb_control_frame_t *block_frame = RUBY_VM_NEXT_CONTROL_FRAME(cfp);
|
1870
|
-
while (block_frame > (rb_control_frame_t*)
|
1886
|
+
while (block_frame > (rb_control_frame_t*)debug_context->stack)
|
1871
1887
|
{
|
1872
1888
|
if (block_frame->iseq == cfp->block_iseq)
|
1873
1889
|
{
|
@@ -1903,7 +1919,7 @@ context_frame_locals(int argc, VALUE *argv, VALUE self)
|
|
1903
1919
|
if (debug_frame->dead)
|
1904
1920
|
return debug_frame->info.copy.locals;
|
1905
1921
|
else
|
1906
|
-
return context_copy_locals(debug_frame, self);
|
1922
|
+
return context_copy_locals(debug_context, debug_frame, self);
|
1907
1923
|
}
|
1908
1924
|
|
1909
1925
|
/*
|
data/ext/ruby_debug/ruby_debug.h
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-debug-base19
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kent Sibilev
|
@@ -43,7 +43,12 @@ dependencies:
|
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: 0.5.11
|
45
45
|
version:
|
46
|
-
description:
|
46
|
+
description: |
|
47
|
+
ruby-debug is a fast implementation of the standard Ruby debugger debug.rb.
|
48
|
+
It is implemented by utilizing a new Ruby C API hook. The core component
|
49
|
+
provides support that front-ends can build on. It provides breakpoint
|
50
|
+
handling, bindings for stack frames among other things.
|
51
|
+
|
47
52
|
email: mark@fast-software.com
|
48
53
|
executables: []
|
49
54
|
|
@@ -67,8 +72,10 @@ files:
|
|
67
72
|
- test/base/base.rb
|
68
73
|
- test/base/binding.rb
|
69
74
|
- test/base/catchpoint.rb
|
70
|
-
has_rdoc:
|
75
|
+
has_rdoc: true
|
71
76
|
homepage: http://rubyforge.org/projects/ruby-debug19/
|
77
|
+
licenses: []
|
78
|
+
|
72
79
|
post_install_message:
|
73
80
|
rdoc_options:
|
74
81
|
- --charset=UTF-8
|
@@ -89,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
96
|
requirements: []
|
90
97
|
|
91
98
|
rubyforge_project: ruby-debug19
|
92
|
-
rubygems_version: 1.3.
|
99
|
+
rubygems_version: 1.3.4
|
93
100
|
signing_key:
|
94
101
|
specification_version: 3
|
95
102
|
summary: Fast Ruby debugger - core component
|