byebug 8.0.1 → 8.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/ext/byebug/breakpoint.c +1 -1
- data/ext/byebug/byebug.c +82 -17
- data/ext/byebug/threads.c +1 -3
- data/lib/byebug/commands/frame.rb +2 -0
- data/lib/byebug/frame.rb +6 -3
- data/lib/byebug/helpers/eval.rb +1 -1
- data/lib/byebug/helpers/file.rb +1 -1
- data/lib/byebug/helpers/path.rb +24 -3
- data/lib/byebug/settings/histfile.rb +2 -2
- data/lib/byebug/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c94e35f817b35598528398f89bf25b1eb6be58cd
|
4
|
+
data.tar.gz: 835bd30d2e482817798f87c0ff6c96a1ee2ee44d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f51b7abcaf7771ef033323ab1bd37c0795c5445d18b0266d29110e61f1f2d433f894d221113c793375040c3832e16f6af3a4f0fea0a55cbdb3dba285cf3658fc
|
7
|
+
data.tar.gz: fc49688e24e43f16d091c27c6e642dc1943ae0d00db65431c50f18399049a6bd29b486eac934509360fba8e60a30bcd151bd03250d93a9da9b3583724a079f31
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## Master (Unreleased)
|
2
|
+
|
3
|
+
## 8.1.0 - 2015-11-09
|
4
|
+
### Fixed
|
5
|
+
* Command history should be specific per project.
|
6
|
+
* Better error message in certain edge cases when printing the backtrace.
|
7
|
+
* Bug in evaluator which would show information about having stopped at a
|
8
|
+
breakpoint in some cases.
|
9
|
+
|
10
|
+
### Added
|
11
|
+
* Ability to autolist source code after `frame` command.
|
12
|
+
* Ability to stop at lines where methods return.
|
13
|
+
|
1
14
|
## 8.0.1 - 2015-11-07
|
2
15
|
### Fixed
|
3
16
|
* Error stream wouldn't be properly reset when using standalone `byebug`.
|
data/ext/byebug/breakpoint.c
CHANGED
@@ -342,7 +342,7 @@ classname_cmp(VALUE name, VALUE klass)
|
|
342
342
|
return 0;
|
343
343
|
|
344
344
|
mod_name = rb_mod_name(klass);
|
345
|
-
return (mod_name
|
345
|
+
return (!NIL_P(mod_name) && rb_str_cmp(class_name, mod_name) == 0);
|
346
346
|
}
|
347
347
|
|
348
348
|
static int
|
data/ext/byebug/byebug.c
CHANGED
@@ -63,7 +63,7 @@ Raised_exception(VALUE self)
|
|
63
63
|
return raised_exception;
|
64
64
|
}
|
65
65
|
|
66
|
-
#define IS_STARTED
|
66
|
+
#define IS_STARTED (!NIL_P(catchpoints))
|
67
67
|
|
68
68
|
static void
|
69
69
|
check_started()
|
@@ -149,15 +149,15 @@ cleanup(debug_context_t * dc)
|
|
149
149
|
thread_context_lookup(rb_thread_current(), &context); \
|
150
150
|
Data_Get_Struct(context, debug_context_t, dc); \
|
151
151
|
\
|
152
|
+
trace_arg = rb_tracearg_from_tracepoint(trace_point); \
|
153
|
+
if (verbose == Qtrue) \
|
154
|
+
trace_print(trace_arg, dc, 0, 0); \
|
155
|
+
\
|
152
156
|
if (CTX_FL_TEST(dc, CTX_FL_IGNORE)) \
|
153
157
|
return; \
|
154
158
|
\
|
155
159
|
acquire_lock(dc); \
|
156
160
|
\
|
157
|
-
trace_arg = rb_tracearg_from_tracepoint(trace_point); \
|
158
|
-
if (verbose == Qtrue) \
|
159
|
-
trace_print(trace_arg, dc, 0, 0); \
|
160
|
-
|
161
161
|
|
162
162
|
#define CALL_EVENT_SETUP \
|
163
163
|
dc->calced_stack_size++; \
|
@@ -241,7 +241,7 @@ call_at_line_check(VALUE ctx, debug_context_t * dc, VALUE breakpoint)
|
|
241
241
|
{
|
242
242
|
dc->stop_reason = CTX_STOP_STEP;
|
243
243
|
|
244
|
-
if (breakpoint
|
244
|
+
if (!NIL_P(breakpoint))
|
245
245
|
call_at_breakpoint(ctx, dc, breakpoint);
|
246
246
|
|
247
247
|
reset_stepping_stop_points(dc);
|
@@ -279,14 +279,16 @@ line_event(VALUE trace_point, void *data)
|
|
279
279
|
|
280
280
|
if (dc->steps == 0 || dc->lines == 0)
|
281
281
|
call_at_line_check(context, dc, Qnil);
|
282
|
+
else
|
283
|
+
{
|
284
|
+
brkpnt = Qnil;
|
282
285
|
|
283
|
-
|
284
|
-
|
285
|
-
if (!NIL_P(breakpoints))
|
286
|
-
brkpnt = find_breakpoint_by_pos(breakpoints, file, line, binding);
|
286
|
+
if (!NIL_P(breakpoints))
|
287
|
+
brkpnt = find_breakpoint_by_pos(breakpoints, file, line, binding);
|
287
288
|
|
288
|
-
|
289
|
-
|
289
|
+
if (!NIL_P(brkpnt))
|
290
|
+
call_at_line_check(context, dc, brkpnt);
|
291
|
+
}
|
290
292
|
|
291
293
|
EVENT_TEARDOWN;
|
292
294
|
}
|
@@ -334,6 +336,8 @@ call_event(VALUE trace_point, void *data)
|
|
334
336
|
static void
|
335
337
|
return_event(VALUE trace_point, void *data)
|
336
338
|
{
|
339
|
+
VALUE brkpnt, file, line, binding;
|
340
|
+
|
337
341
|
EVENT_SETUP;
|
338
342
|
|
339
343
|
RETURN_EVENT_SETUP;
|
@@ -344,6 +348,36 @@ return_event(VALUE trace_point, void *data)
|
|
344
348
|
|
345
349
|
call_at_return(context, dc, rb_tracearg_return_value(trace_arg));
|
346
350
|
}
|
351
|
+
else if (!NIL_P(breakpoints))
|
352
|
+
{
|
353
|
+
file = rb_tracearg_path(trace_arg);
|
354
|
+
/*
|
355
|
+
* TODO: Sometimes the TracePoint API gives some return events without
|
356
|
+
* file:line information, so we need to guard for nil until we know what's
|
357
|
+
* going on. This happens, for example, with active_support core extensions:
|
358
|
+
*
|
359
|
+
* [#7] call@.../core_ext/numeric/conversions.rb:124 Fixnum#to_s
|
360
|
+
* [#7] b_call@.../core_ext/numeric/conversions.rb:124 BigDecimal#to_s
|
361
|
+
* [#7] line@.../core_ext/numeric/conversions.rb:125 BigDecimal#to_s
|
362
|
+
* [#7] c_call@.../core_ext/numeric/conversions.rb:125 Kernel#is_a?
|
363
|
+
* [#7] c_return@.../core_ext/numeric/conversions.rb:125 Kernel#is_a?
|
364
|
+
* [#7] line@.../core_ext/numeric/conversions.rb:131 BigDecimal#to_s
|
365
|
+
* [#7] c_call@.../core_ext/numeric/conversions.rb:131 Fixnum#to_default_s
|
366
|
+
* [#7] c_return@.../core_ext/numeric/conversions.rb:131 Fixnum#to_default_s
|
367
|
+
* [#7] b_return@/hort/core_ext/numeric/conversions.rb:133 BigDecimal#to_s
|
368
|
+
* [#7] return@:0 Fixnum#to_s # => This guy...
|
369
|
+
*/
|
370
|
+
if (!NIL_P(file))
|
371
|
+
{
|
372
|
+
line = rb_tracearg_lineno(trace_arg);
|
373
|
+
binding = rb_tracearg_binding(trace_arg);
|
374
|
+
|
375
|
+
brkpnt = find_breakpoint_by_pos(breakpoints, file, line, binding);
|
376
|
+
|
377
|
+
if (!NIL_P(brkpnt))
|
378
|
+
call_at_return(context, dc, rb_tracearg_return_value(trace_arg));
|
379
|
+
}
|
380
|
+
}
|
347
381
|
|
348
382
|
RETURN_EVENT_TEARDOWN;
|
349
383
|
|
@@ -411,7 +445,7 @@ raise_event(VALUE trace_point, void *data)
|
|
411
445
|
rb_debug_inspector_open(context_backtrace_set, (void *)new_dc);
|
412
446
|
}
|
413
447
|
|
414
|
-
if (catchpoints
|
448
|
+
if (NIL_P(catchpoints) || dc->calced_stack_size == 0
|
415
449
|
|| RHASH_TBL(catchpoints)->num_entries == 0)
|
416
450
|
{
|
417
451
|
EVENT_TEARDOWN;
|
@@ -429,7 +463,7 @@ raise_event(VALUE trace_point, void *data)
|
|
429
463
|
hit_count = rb_hash_aref(catchpoints, module_name);
|
430
464
|
|
431
465
|
/* increment exception */
|
432
|
-
if (hit_count
|
466
|
+
if (!NIL_P(hit_count))
|
433
467
|
{
|
434
468
|
rb_hash_aset(catchpoints, module_name, INT2FIX(FIX2INT(hit_count) + 1));
|
435
469
|
|
@@ -633,17 +667,17 @@ Stoppable(VALUE self)
|
|
633
667
|
if (!IS_STARTED)
|
634
668
|
return Qfalse;
|
635
669
|
|
636
|
-
if (breakpoints
|
670
|
+
if (!NIL_P(breakpoints) && rb_funcall(breakpoints, idEmpty, 0) == Qfalse)
|
637
671
|
return Qfalse;
|
638
672
|
|
639
|
-
if (catchpoints
|
673
|
+
if (!NIL_P(catchpoints) && rb_funcall(catchpoints, idEmpty, 0) == Qfalse)
|
640
674
|
return Qfalse;
|
641
675
|
|
642
676
|
if (post_mortem == Qtrue)
|
643
677
|
return Qfalse;
|
644
678
|
|
645
679
|
context = Current_context(self);
|
646
|
-
if (context
|
680
|
+
if (!NIL_P(context))
|
647
681
|
{
|
648
682
|
Data_Get_Struct(context, debug_context_t, dc);
|
649
683
|
|
@@ -745,6 +779,35 @@ Set_tracing(VALUE self, VALUE value)
|
|
745
779
|
return value;
|
746
780
|
}
|
747
781
|
|
782
|
+
/*
|
783
|
+
* call-seq:
|
784
|
+
* Byebug.verbose? -> bool
|
785
|
+
*
|
786
|
+
* Returns +true+ if global verbose flag for TracePoint API events is enabled.
|
787
|
+
*/
|
788
|
+
static VALUE
|
789
|
+
Verbose(VALUE self)
|
790
|
+
{
|
791
|
+
UNUSED(self);
|
792
|
+
|
793
|
+
return verbose;
|
794
|
+
}
|
795
|
+
|
796
|
+
/*
|
797
|
+
* call-seq:
|
798
|
+
* Byebug.verbose = bool
|
799
|
+
*
|
800
|
+
* Sets the global verbose flag for TracePoint API events is enabled.
|
801
|
+
*/
|
802
|
+
static VALUE
|
803
|
+
Set_verbose(VALUE self, VALUE value)
|
804
|
+
{
|
805
|
+
UNUSED(self);
|
806
|
+
|
807
|
+
verbose = RTEST(value) ? Qtrue : Qfalse;
|
808
|
+
return value;
|
809
|
+
}
|
810
|
+
|
748
811
|
/*
|
749
812
|
* call-seq:
|
750
813
|
* Byebug.post_mortem? -> bool
|
@@ -821,6 +884,8 @@ Init_byebug()
|
|
821
884
|
rb_define_module_function(mByebug, "thread_context", Thread_context, 1);
|
822
885
|
rb_define_module_function(mByebug, "tracing?", Tracing, 0);
|
823
886
|
rb_define_module_function(mByebug, "tracing=", Set_tracing, 1);
|
887
|
+
rb_define_module_function(mByebug, "verbose?", Verbose, 0);
|
888
|
+
rb_define_module_function(mByebug, "verbose=", Set_verbose, 1);
|
824
889
|
|
825
890
|
Init_threads_table(mByebug);
|
826
891
|
Init_context(mByebug);
|
data/ext/byebug/threads.c
CHANGED
data/lib/byebug/frame.rb
CHANGED
@@ -161,10 +161,13 @@ module Byebug
|
|
161
161
|
end
|
162
162
|
|
163
163
|
def ruby_args
|
164
|
-
|
165
|
-
return [] unless
|
164
|
+
meth_name = _binding.eval('__method__')
|
165
|
+
return [] unless meth_name
|
166
166
|
|
167
|
-
|
167
|
+
meth_obj = _self.method(meth_name)
|
168
|
+
return [] unless meth_obj
|
169
|
+
|
170
|
+
meth_obj.parameters
|
168
171
|
end
|
169
172
|
|
170
173
|
def use_short_style?(arg)
|
data/lib/byebug/helpers/eval.rb
CHANGED
data/lib/byebug/helpers/file.rb
CHANGED
data/lib/byebug/helpers/path.rb
CHANGED
@@ -8,13 +8,34 @@ module Byebug
|
|
8
8
|
@bin_file ||= Gem.bin_path('byebug', 'byebug')
|
9
9
|
end
|
10
10
|
|
11
|
+
def root_path
|
12
|
+
@root_path ||= File.expand_path('../..', bin_file)
|
13
|
+
end
|
14
|
+
|
11
15
|
def lib_files
|
12
|
-
@lib_files ||=
|
16
|
+
@lib_files ||= expand_from_root('lib/**/*.{rb,yml}')
|
17
|
+
end
|
18
|
+
|
19
|
+
def ext_files
|
20
|
+
@ext_files ||= expand_from_root('ext/**/*.{c,h,rb}')
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_files
|
24
|
+
@test_files ||= expand_from_root('test/**/*.rb')
|
25
|
+
end
|
26
|
+
|
27
|
+
def gem_files
|
28
|
+
@gem_files ||= [bin_file] + lib_files + ext_files
|
13
29
|
end
|
14
30
|
|
15
31
|
def all_files
|
16
|
-
@all_files ||=
|
17
|
-
|
32
|
+
@all_files ||= gem_files + test_files
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def expand_from_root(glob)
|
38
|
+
Dir.glob(File.expand_path(glob, root_path))
|
18
39
|
end
|
19
40
|
end
|
20
41
|
end
|
@@ -5,10 +5,10 @@ module Byebug
|
|
5
5
|
# Setting to customize the file where byebug's history is saved.
|
6
6
|
#
|
7
7
|
class HistfileSetting < Setting
|
8
|
-
DEFAULT = File.expand_path(
|
8
|
+
DEFAULT = File.expand_path('.byebug_history')
|
9
9
|
|
10
10
|
def banner
|
11
|
-
'File where cmd history is saved to. Default:
|
11
|
+
'File where cmd history is saved to. Default: ./.byebug_history'
|
12
12
|
end
|
13
13
|
|
14
14
|
def to_s
|
data/lib/byebug/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: byebug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.0
|
4
|
+
version: 8.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rodriguez
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-11-
|
13
|
+
date: 2015-11-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
188
|
version: '0'
|
189
189
|
requirements: []
|
190
190
|
rubyforge_project:
|
191
|
-
rubygems_version: 2.5.
|
191
|
+
rubygems_version: 2.4.5.1
|
192
192
|
signing_key:
|
193
193
|
specification_version: 4
|
194
194
|
summary: Ruby 2.0 fast debugger - base + CLI
|