ruby-debug-base19x 0.11.30.pre2 → 0.11.30.pre3

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,23 +2,31 @@ require "mkmf"
2
2
  require "ruby_core_source"
3
3
 
4
4
  hdrs = proc {
5
- have_struct_member("rb_method_entry_t", "body", "method.h")
6
- have_header("vm_core.h") and have_header("iseq.h") and have_header("insns.inc") and
5
+ begin
6
+ have_struct_member("rb_method_entry_t", "called_id", "method.h") or
7
+ have_struct_member("rb_control_frame_t", "method_id", "method.h")
8
+ end and
9
+ begin
10
+ have_func("rb_method_entry", "method.h") or
11
+ have_func("rb_method_node", "node.h")
12
+ end and
13
+ have_header("vm_core.h") and have_header("iseq.h") and have_header("insns.inc") and
7
14
  have_header("insns_info.inc") and have_header("eval_intern.h")
15
+ if checking_for(checking_message("if rb_iseq_compile_with_option was added an argument filepath")) do
16
+ try_compile(<<SRC)
17
+ #include <ruby.h>
18
+ #include "vm_core.h"
19
+ extern VALUE rb_iseq_new_main(NODE *node, VALUE filename, VALUE filepath);
20
+ SRC
21
+ end
22
+ $defs << '-DRB_ISEQ_COMPILE_5ARGS'
23
+ end
8
24
  }
9
25
 
10
- if RUBY_VERSION == '1.9.1'
11
- $CFLAGS << ' -DRUBY_VERSION_1_9_1'
12
- end
13
-
14
- if RUBY_REVISION >= 26959 # rb_iseq_compile_with_option was added an argument filepath
15
- $CFLAGS << ' -DRB_ISEQ_COMPILE_6ARGS'
16
- end
17
-
18
26
  dir_config("ruby")
19
27
  name = "ruby_debug"
20
28
  if (ENV['rvm_ruby_string'])
21
- dest_dir = Config::CONFIG["rubyhdrdir"]
29
+ dest_dir = RbConfig::CONFIG["rubyhdrdir"]
22
30
  with_cppflags("-I" + dest_dir) {
23
31
  if hdrs.call
24
32
  create_makefile(name)
@@ -9,7 +9,7 @@
9
9
  #include <insns_info.inc>
10
10
  #include "ruby_debug.h"
11
11
 
12
- #define DEBUG_VERSION "0.11.30.pre2"
12
+ #define DEBUG_VERSION "0.11.30.pre3"
13
13
 
14
14
  #define FRAME_N(n) (&debug_context->frames[debug_context->stack_size-(n)-1])
15
15
  #define GET_FRAME (FRAME_N(check_frame_number(debug_context, frame)))
@@ -20,12 +20,12 @@
20
20
 
21
21
  #define STACK_SIZE_INCREMENT 128
22
22
 
23
- RUBY_EXTERN int rb_vm_get_sourceline(const rb_control_frame_t *cfp); /* from vm.c */
23
+ int rb_vm_get_sourceline(const rb_control_frame_t *cfp); /* from vm.c */
24
24
  /* from iseq.c */
25
- #ifdef RB_ISEQ_COMPILE_6ARGS
26
- RUBY_EXTERN VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
25
+ #ifdef RB_ISEQ_COMPILE_5ARGS
26
+ VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
27
27
  #else
28
- RUBY_EXTERN VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE line, VALUE opt);
28
+ VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE line, VALUE opt);
29
29
  #endif
30
30
 
