In octave there is keyword function. It opens octave repl in given place with current context. Similar to binding.pry in ruby.
keyword
binding.pry