19 Commits

Author SHA1 Message Date
Jack Nagel
0b8cf49386 Remove unnecessary code from debugger 2014-12-26 22:58:36 -05:00
Jack Nagel
d2d7516cc0 Allow debugging patching failures
Closes Homebrew/homebrew#33056.
2014-12-26 19:42:11 -05:00
Jack Nagel
ee2f3e8e7e Revert "Allow debugging patch failures"
This reverts commit 988601624568a951d86bd00cf441d18681b4b500.
2014-10-11 01:45:55 -05:00
Jack Nagel
8cc5aabfcf Allow debugging patch failures
Closes Homebrew/homebrew#33056.
2014-10-10 14:59:18 -05:00
Jack Nagel
84352d2728 Delay requiring irb until runtime
Fixes Homebrew/homebrew#32410.
2014-09-18 15:29:10 -05:00
Jack Nagel
c8bb68a795 Fix exiting the debugger menu with CTRL-D 2014-09-18 14:16:07 -05:00
Jack Nagel
79a6e59e6e Implement brew test --debug 2014-09-18 14:16:07 -05:00
Jack Nagel
3bbc9998a5 Rewrite debugger to remove monkeypatches and use of call/cc 2014-09-18 14:16:07 -05:00
Jack Nagel
35267d7c22 Disable "ignore" and "irb" debugger options unless we have a continuation
Fixes Homebrew/homebrew#30472.
2014-06-27 15:19:30 -05:00
Jack Nagel
502078099f Prefer self.class.name to self.class.to_s 2014-06-12 16:13:07 -05:00
Jack Nagel
d294d2e210 Fix the debug implementation of Resource#stage as well 2014-03-14 13:05:09 -05:00
Jack Nagel
1599e9b059 Fix Resource#stage method signature in debug mode
Fixes Homebrew/homebrew#27554.
2014-03-14 12:54:17 -05:00
Jack Nagel
d965bbba47 Allow the debugger to work from inside staged resources
References Homebrew/homebrew#23263.
Closes Homebrew/homebrew#27445.
2014-03-13 10:05:57 -05:00
Jack Nagel
0b425178ec Reduce footprint of readline hack 2013-02-07 19:02:20 -06:00
Jack Nagel
a75dd6e8a8 Split debrew up to faciliate test isolation
We want to be able to test the raise functionality without
monkey-patching #raise on every object in the system, which is one of
the side effects of loading debrew.rb.
2013-02-06 19:04:43 -06:00
Jack Nagel
46e49c4889 Don't discard exception instance data in debug mode
If the debugger's monkey-patched raise was passed an instantiated
exception, the #exception method was called with a potentially nil
argument, causing its instance data to be thrown away. This hides
potentially useful information from the user.

Fix it by allowing instantiated exceptions to be reraised unharmed.

Fixes Homebrew/homebrew#17622.
2013-02-06 11:35:41 -06:00
Jack Nagel
efcd926d1b Work around Readline clash
Only limited debugging functionality is available to things that involve
the Readline formula, but it is better than crashing outright.

c.f. Homebrew/homebrew#15776.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-11-11 18:49:32 -06:00
Jack Nagel
8d7be8c0b4 debrew: take input from same line as prompt 2012-11-09 15:18:01 -06:00
Camillo Lugaresi
18dbe47f9f debrew: formula debugging for homebrew
A new feature for easing the pain of working with complex formulas, or
formulas for large packages. When running brew in debug mode (-d), if an
exception propagates outside the formula's install method, you now get a menu
which lets you return to the point where the exception was raised and perfom
several useful actions, such as:
- printing a backtrace
- entering IRB to examine the context and test ruby code
- entering the debugger (if ruby-debug is available)
- entering a shell
- ignoring the exception or proceeding with the raise as normal

Signed-off-by: Max Howell <mxcl@me.com>

* Fixed conflict in build.rb.
* Removed old debug handling in Formula.brew.

Closes Homebrew/homebrew#10435.
2012-10-28 11:39:02 -04:00