ruby-debug-base19x 0.11.30.pre4 → 0.11.30.pre5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/ext/ruby_debug/ruby_debug.c +50 -2
  2. metadata +10 -10
@@ -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.pre4"
12
+ #define DEBUG_VERSION "0.11.30.pre5"
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)))
@@ -36,6 +36,7 @@ static VALUE tracing = Qfalse;
36
36
  static VALUE locker = Qnil;
37
37
  static VALUE post_mortem = Qfalse;
38
38
  static VALUE keep_frame_binding = Qfalse;
39
+ static VALUE resolve_symlinks = Qtrue;
39
40
  static VALUE debug = Qfalse;
40
41
  static VALUE track_frame_args = Qfalse;
41
42
 
@@ -509,6 +510,17 @@ save_call_frame(rb_event_flag_t _event, debug_context_t *debug_context, VALUE se
509
510
  copy_scalar_args(debug_frame);
510
511
  }
511
512
 
513
+ char*
514
+ resolve_symlink(char *file) {
515
+ char *result;
516
+ #ifdef PATH_MAX
517
+ result = (char*)malloc(PATH_MAX);
518
+ #else
519
+ result = NULL;
520
+ #endif
521
+ return realpath(file, result);
522
+ }
523
+
512
524
 
513
525
  #if defined DOSISH
514
526
  #define isdirsep(x) ((x) == '/' || (x) == '\\')
@@ -517,7 +529,14 @@ save_call_frame(rb_event_flag_t _event, debug_context_t *debug_context, VALUE se
517
529
  #endif
518
530
 
519
531
  int
520
- filename_cmp(VALUE source, char *file)
532
+ filename_cmp(VALUE source, char *file) {
533
+ char* path;
534
+ path = RTEST(resolve_symlinks) ? resolve_symlink(file) : file;
535
+ return filename_cmp_impl(source, path);
536
+ }
537
+
538
+ int
539
+ filename_cmp_impl(VALUE source, char *file)
521
540
  {
522
541
  char *source_ptr, *file_ptr;
523
542
  long s_len, f_len, min_len;
@@ -1460,6 +1479,31 @@ debug_set_keep_frame_binding(VALUE self, VALUE value)
1460
1479
  return value;
1461
1480
  }
1462
1481
 
1482
+ /*
1483
+ * call-seq:
1484
+ * Debugger.resolve_symlinks? -> bool
1485
+ *
1486
+ * Returns +true+ if the debugger will resolve symlinks when checking breakpoint.
1487
+ */
1488
+ static VALUE
1489
+ debug_resolve_symlinks(VALUE self)
1490
+ {
1491
+ return resolve_symlinks;
1492
+ }
1493
+
1494
+ /*
1495
+ * call-seq:
1496
+ * Debugger.resolve_symlinks = bool
1497
+ *
1498
+ * Setting to +true+ will make the debugger resolve symlinks when checking breakpoint.
1499
+ */
1500
+ static VALUE
1501
+ debug_set_resolve_symlinks(VALUE self, VALUE value)
1502
+ {
1503
+ resolve_symlinks = RTEST(value) ? Qtrue : Qfalse;
1504
+ return value;
1505
+ }
1506
+
1463
1507
  /* :nodoc: */
1464
1508
  static VALUE
1465
1509
  debug_debug(VALUE self)
@@ -2604,6 +2648,10 @@ Init_ruby_debug()
2604
2648
  debug_keep_frame_binding, 0);
2605
2649
  rb_define_module_function(mDebugger, "keep_frame_binding=",
2606
2650
  debug_set_keep_frame_binding, 1);
2651
+ rb_define_module_function(mDebugger, "resolve_symlinks?",
2652
+ debug_resolve_symlinks, 0);
2653
+ rb_define_module_function(mDebugger, "resolve_symlinks=",
2654
+ debug_set_resolve_symlinks, 1);
2607
2655
  rb_define_module_function(mDebugger, "track_frame_args?",
2608
2656
  debug_track_frame_args, 0);
2609
2657
  rb_define_module_function(mDebugger, "track_frame_args=",
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.pre4
4
+ version: 0.11.30.pre5
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-11-14 00:00:00.000000000Z
12
+ date: 2012-01-13 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: columnize
16
- requirement: &70102561752300 !ruby/object:Gem::Requirement
16
+ requirement: &70326957146380 !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: *70102561752300
24
+ version_requirements: *70326957146380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: ruby_core_source
27
- requirement: &70102561751820 !ruby/object:Gem::Requirement
27
+ requirement: &70326957145900 !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: *70102561751820
35
+ version_requirements: *70326957145900
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: linecache19
38
- requirement: &70102561751340 !ruby/object:Gem::Requirement
38
+ requirement: &70326957145420 !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: *70102561751340
46
+ version_requirements: *70326957145420
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &70102561767260 !ruby/object:Gem::Requirement
49
+ requirement: &70326957144960 !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: *70102561767260
57
+ version_requirements: *70326957144960
58
58
  description: ! 'ruby-debug is a fast implementation of the standard Ruby debugger
59
59
  debug.rb.
60
60