31
31
  typedef struct {
@@ -137,7 +137,7 @@ real_class(VALUE klass)
137
137
  inline static void *
138
138
  ruby_method_ptr(VALUE class, ID meth_id)
139
139
  {
140
- #ifdef RUBY_VERSION_1_9_1
140
+ #ifndef HAVE_RB_METHOD_ENTRY
141
141
  NODE *body, *method;
142
142
  st_lookup(RCLASS_M_TBL(class), meth_id, (st_data_t *)&body);
143
143
  method = (NODE *)body->u2.value;
@@ -191,6 +191,20 @@ context_thread_0(debug_context_t *debug_context)
191
191
  return id2ref(debug_context->thread_id);
192
192
  }
193
193
 
194
+ static inline const rb_data_type_t *
195
+ threadptr_data_type(void)
196
+ {
197
+ static const rb_data_type_t *thread_data_type;
198
+ if (!thread_data_type) {
199
+ VALUE current_thread = rb_thread_current();
200
+ thread_data_type = RTYPEDDATA_TYPE(current_thread);
201
+ }
202
+ return thread_data_type;
203
+ }
204
+
205
+ #define ruby_threadptr_data_type *threadptr_data_type()
206
+ #define ruby_current_thread ((rb_thread_t *)RTYPEDDATA_DATA(rb_thread_current()))
207
+
194
208
  static int
195
209
  is_in_locked(VALUE thread_id)
196
210
  {
@@ -687,7 +701,7 @@ create_catch_table(debug_context_t *debug_context, unsigned long cont)
687
701
  GET_THREAD()->parse_in_eval++;
688
702
  GET_THREAD()->mild_compile_error++;
689
703
  /* compiling with option Qfalse (no options) prevents debug hook calls during this catch routine */
690
- #ifdef RB_ISEQ_COMPILE_6ARGS
704
+ #ifdef RB_ISEQ_COMPILE_5ARGS
691
705
  catch_table->iseq = rb_iseq_compile_with_option(
692
706
  rb_str_new_cstr("begin\nend"), rb_str_new_cstr("(exception catcher)"), Qnil, INT2FIX(1), Qfalse);
693
707
  #else
@@ -726,7 +740,7 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
726
740
  char *file = (char*)rb_sourcefile();
727
741
  int line = rb_sourceline();
728
742
  int moved = 0;
729
- #ifdef RUBY_VERSION_1_9_1
743
+ #ifndef HAVE_RB_METHOD_ENTRY
730
744
  NODE *node = NULL;
731
745
  #else
732
746
  rb_method_entry_t *me = NULL;
@@ -748,7 +762,7 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
748
762
 
749
763
  if (mid == ID_ALLOCATOR) return;
750
764
 
751
- #ifdef RUBY_VERSION_1_9_1
765
+ #ifndef HAVE_RB_METHOD_ENTRY
752
766
  node = rb_method_node(klass, mid);
753
767
  #else
754
768
  me = rb_method_entry(klass, mid);
@@ -861,6 +875,7 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
861
875
  {
862
876
  rb_control_frame_t *cfp = top_frame->info.runtime.cfp;
863
877
  VALUE hit_count;
878
+ int c_hit_count;
864
879
  rb_iseq_t *iseq = cfp->iseq;
865
880
 
866
881
  if (iseq != NULL) {
@@ -870,7 +885,7 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
870
885
  }
871
886
 
872
887
  /* send catchpoint notification */
873
- int c_hit_count = FIX2INT(rb_hash_aref(rdebug_catchpoints, debug_context->catch_table.mod_name)) + 1;
888
+ c_hit_count = FIX2INT(rb_hash_aref(rdebug_catchpoints, debug_context->catch_table.mod_name)) + 1;
874
889
  hit_count = INT2FIX(c_hit_count);
875
890
  rb_hash_aset(rdebug_catchpoints, debug_context->catch_table.mod_name, hit_count);
876
891
  debug_context->stop_reason = CTX_STOP_CATCHPOINT;
@@ -963,7 +978,7 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
963
978
  case RUBY_EVENT_C_RETURN:
964
979
  {
965
980
  /* note if a block is given we fall through! */
966
- #ifdef RUBY_VERSION_1_9_1
981
+ #ifndef HAVE_RB_METHOD_ENTRY
967
982
  if(!node || !c_call_new_frame_p(klass, mid))
968
983
  #else
969
984
  if(!me || !c_call_new_frame_p(klass, mid))
@@ -999,6 +1014,10 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
999
1014
  }
1000
1015
  case RUBY_EVENT_RAISE:
1001
1016
  {
1017
+ VALUE ancestors;
1018
+ VALUE expn_class, aclass;
1019
+ int i;
1020
+
1002
1021
  if (CTX_FL_TEST(debug_context, CTX_FL_CATCHING)) {
1003
1022
  /* we're re-raising exception after processing line event,
1004
1023
  now allow the next exception to be caught, don't setup catchers */
@@ -1006,10 +1025,6 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
1006
1025
  break;
1007
1026
  }
1008
1027
 
1009
- VALUE ancestors;
1010
- VALUE expn_class, aclass;
1011
- int i;
1012
-
1013
1028
  if(debug == Qtrue) {
1014
1029
  fprintf(stderr, "stack_size %d\n", debug_context->stack_size);
1015
1030
  for (i = 0; i < debug_context->stack_size; i++) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-debug-base19x
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.30.pre2
4
+ version: 0.11.30.pre3
5
5
  prerelease: 8
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-13 00:00:00.000000000Z
12
+ date: 2011-09-28 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: columnize
16
- requirement: &70261391956160 !ruby/object:Gem::Requirement
16
+ requirement: &70263133374820 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.3.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70261391956160
24
+ version_requirements: *70263133374820
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: ruby_core_source
27
- requirement: &70261391955680 !ruby/object:Gem::Requirement
27
+ requirement: &70263133374340 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.1.4
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70261391955680
35
+ version_requirements: *70263133374340
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: linecache19
38
- requirement: &70261391955200 !ruby/object:Gem::Requirement
38
+ requirement: &70263133373860 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.5.11
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70261391955200
46
+ version_requirements: *70263133373860
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &70261391971120 !ruby/object:Gem::Requirement
49
+ requirement: &70263133373400 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 0.8.1
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70261391971120
57
+ version_requirements: *70263133373400
58
58
  description: ! 'ruby-debug is a fast implementation of the standard Ruby debugger
59
59
  debug.rb.
60
60