Skip to content

Instantly share code, notes, and snippets.

@petebytes
Forked from elrayle/byebug_commands.md
Created August 22, 2021 04:31
Show Gist options
  • Save petebytes/3a3fb7c1d0735abf9fb2ba6a1d2c385d to your computer and use it in GitHub Desktop.
Save petebytes/3a3fb7c1d0735abf9fb2ba6a1d2c385d to your computer and use it in GitHub Desktop.

Revisions

  1. @elrayle elrayle revised this gist Jul 6, 2021. No changes.
  2. @elrayle elrayle revised this gist Jul 6, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion byebug_commands.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ To see official help...
    Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    `help` | `h` | `h` | list top level of all commands
    `help cmd` | `h cmd-alias` | `h n` | list the details of a command (example shows requesting details for the `next` command (this works for all commands)
    `help cmd` | `h cmd-alias` | `h n` | list the details of a command (example shows requesting details for the `next` command) (this works for all commands)

    ### Stepping through code

  3. @elrayle elrayle revised this gist Jul 6, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion byebug_commands.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ To see official help...
    Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    `help` | `h` | `h` | list top level of all commands
    `help cmd` | `h cmd-alias` | `h n` | list the details of the `next` command (this works for all commands)
    `help cmd` | `h cmd-alias` | `h n` | list the details of a command (example shows requesting details for the `next` command (this works for all commands)

    ### Stepping through code

  4. @elrayle elrayle revised this gist Jul 6, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion byebug_commands.md
    Original file line number Diff line number Diff line change
    @@ -43,7 +43,7 @@ Command | Aliases | Example | Comments
    `display` | `disp` | `disp arg` | Set expression to watch (e.g. arg) everytime the debugger stops
      | | `disp` | Lists all display expressions with values
    `disable display` | `dis d` | `dis d 2` | Disable display with id (e.g. 2) (maybe - disables all if no id specified)
    `enable display ` | `en d` | `en d 2` | Enable display with id (e.g. 2) (maybe - disables all if no id specified)
    `enable display ` | `en d` | `en d 2` | Enable display with id (e.g. 2) (maybe - enables all if no id specified)
    `undisplay` | `undisp` | `undisp 1` | Stop displaying expression with id (e.g. 1) (stops displaying all if no id specified)

    ### Variable values
  5. @elrayle elrayle revised this gist Feb 20, 2020. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion byebug_commands.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,13 @@
    ## Byebug's commands
    ## Byebug Cheatsheet

    This cheatsheet includes most of the byebug commands organized by related commands (e.g. breakpoint related commands are together).

    To see official help...

    Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    `help` | `h` | `h` | list top level of all commands
    `help cmd` | `h cmd-alias` | `h n` | list the details of the `next` command (this works for all commands)

    ### Stepping through code

  6. @elrayle elrayle revised this gist Feb 20, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion byebug_commands.md
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,8 @@ Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    `list=` | `l=` | `l=` | List 5 before and 4 after the current line pending execution (resets to current stop point)
    `list` | `l` | `l 8-20` | List specified range of lines (e.g. lines 8-20)
    | | `l` | List next 10 lines from current location listed. (`l` again gives next 10 after that)
      | | `l` | List next 10 lines from current location listed. (`l` again gives next 10 after that)
    `list-` | `l-` | `l-` | List previous 10 lines from current location listed. (`l-` again gives previous 10 before that)
    `where` or `backtrace` | `w` or `bt` | `w` | display backtrace (`w` and `bt` are the same command)
      | | `bt` | display backtrace

  7. @elrayle elrayle revised this gist Feb 20, 2020. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions byebug_commands.md
    Original file line number Diff line number Diff line change
    @@ -5,11 +5,11 @@
    Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    `next` | `n` | `n` | step over to next line in same block or method (or back to calling block/method if at end of current block/method)
      | | `n 3` | step over next N lines (e.g. if on line 11, `n 3` will continue and break on line 14)
      | | `n 3` | step over next N lines (e.g. if on line 11, `n 3` will continue and break on line 14)
    `step` | `s` | `s` | step into block or method
    ` ` | | `s 3` | step in 3 times
      | | `s 3` | step in 3 times
    `continue` | `c` | `c` | continue execution to next breakpoint (or end of program if no breakpoints reached)
    ` ` | | `c 43` | continues and stops at line 43 (stopping at breakpoint if encountered first)
      | | `c 43` | continues and stops at line 43 (stopping at breakpoint if encountered first)
    `continue!` | `c!` | `c!` | continue execution to end of program ignoring all breakpoints

    ### Breakpoint Commands
    @@ -22,7 +22,7 @@ Command | Aliases | Example | Comments
    `enable breakpoint ` | `en b` | `en b 2` | Enable breakpoint with id (e.g. 2) (disables all if no id specified)
    `delete` | `del` | `del 1` | Deletes breakpoint with id (e.g. 1) (deletes all if no id specified)
    `condition` | `cond` | `cond 3 i > 3` | Breaks at breakpoint with id (e.g. 3) only if condition is met
    ` ` | | `cond 3` | Removes condition from breakpoint with id (e.g. 3)
      | | `cond 3` | Removes condition from breakpoint with id (e.g. 3)

    ### Watch Commands

    @@ -32,7 +32,7 @@ Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    `info display ` | `i d` | `i d` | Lists display id, enabled?, and expression being watched
    `display` | `disp` | `disp arg` | Set expression to watch (e.g. arg) everytime the debugger stops
    ` ` | | `disp` | Lists all display expressions with values
      | | `disp` | Lists all display expressions with values
    `disable display` | `dis d` | `dis d 2` | Disable display with id (e.g. 2) (maybe - disables all if no id specified)
    `enable display ` | `en d` | `en d 2` | Enable display with id (e.g. 2) (maybe - disables all if no id specified)
    `undisplay` | `undisp` | `undisp 1` | Stop displaying expression with id (e.g. 1) (stops displaying all if no id specified)
    @@ -44,9 +44,9 @@ Command | Aliases | Example | Comments
    `var args` | `v a` | `v a` | show arguments and values for current method
    `var local` | `v l` | `v l` | show local variable and values for current scope (e.g. scope = method or block)
    `var instance` | `v i` | `v i` | show instance variables and values for instance
    ` ` | | `v i obj` | show instance variables and values for another object (e.g. obj)
      | | `v i obj` | show instance variables and values for another object (e.g. obj)
    `var const` | `v c` | `v c` | show constants and values for current instance's class
    ` ` | | `v c klass` | show constants and values for another module/class (e.g. klass)
      | | `v c klass` | show constants and values for another module/class (e.g. klass)
    `var global` | `v g` | `v g` | show global variables and values
    `var all` | `v all` | `v all` | show local, global, and instance variables and values of self

    @@ -59,4 +59,4 @@ Command | Aliases | Example | Comments
    | | `l` | List next 10 lines from current location listed. (`l` again gives next 10 after that)
    `list-` | `l-` | `l-` | List previous 10 lines from current location listed. (`l-` again gives previous 10 before that)
    `where` or `backtrace` | `w` or `bt` | `w` | display backtrace (`w` and `bt` are the same command)
    ` ` | | `bt` | display backtrace
      | | `bt` | display backtrace
  8. @elrayle elrayle revised this gist Feb 20, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion byebug_commands.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    `next` | `n` | `n` | step over to next line in same block or method (or back to calling block/method if at end of current block/method)
    ` ` | | `n 3` | step over next N lines (e.g. if on line 11, `n 3` will continue and break on line 14)
      | | `n 3` | step over next N lines (e.g. if on line 11, `n 3` will continue and break on line 14)
    `step` | `s` | `s` | step into block or method
    ` ` | | `s 3` | step in 3 times
    `continue` | `c` | `c` | continue execution to next breakpoint (or end of program if no breakpoints reached)
  9. @elrayle elrayle revised this gist Feb 20, 2020. 1 changed file with 27 additions and 58 deletions.
    85 changes: 27 additions & 58 deletions byebug_commands.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,17 @@
    ## Byebug's commands

    ### Stepping through code

    Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    `next` | `n` | `n` | step over to next line in same block or method (or back to calling block/method if at end of current block/method)
    ` ` | | `n 3` | step over next N lines (e.g. if on line 11, `n 3` will continue and break on line 14)
    `step` | `s` | `s` | step into block or method
    ` ` | | `s 3` | step in 3 times
    `continue` | `c` | `c` | continue execution to next breakpoint (or end of program if no breakpoints reached)
    ` ` | | `c 43` | continues and stops at line 43 (stopping at breakpoint if encountered first)
    `continue!` | `c!` | `c!` | continue execution to end of program ignoring all breakpoints

    ### Breakpoint Commands

    Command | Aliases | Example | Comments
    @@ -12,7 +24,9 @@ Command | Aliases | Example | Comments
    `condition` | `cond` | `cond 3 i > 3` | Breaks at breakpoint with id (e.g. 3) only if condition is met
    ` ` | | `cond 3` | Removes condition from breakpoint with id (e.g. 3)

    ### Variable Watch Commands
    ### Watch Commands

    Enabled watch expressions display every time byebug stops.

    Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    @@ -21,21 +35,20 @@ Command | Aliases | Example | Comments
    ` ` | | `disp` | Lists all display expressions with values
    `disable display` | `dis d` | `dis d 2` | Disable display with id (e.g. 2) (maybe - disables all if no id specified)
    `enable display ` | `en d` | `en d 2` | Enable display with id (e.g. 2) (maybe - disables all if no id specified)
    `undisplay` | `undisp` | `undisp 1` | Stop displaying expression with id (e.g. 1) (stops displaying all if no id specified)

    ### Stepping through code
    ### Variable values

    Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    `next` | `n` | `n` | step over to next line in same block or method (or back to calling block/method if at end of current block/method)
    ` ` | | `n 3` | step over next N lines (e.g. if on line 11 and `n 3`, will be on line 14)
    `step` | `s` | `s` | step into block or method
    ` ` | | `s 3` | step in 3 times
    `continue` | `c` | `c` | continue execution to next breakpoint (or end of program if no breakpoints reached)
    ` ` | | `c 43` | continues and stops at line 43 (stopping at breakpoint if encountered first)
    `continue!` | `c!` | `c!` | continue execution to end of program ignoring all breakpoints



    `var args` | `v a` | `v a` | show arguments and values for current method
    `var local` | `v l` | `v l` | show local variable and values for current scope (e.g. scope = method or block)
    `var instance` | `v i` | `v i` | show instance variables and values for instance
    ` ` | | `v i obj` | show instance variables and values for another object (e.g. obj)
    `var const` | `v c` | `v c` | show constants and values for current instance's class
    ` ` | | `v c klass` | show constants and values for another module/class (e.g. klass)
    `var global` | `v g` | `v g` | show global variables and values
    `var all` | `v all` | `v all` | show local, global, and instance variables and values of self

    ### Tracing and Location

    @@ -45,49 +58,5 @@ Command | Aliases | Example | Comments
    `list` | `l` | `l 8-20` | List specified range of lines (e.g. lines 8-20)
    | | `l` | List next 10 lines from current location listed. (`l` again gives next 10 after that)
    `list-` | `l-` | `l-` | List previous 10 lines from current location listed. (`l-` again gives previous 10 before that)




    Command | Aliases | Subcommands
    ------- | ------- | -----------
    `backtrace` | `bt` `w` `where`|
    `break` | `b` |
    `catch` | `cat` |
    `condition` | `cond` |
    `continue` | `c` `cont` |
    `continue!` | `c!` `cont!` |
    `debug` | |
    `delete` | `del` |
    `disable` | `dis` | `breakpoints` `display`
    `display` | `disp` |
    `down` | |
    `edit` | `ed` |
    `enable` | `en` | `breakpoints` `display`
    `finish` | `fin` |
    `frame` | `f` |
    `help` | `h` |
    `history` | `hist` |
    `info` | `i` | `args` `breakpoints` `catch` `display` `file` `line` `program`
    `interrupt` | `int` |
    `irb` | |
    `kill` | |
    `list` | `l` |
    `method` | `m` | `instance`
    `next` | `n` |
    `pry` | |
    `quit` | `q` |
    `quit!` | `q!` |
    `restart` | |
    `save` | `sa` |
    `set` | | `autoirb` `autolist` `autopry` `autosave` `basename` `callstyle` `fullpath` `histfile` `histsize` `linetrace` `listsize` `post_mortem` `savefile` `stack_on_error` `width`
    `show` | | `autoirb` `autolist` `autopry` `autosave` `basename` `callstyle` `fullpath` `histfile` `histsize` `linetrace` `listsize` `post_mortem` `savefile` `stack_on_error` `width`
    `skip` | `sk` |
    `source` | `so` |
    `step` | `s` |
    `thread` | `th` | `current` `list` `resume` `stop` `switch`
    `tracevar` | `tr` |
    `undisplay` | `undisp` |
    `untracevar`| `untr` |
    `up` | |
    `var` | `v` | `all` `constant` `global` `instance` `local`
    `where` or `backtrace` | `w` or `bt` | `w` | display backtrace (`w` and `bt` are the same command)
    ` ` | | `bt` | display backtrace
  10. @elrayle elrayle revised this gist Feb 20, 2020. 1 changed file with 39 additions and 5 deletions.
    44 changes: 39 additions & 5 deletions byebug_commands.md
    Original file line number Diff line number Diff line change
    @@ -4,15 +4,49 @@

    Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    `break` | `b` | `b 33` | Set breakpoint at specified line in the current file
    `info breakpoints` | `i b` | `i b` | Lists breakpoint id, enabled?, and breakpoint line
    `disable breakpoint` | `dis b` | `dis b 2` | Disable breakpoint with id 2 (disables all if no id specified)
    `delete` | `del` | `del 1` | Deletes breakpoint with id 1 (deletes all if no id specified)
    `condition` | `cond` | `cond 3 i > 3` | Breaks at breakpoint with id 3 only if condition is met
    | | `cond 3` | Removes condition from breakpoint with id 3
    `break` | `b` | `b 33` | Set breakpoint at specified line (e.g. 33) in the current file
    `disable breakpoint` | `dis b` | `dis b 2` | Disable breakpoint with id (e.g. 2) (disables all if no id specified)
    `enable breakpoint ` | `en b` | `en b 2` | Enable breakpoint with id (e.g. 2) (disables all if no id specified)
    `delete` | `del` | `del 1` | Deletes breakpoint with id (e.g. 1) (deletes all if no id specified)
    `condition` | `cond` | `cond 3 i > 3` | Breaks at breakpoint with id (e.g. 3) only if condition is met
    ` ` | | `cond 3` | Removes condition from breakpoint with id (e.g. 3)

    ### Variable Watch Commands

    Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    `info display ` | `i d` | `i d` | Lists display id, enabled?, and expression being watched
    `display` | `disp` | `disp arg` | Set expression to watch (e.g. arg) everytime the debugger stops
    ` ` | | `disp` | Lists all display expressions with values
    `disable display` | `dis d` | `dis d 2` | Disable display with id (e.g. 2) (maybe - disables all if no id specified)
    `enable display ` | `en d` | `en d 2` | Enable display with id (e.g. 2) (maybe - disables all if no id specified)

    ### Stepping through code

    Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    `next` | `n` | `n` | step over to next line in same block or method (or back to calling block/method if at end of current block/method)
    ` ` | | `n 3` | step over next N lines (e.g. if on line 11 and `n 3`, will be on line 14)
    `step` | `s` | `s` | step into block or method
    ` ` | | `s 3` | step in 3 times
    `continue` | `c` | `c` | continue execution to next breakpoint (or end of program if no breakpoints reached)
    ` ` | | `c 43` | continues and stops at line 43 (stopping at breakpoint if encountered first)
    `continue!` | `c!` | `c!` | continue execution to end of program ignoring all breakpoints




    ### Tracing and Location

    Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    `list=` | `l=` | `l=` | List 5 before and 4 after the current line pending execution (resets to current stop point)
    `list` | `l` | `l 8-20` | List specified range of lines (e.g. lines 8-20)
    | | `l` | List next 10 lines from current location listed. (`l` again gives next 10 after that)
    `list-` | `l-` | `l-` | List previous 10 lines from current location listed. (`l-` again gives previous 10 before that)




    Command | Aliases | Subcommands
  11. @elrayle elrayle created this gist Feb 20, 2020.
    59 changes: 59 additions & 0 deletions byebug_commands.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,59 @@
    ## Byebug's commands

    ### Breakpoint Commands

    Command | Aliases | Example | Comments
    ------- | ------- | ------- | --------
    `break` | `b` | `b 33` | Set breakpoint at specified line in the current file
    `info breakpoints` | `i b` | `i b` | Lists breakpoint id, enabled?, and breakpoint line
    `disable breakpoint` | `dis b` | `dis b 2` | Disable breakpoint with id 2 (disables all if no id specified)
    `delete` | `del` | `del 1` | Deletes breakpoint with id 1 (deletes all if no id specified)
    `condition` | `cond` | `cond 3 i > 3` | Breaks at breakpoint with id 3 only if condition is met
    | | `cond 3` | Removes condition from breakpoint with id 3

    ### Variable Watch Commands



    Command | Aliases | Subcommands
    ------- | ------- | -----------
    `backtrace` | `bt` `w` `where`|
    `break` | `b` |
    `catch` | `cat` |
    `condition` | `cond` |
    `continue` | `c` `cont` |
    `continue!` | `c!` `cont!` |
    `debug` | |
    `delete` | `del` |
    `disable` | `dis` | `breakpoints` `display`
    `display` | `disp` |
    `down` | |
    `edit` | `ed` |
    `enable` | `en` | `breakpoints` `display`
    `finish` | `fin` |
    `frame` | `f` |
    `help` | `h` |
    `history` | `hist` |
    `info` | `i` | `args` `breakpoints` `catch` `display` `file` `line` `program`
    `interrupt` | `int` |
    `irb` | |
    `kill` | |
    `list` | `l` |
    `method` | `m` | `instance`
    `next` | `n` |
    `pry` | |
    `quit` | `q` |
    `quit!` | `q!` |
    `restart` | |
    `save` | `sa` |
    `set` | | `autoirb` `autolist` `autopry` `autosave` `basename` `callstyle` `fullpath` `histfile` `histsize` `linetrace` `listsize` `post_mortem` `savefile` `stack_on_error` `width`
    `show` | | `autoirb` `autolist` `autopry` `autosave` `basename` `callstyle` `fullpath` `histfile` `histsize` `linetrace` `listsize` `post_mortem` `savefile` `stack_on_error` `width`
    `skip` | `sk` |
    `source` | `so` |
    `step` | `s` |
    `thread` | `th` | `current` `list` `resume` `stop` `switch`
    `tracevar` | `tr` |
    `undisplay` | `undisp` |
    `untracevar`| `untr` |
    `up` | |
    `var` | `v` | `all` `constant` `global` `instance` `local`