Skip to content

Commit

Permalink
Merge pull request #61 from timholy/teh/interpret
Browse files Browse the repository at this point in the history
Add an interpreter REPL mode
  • Loading branch information
timholy committed Mar 20, 2019
2 parents de5c952 + 130f230 commit 268ac7e
Show file tree
Hide file tree
Showing 19 changed files with 1,753 additions and 687 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
docs/build/
docs/site/
test/expected.out
test/failed.out
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ os:
- osx
julia:
- 1.0
- 1.1
- nightly
notifications:
email: false
Expand Down
24 changes: 24 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name = "Rebugger"
uuid = "ee283ea6-eecd-56e3-beb3-83eb4d3c31e9"
version = "0.3.0"

[deps]
CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
HeaderREPLs = "54d51984-71c9-52bd-8df9-6718e63e4153"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
JuliaInterpreter = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
HeaderREPLs = "0.3"

[extras]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
TerminalRegressionTests = "98bfdc55-cc95-5876-a49a-74609291cbe0"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Colors", "Pkg", "TerminalRegressionTests"]
4 changes: 3 additions & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
julia 1.0
Revise 1.0.2
Revise 2
HeaderREPLs 0.2
CodeTracking
JuliaInterpreter
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
environment:
matrix:
- julia_version: 1
- julia_version: 1.1
- julia_version: nightly

platform:
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"

[compat]
Documenter = "~0.21"
41 changes: 11 additions & 30 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,20 @@
# Introduction to Rebugger

Rebugger is an expression-level debugger for Julia.
It has no ability to interact with or manipulate call stacks (see [Gallium](https://github.com/Keno/Gallium.jl)),
but it can trace execution via the manipulation of Julia expressions.
It has two modes of action:

- an "interpret" mode that lets you step through code, set
breakpoints, and other manipulations common to "typical" debuggers;
- an "edit" mode that presents method bodies as objects for manipulation,
allowing you to interactively play with the code at different stages
of execution.


The name "Rebugger" has 3 meanings:

- it is a [REPL](https://docs.julialang.org/en/latest/stdlib/REPL/)-based debugger (more on that below)
- it is the [Revise](https://github.com/timholy/Revise.jl)-based debugger
- it supports repeated-execution "surface" debugging

Rebugger is an unusual debugger with a novel work-flow paradigm.
With most debuggers, you enter some special mode that lets the user "dive into the code,"
but what you are allowed to do while in this special mode may be limited.
In contrast, Rebugger brings the code along with its input arguments to the user,
presenting them both for inspection, analysis, and editing in the (mostly) normal Julia
interactive command line.
As a consequence, you can:

- test different modifications to the code or arguments without being forced to exit debug mode
and save your file
- run the same chosen block of code repeatedly (perhaps with different modifications each time)
without having to repeat any of the "setup" work that might have been necessary to get to some
deeply nested method in the original call stack.
In other words, Rebugger brings "internal" methods to the surface.
- run any desired command that helps you understand the nature of a bug.
For example, if you've already loaded `MyFavoritePlottingPackage` in your session,
then when debugging you can (transiently) add `Main.MyFavoritePlottingPackage.plot(x, y)`
as a line of the method-body you are currently analyzing, and you should see a
plot of the requested variables.

Rebugger exploits the Julia REPL's history capabilities to simulate the
stacktrace-navigation features of graphical debuggers.
Thus Rebugger offers a command-line experience that is more closely aligned with
graphical debuggers than the traditional `s`, `n`, `up`, `c` commands of a console debugger.
- it supports repeated-execution debugging

## Installation

Expand Down Expand Up @@ -74,9 +55,9 @@ in your Terminal settings to avoid the need to press Esc before each Rebugger co

#### Ubuntu

The default meta key on Ubuntu is left Alt, which is equivalent to Esc Alt on the default
The default meta key on some Ubuntu versions is left Alt, which is equivalent to Esc Alt on the default
Gnome terminal emulator.
However, even with this tip you may encounter problems because Rebugger's default key bindings
may be assigned to activate menu options within the terminal window, and
[this appears not to be configurable]( https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1113420).
As a consequence Ubuntu users will very likely need to [Customize keybindings](@ref).
Affected users may wish to [Customize keybindings](@ref).
Loading

0 comments on commit 268ac7e

Please sign in to comment.