byebug 1.3.0 → 1.3.1
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/CHANGELOG.md +8 -0
- data/GUIDE.md +209 -0
- data/README.md +11 -2
- data/Rakefile +12 -0
- data/ext/byebug/byebug.c +50 -53
- data/ext/byebug/context.c +0 -24
- data/lib/byebug.rb +23 -7
- data/lib/byebug/command.rb +35 -24
- data/lib/byebug/commands/breakpoints.rb +24 -35
- data/lib/byebug/commands/catchpoint.rb +13 -17
- data/lib/byebug/commands/condition.rb +14 -19
- data/lib/byebug/commands/continue.rb +5 -7
- data/lib/byebug/commands/display.rb +3 -3
- data/lib/byebug/commands/edit.rb +1 -1
- data/lib/byebug/commands/enable.rb +18 -45
- data/lib/byebug/commands/eval.rb +1 -1
- data/lib/byebug/commands/finish.rb +1 -1
- data/lib/byebug/commands/frame.rb +24 -22
- data/lib/byebug/commands/info.rb +91 -122
- data/lib/byebug/commands/jump.rb +3 -8
- data/lib/byebug/commands/list.rb +2 -2
- data/lib/byebug/commands/method.rb +6 -8
- data/lib/byebug/commands/save.rb +1 -1
- data/lib/byebug/commands/set.rb +0 -12
- data/lib/byebug/commands/show.rb +9 -21
- data/lib/byebug/commands/variables.rb +3 -3
- data/lib/byebug/context.rb +13 -2
- data/lib/byebug/interface.rb +13 -7
- data/lib/byebug/processor.rb +23 -25
- data/lib/byebug/version.rb +1 -1
- data/old_doc/primes.rb +1 -4
- data/test/continue_test.rb +2 -9
- data/test/examples/list.rb +1 -1
- data/test/examples/trace.rb +1 -0
- data/test/help_test.rb +1 -1
- data/test/info_test.rb +3 -3
- data/test/list_test.rb +7 -1
- data/test/method_test.rb +0 -1
- data/test/show_test.rb +8 -0
- data/test/support/matchers.rb +4 -2
- data/test/trace_test.rb +18 -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: 497f9606e8de41c51c02441cdbda3092f7131ec3
|
4
|
+
data.tar.gz: 12a94e7916cc107fb392af1a7abc0cd8515ce696
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ffdf9b6cf8fc471af1b57efacabaa9e3159c115e59d718417792e6a70a7686070a7537a1d2c10da741988fb1416bf61cb95d71420718f89219d434d3c318b7f
|
7
|
+
data.tar.gz: f1ddc5b71c708a81de661402d52a2b758913cdd09d2b4827cf850643467ef857b50dc64fa0f98ed3ba774de0dc34f1dc6b69c6d3b68d4226f3a5ac835fb8ef7d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## 1.3.1
|
2
|
+
|
3
|
+
* Byebug now works with Rails debugging flag
|
4
|
+
* Fix bug which would make byebug crash when trying to print lines of code
|
5
|
+
containing the character '%'
|
6
|
+
* Fix bug which prevented basename and linetrace options from working together
|
7
|
+
|
8
|
+
|
1
9
|
## 1.3.0
|
2
10
|
|
3
11
|
* Support colon-delimited include paths in command-line front-end (@ender672)
|
data/GUIDE.md
CHANGED
@@ -435,3 +435,212 @@ Much better. But again let me emphasize that the parameter types are those of
|
|
435
435
|
the corresponding variables that _currently_ exist, and this might have changed
|
436
436
|
since the time when the call was made.
|
437
437
|
|
438
|
+
|
439
|
+
## Byebug.start with a block
|
440
|
+
|
441
|
+
We saw that `Byebug.start()` and `Byebug.stop()` allow fine-grain control over
|
442
|
+
where byebug tracking should occur.
|
443
|
+
|
444
|
+
Rather than use an explicit `stop()`, you can also pass a block to the `start()`
|
445
|
+
method. This causes `start()` to run and then `yield` to that block. When the
|
446
|
+
block is finished, `stop()` is run. In other words, this wraps a
|
447
|
+
`Byebug.start()` and `Byebug.stop()` around the block of code. But it also has a
|
448
|
+
side benefit of ensuring that in the presence of an uncaught exception `stop` is
|
449
|
+
run, without having to explicitly use `begin ... ensure Byebug.stop() end`.
|
450
|
+
|
451
|
+
For example, in Ruby on Rails you might want to debug code in one of the
|
452
|
+
controllers without causing any slowdown to any other code. And this can be done
|
453
|
+
by wrapping the controller in a `start()` with a block; when the method wrapped
|
454
|
+
this way finishes, byebug is turned off and the application proceeds at regular
|
455
|
+
speed.
|
456
|
+
|
457
|
+
Of course, inside the block you will probably want to enter the byebug using
|
458
|
+
`Byebug.byebug()`, otherwise there would be little point in using the `start`.
|
459
|
+
For example, you can do this in `irb`:
|
460
|
+
|
461
|
+
```
|
462
|
+
$ irb
|
463
|
+
2.0.0p195 :001 > require 'byebug'
|
464
|
+
=> true
|
465
|
+
2.0.0p195 :002 > def foo
|
466
|
+
2.0.0p195 :003?> x=1
|
467
|
+
2.0.0p195 :004?> puts 'foo'
|
468
|
+
2.0.0p195 :005?> end
|
469
|
+
=> nil
|
470
|
+
2.0.0p195 :006 > Byebug.start{byebug; foo}
|
471
|
+
(irb) @ 6
|
472
|
+
(byebug) s
|
473
|
+
(irb) @ 3
|
474
|
+
(byebug) s
|
475
|
+
(irb) @ 4
|
476
|
+
(byebug) p x
|
477
|
+
1
|
478
|
+
(byebug) s
|
479
|
+
foo
|
480
|
+
=> true
|
481
|
+
2.0.0p195 :007 >
|
482
|
+
```
|
483
|
+
|
484
|
+
There is a counter inside of `Byebug.start` method to make sure that this works
|
485
|
+
when another `Byebug.start` method is called inside of the outer one. However,
|
486
|
+
if you are stopped inside byebug, issuing another `byebug` call will not have
|
487
|
+
any effect even if it is nested inside another `Byebug.start`.
|
488
|
+
|
489
|
+
## Debugging Oddities: How debugging Ruby may be different from debugging other
|
490
|
+
languages
|
491
|
+
|
492
|
+
If you are used to debugging in other languages like C, C++, Perl, Java or even
|
493
|
+
Bash (see [bashdb](http://bashdb.sf.net)), there may be a number of things that
|
494
|
+
seem or feel a little bit different and may confuse you. A number of these
|
495
|
+
things aren't oddities of the debugger per se but differences in how Ruby works
|
496
|
+
compared to those other languages. Because Ruby works a little differently from
|
497
|
+
those other languages, writing a debugger has to also be a little different as
|
498
|
+
well if it is to be useful. In this respect, using byebug may help you
|
499
|
+
understand Ruby better.
|
500
|
+
|
501
|
+
We've already seen two examples of such differences. One difference is the fact
|
502
|
+
that we stop on method definitions or `def`'s and that is because these are in
|
503
|
+
fact executable statements. In other compiled languages this would not happen
|
504
|
+
because that's already been done when you compile the program (or in Perl when
|
505
|
+
it scans in the program). The other difference we saw was our inability to show
|
506
|
+
call stack parameter types without having made arrangements for byebug to track
|
507
|
+
this. In other languages call stack information is usually available without
|
508
|
+
asking assistance of the debugger (in C and C++, however, you generally have to
|
509
|
+
ask the compiler to add such information.).
|
510
|
+
|
511
|
+
In this section we'll consider some other things that might throw off new users
|
512
|
+
to Ruby who are familiar with other languages and debugging in them.
|
513
|
+
|
514
|
+
* Bouncing Around in Blocks (iterators)
|
515
|
+
* No Parameter Values in a Call Stack
|
516
|
+
* Lines You Can Stop At
|
517
|
+
|
518
|
+
## Bouncing Around in Blocks (iterators)
|
519
|
+
|
520
|
+
When debugging languages with coroutines like Python and Ruby, a method call may
|
521
|
+
not necessarily go to the first statement after the method header. It's possible
|
522
|
+
that the call will continue after a `yield` statement from a prior call.
|
523
|
+
|
524
|
+
```ruby
|
525
|
+
|
526
|
+
# Enumerator for primes
|
527
|
+
class SievePrime
|
528
|
+
@@odd_primes = []
|
529
|
+
def self.next_prime(&block)
|
530
|
+
candidate = 2
|
531
|
+
yield candidate
|
532
|
+
not_prime = false
|
533
|
+
candidate += 1
|
534
|
+
while true do
|
535
|
+
@@odd_primes.each do |p|
|
536
|
+
not_prime = (0 == (candidate % p))
|
537
|
+
break if not_prime
|
538
|
+
end
|
539
|
+
unless not_prime
|
540
|
+
@@odd_primes << candidate
|
541
|
+
yield candidate
|
542
|
+
end
|
543
|
+
candidate += 2
|
544
|
+
end
|
545
|
+
end
|
546
|
+
end
|
547
|
+
SievePrime.next_prime do |prime|
|
548
|
+
puts prime
|
549
|
+
break if prime > 10
|
550
|
+
end
|
551
|
+
```
|
552
|
+
|
553
|
+
```
|
554
|
+
$ byebug primes.rb
|
555
|
+
[1, 10] in /home/davidr/Proyectos/byebug/old_doc/primes.rb
|
556
|
+
1: # Enumerator for primes
|
557
|
+
=> 2: class SievePrime
|
558
|
+
3: @@odd_primes = []
|
559
|
+
4: def self.next_prime(&block)
|
560
|
+
5: candidate = 2
|
561
|
+
6: yield candidate
|
562
|
+
7: not_prime = false
|
563
|
+
8: candidate += 1
|
564
|
+
9: while true do
|
565
|
+
10: @@odd_primes.each do |p|
|
566
|
+
(byebug) set linetrace
|
567
|
+
line tracing is on.
|
568
|
+
(byebug) set basename
|
569
|
+
basename in on.
|
570
|
+
(byebug) step 9
|
571
|
+
Tracing: primes.rb:3 @@odd_primes = []
|
572
|
+
Tracing: primes.rb:4 def self.next_prime(&block)
|
573
|
+
Tracing: primes.rb:22 SievePrime.next_prime do |prime|
|
574
|
+
Tracing: primes.rb:5 candidate = 2
|
575
|
+
Tracing: primes.rb:6 yield candidate
|
576
|
+
Tracing: primes.rb:23 puts prime
|
577
|
+
2
|
578
|
+
Tracing: primes.rb:24 break if prime > 10
|
579
|
+
Tracing: primes.rb:7 not_prime = false
|
580
|
+
Tracing: primes.rb:8 candidate += 1
|
581
|
+
[3, 12] in /home/davidr/Proyectos/byebug/old_doc/primes.rb
|
582
|
+
3: @@odd_primes = []
|
583
|
+
4: def self.next_prime(&block)
|
584
|
+
5: candidate = 2
|
585
|
+
6: yield candidate
|
586
|
+
7: not_prime = false
|
587
|
+
=> 8: candidate += 1
|
588
|
+
9: while true do
|
589
|
+
10: @@odd_primes.each do |p|
|
590
|
+
11: not_prime = (0 == (candidate % p))
|
591
|
+
12: break if not_prime
|
592
|
+
(byebug)
|
593
|
+
```
|
594
|
+
|
595
|
+
The loop between lines 23-26 gets interleaved between those of
|
596
|
+
`Sieve::next_prime`, lines 6-19 above.
|
597
|
+
|
598
|
+
|
599
|
+
### No Parameter Values in a Call Stack
|
600
|
+
|
601
|
+
In traditional debuggers, in a call stack you can generally see the names of the
|
602
|
+
parameters and the values that were passed in.
|
603
|
+
|
604
|
+
Ruby is a very dynamic language and it tries to be efficient within the confines
|
605
|
+
of the language definition. Values generally aren't taken out of a variable or
|
606
|
+
expression and pushed onto a stack. Instead a new scope is created and the
|
607
|
+
parameters are given initial values. Parameter passing is by _reference_ not by
|
608
|
+
_value_ as it is say Algol, C, or Perl. During the execution of a method,
|
609
|
+
parameter values can change (and often do). In fact even the _class_ of the
|
610
|
+
object can change.
|
611
|
+
|
612
|
+
So at present, the name of the parameter is shown. The call-style setting
|
613
|
+
([callstyle]()) can be used to set whether the name is shown or the name and the
|
614
|
+
_current_ class of the object. It has been contemplated that a style might be
|
615
|
+
added which saves on call shorter "scalar" types of values and the class name.
|
616
|
+
|
617
|
+
|
618
|
+
### Lines You Can Stop At
|
619
|
+
|
620
|
+
As with the duplicate stops per control (e.g. `if` statement), until tools like
|
621
|
+
debuggers get more traction among core ruby developers there are going to be
|
622
|
+
weirdness. Here we describe the stopping locations which effects the breakpoint
|
623
|
+
line numbers you can stop at.
|
624
|
+
|
625
|
+
Consider the following little Ruby program.
|
626
|
+
|
627
|
+
```ruby
|
628
|
+
'Yes it does' =~ /
|
629
|
+
(Yes) \s+
|
630
|
+
it \s+
|
631
|
+
does
|
632
|
+
/ix
|
633
|
+
puts $1
|
634
|
+
```
|
635
|
+
|
636
|
+
The stopping points that Ruby records are the last two lines, lines 5 and 6.
|
637
|
+
|
638
|
+
Inside `byebug` you can get a list of stoppable lines for a file using the `info
|
639
|
+
file` command with the attribute `breakpoints`.
|
640
|
+
|
641
|
+
To be continued...
|
642
|
+
* more complex example with objects, pretty printing and irb.
|
643
|
+
* line tracing and non-interactive tracing.
|
644
|
+
* mixing in Byebug.debug with byebug
|
645
|
+
* post-mortem debugging and setting up for that
|
646
|
+
* references to videos
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
# Byebug [![Gem Version]
|
1
|
+
# Byebug [![Gem Version][1]][2] [![Build Status][3]][4] [![Code Climate][5]][6] [![Dependency Status][7]][8]
|
2
2
|
|
3
3
|
<img src="https://raw.github.com/deivid-rodriguez/byebug/master/logo.png"
|
4
|
-
alt="Byebug logo" align="right" />
|
4
|
+
alt="Byebug logo" align="right" style="margin-left: 10px" />
|
5
5
|
|
6
6
|
_Debugging in Ruby 2.0_
|
7
7
|
|
@@ -254,3 +254,12 @@ software, specially:
|
|
254
254
|
* Dennis Ushakov, author of [debase](https://github.com/denofevil/debase), the
|
255
255
|
starting point of this.
|
256
256
|
* Logo by [Ivlichev Victor Petrovich](http://www.aha-soft.com/)
|
257
|
+
|
258
|
+
[1]: https://badge.fury.io/rb/byebug.png
|
259
|
+
[2]: http://badge.fury.io/rb/byebug
|
260
|
+
[3]: https://secure.travis-ci.org/deivid-rodriguez/byebug.png
|
261
|
+
[4]: http://travis-ci.org/deivid-rodriguez/byebug
|
262
|
+
[5]: https://codeclimate.com/github/deivid-rodriguez/byebug.png
|
263
|
+
[6]: https://codeclimate.com/github/deivid-rodriguez/byebug
|
264
|
+
[7]: https://gemnasium.com/deivid-rodriguez/byebug.png
|
265
|
+
[8]: https://gemnasium.com/deivid-rodriguez/byebug
|
data/Rakefile
CHANGED
@@ -17,3 +17,15 @@ end
|
|
17
17
|
base_spec = eval(File.read('byebug.gemspec'), binding, 'byebug.gemspec')
|
18
18
|
|
19
19
|
task :default => :test
|
20
|
+
|
21
|
+
desc 'Run a test in looped mode so that you can look for memory leaks'
|
22
|
+
task 'test_loop' do
|
23
|
+
code = %Q[loop{ require '#{$*[1]}' }]
|
24
|
+
cmd = %Q[ruby -Itest -e "#{ code }"]
|
25
|
+
system cmd
|
26
|
+
end
|
27
|
+
|
28
|
+
desc 'Watch memory use of a looping test'
|
29
|
+
task 'test_loop_mem' do
|
30
|
+
system "watch \"ps aux | grep -v 'sh -c r' | grep [I]test\""
|
31
|
+
end
|
data/ext/byebug/byebug.c
CHANGED
@@ -95,22 +95,22 @@ load_frame_info(VALUE trace_point, VALUE *path, VALUE *lineno, VALUE *method_id,
|
|
95
95
|
}
|
96
96
|
|
97
97
|
static void
|
98
|
-
call_at_line(debug_context_t *context,
|
99
|
-
|
98
|
+
call_at_line(debug_context_t *context, VALUE context_obj,
|
99
|
+
VALUE path, VALUE lineno)
|
100
100
|
{
|
101
101
|
CTX_FL_UNSET(context, CTX_FL_ENABLE_BKPT);
|
102
102
|
CTX_FL_UNSET(context, CTX_FL_FORCE_MOVE);
|
103
|
-
context->last_file =
|
104
|
-
context->last_line =
|
105
|
-
rb_funcall(
|
103
|
+
context->last_file = RSTRING_PTR(path);
|
104
|
+
context->last_line = FIX2INT(lineno);
|
105
|
+
rb_funcall(context_obj, rb_intern("at_line"), 2, path, lineno);
|
106
106
|
}
|
107
107
|
|
108
108
|
#define EVENT_SETUP \
|
109
109
|
VALUE path, lineno, method_id, defined_class, binding, self; \
|
110
|
-
VALUE
|
110
|
+
VALUE context_obj; \
|
111
111
|
debug_context_t *context; \
|
112
|
-
|
113
|
-
Data_Get_Struct(
|
112
|
+
context_obj = Byebug_context(mByebug); \
|
113
|
+
Data_Get_Struct(context_obj, debug_context_t, context); \
|
114
114
|
if (!check_start_processing(context)) return; \
|
115
115
|
load_frame_info(trace_point, &path, &lineno, &method_id, &defined_class, \
|
116
116
|
&binding, &self); \
|
@@ -140,7 +140,7 @@ process_line_event(VALUE trace_point, void *data)
|
|
140
140
|
}
|
141
141
|
|
142
142
|
if (RTEST(tracing))
|
143
|
-
rb_funcall(
|
143
|
+
rb_funcall(context_obj, rb_intern("at_tracing"), 2, path, lineno);
|
144
144
|
|
145
145
|
if (context->dest_frame == -1 || context->stack_size == context->dest_frame)
|
146
146
|
{
|
@@ -159,18 +159,17 @@ process_line_event(VALUE trace_point, void *data)
|
|
159
159
|
{
|
160
160
|
context->stop_reason = CTX_STOP_STEP;
|
161
161
|
reset_stepping_stop_points(context);
|
162
|
-
call_at_line(
|
163
|
-
context, RSTRING_PTR(path), FIX2INT(lineno), context_object, path, lineno);
|
162
|
+
call_at_line(context, context_obj, path, lineno);
|
164
163
|
}
|
165
164
|
else if (CTX_FL_TEST(context, CTX_FL_ENABLE_BKPT))
|
166
165
|
{
|
167
166
|
breakpoint = find_breakpoint_by_pos(breakpoints, path, lineno, binding);
|
168
|
-
if (breakpoint != Qnil)
|
167
|
+
if (breakpoint != Qnil)
|
168
|
+
{
|
169
169
|
context->stop_reason = CTX_STOP_BREAKPOINT;
|
170
170
|
reset_stepping_stop_points(context);
|
171
|
-
rb_funcall(
|
172
|
-
call_at_line(context,
|
173
|
-
path, lineno);
|
171
|
+
rb_funcall(context_obj, rb_intern("at_breakpoint"), 1, breakpoint);
|
172
|
+
call_at_line(context, context_obj, path, lineno);
|
174
173
|
}
|
175
174
|
}
|
176
175
|
|
@@ -224,11 +223,11 @@ process_call_event(VALUE trace_point, void *data)
|
|
224
223
|
breakpoint = find_breakpoint_by_method(breakpoints, defined_class,
|
225
224
|
SYM2ID(method_id),
|
226
225
|
binding, self);
|
227
|
-
if (breakpoint != Qnil)
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
226
|
+
if (breakpoint != Qnil)
|
227
|
+
{
|
228
|
+
context->stop_reason = CTX_STOP_BREAKPOINT;
|
229
|
+
rb_funcall(context_obj, rb_intern("at_breakpoint"), 1, breakpoint);
|
230
|
+
call_at_line(context, context_obj, path, lineno);
|
232
231
|
}
|
233
232
|
|
234
233
|
cleanup(context);
|
@@ -277,9 +276,8 @@ process_raise_event(VALUE trace_point, void *data)
|
|
277
276
|
/* increment exception */
|
278
277
|
rb_hash_aset(catchpoints, mod_name, INT2FIX(FIX2INT(hit_count) + 1));
|
279
278
|
context->stop_reason = CTX_STOP_CATCHPOINT;
|
280
|
-
rb_funcall(
|
281
|
-
call_at_line(context,
|
282
|
-
path, lineno);
|
279
|
+
rb_funcall(context_obj, rb_intern("at_catchpoint"), 1, rb_errinfo());
|
280
|
+
call_at_line(context, context_obj, path, lineno);
|
283
281
|
break;
|
284
282
|
}
|
285
283
|
}
|
@@ -403,11 +401,11 @@ Byebug_start(VALUE self)
|
|
403
401
|
static VALUE
|
404
402
|
set_current_skipped_status(VALUE status)
|
405
403
|
{
|
406
|
-
VALUE
|
404
|
+
VALUE context_obj;
|
407
405
|
debug_context_t *context;
|
408
406
|
|
409
|
-
|
410
|
-
Data_Get_Struct(
|
407
|
+
context_obj = Byebug_context(mByebug);
|
408
|
+
Data_Get_Struct(context_obj, debug_context_t, context);
|
411
409
|
if (status)
|
412
410
|
CTX_FL_SET(context, CTX_FL_SKIPPED);
|
413
411
|
else
|
@@ -418,39 +416,38 @@ set_current_skipped_status(VALUE status)
|
|
418
416
|
static VALUE
|
419
417
|
Byebug_load(int argc, VALUE *argv, VALUE self)
|
420
418
|
{
|
421
|
-
|
422
|
-
|
423
|
-
|
419
|
+
VALUE file, stop, context_obj;
|
420
|
+
debug_context_t *context;
|
421
|
+
int state = 0;
|
424
422
|
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
423
|
+
if (rb_scan_args(argc, argv, "11", &file, &stop) == 1)
|
424
|
+
{
|
425
|
+
stop = Qfalse;
|
426
|
+
}
|
429
427
|
|
430
|
-
|
428
|
+
Byebug_start(self);
|
431
429
|
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
430
|
+
context_obj = Byebug_context(self);
|
431
|
+
Data_Get_Struct(context_obj, debug_context_t, context);
|
432
|
+
context->stack_size = 0;
|
433
|
+
if (RTEST(stop)) context->steps = 1;
|
436
434
|
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
}
|
435
|
+
/* Initializing $0 to the script's path */
|
436
|
+
ruby_script(RSTRING_PTR(file));
|
437
|
+
rb_load_protect(file, 0, &state);
|
438
|
+
if (0 != state)
|
439
|
+
{
|
440
|
+
VALUE errinfo = rb_errinfo();
|
441
|
+
reset_stepping_stop_points(context);
|
442
|
+
rb_set_errinfo(Qnil);
|
443
|
+
return errinfo;
|
444
|
+
}
|
448
445
|
|
449
|
-
|
450
|
-
|
451
|
-
|
446
|
+
/* We should run all at_exit handler's in order to provide, for instance, a
|
447
|
+
* chance to run all defined test cases */
|
448
|
+
rb_exec_end_proc();
|
452
449
|
|
453
|
-
|
450
|
+
return Qnil;
|
454
451
|
}
|
455
452
|
|
456
453
|
static VALUE
|
data/ext/byebug/context.c
CHANGED
@@ -247,28 +247,6 @@ Context_frame_class(int argc, VALUE *argv, VALUE self)
|
|
247
247
|
return frame->defined_class;
|
248
248
|
}
|
249
249
|
|
250
|
-
static VALUE
|
251
|
-
Context_frame_locals(int argc, VALUE *argv, VALUE self)
|
252
|
-
{
|
253
|
-
VALUE binding = Context_frame_binding(argc, argv, self);
|
254
|
-
const char src[] =
|
255
|
-
"local_variables.inject({}){|h, v| h[v] = eval(\"#{v}\"); h}";
|
256
|
-
return NIL_P(binding) ?
|
257
|
-
rb_hash_new() :
|
258
|
-
rb_funcall(binding, rb_intern("eval"), 1, rb_str_new2(src));
|
259
|
-
}
|
260
|
-
|
261
|
-
static VALUE
|
262
|
-
Context_frame_args_info(int argc, VALUE *argv, VALUE self)
|
263
|
-
{
|
264
|
-
VALUE binding = Context_frame_binding(argc, argv, self);
|
265
|
-
const char src[] = "method(__method__).parameters";
|
266
|
-
|
267
|
-
return NIL_P(binding) ?
|
268
|
-
rb_ary_new() :
|
269
|
-
rb_funcall(binding, rb_intern("eval"), 1, rb_str_new2(src));
|
270
|
-
}
|
271
|
-
|
272
250
|
static VALUE
|
273
251
|
Context_tracing(VALUE self)
|
274
252
|
{
|
@@ -427,8 +405,6 @@ Init_context(VALUE mByebug)
|
|
427
405
|
rb_define_method(cContext, "frame_binding", Context_frame_binding, -1);
|
428
406
|
rb_define_method(cContext, "frame_self", Context_frame_self, -1);
|
429
407
|
rb_define_method(cContext, "frame_class", Context_frame_class, -1);
|
430
|
-
rb_define_method(cContext, "frame_args_info", Context_frame_args_info, -1);
|
431
|
-
rb_define_method(cContext, "frame_locals", Context_frame_locals, -1);
|
432
408
|
rb_define_method(cContext, "step_into", Context_step_into, -1);
|
433
409
|
rb_define_method(cContext, "step_over", Context_step_over, -1);
|
434
410
|
rb_define_method(cContext, "step_out", Context_step_out, 1);
|