Skip to content

Latest commit

 

History

History
117 lines (104 loc) · 4.81 KB

NOTES.md

File metadata and controls

117 lines (104 loc) · 4.81 KB

NOTES

function! RubyDebugger.receive_command() dict
  let file_contents = join(readfile(s:tmp_file), "")
  call s:log("Received command: " . file_contents)
  let commands = split(file_contents, s:separator)
  for cmd in commands
    if !empty(cmd)
      if match(cmd, '<breakpoint ') != -1
        call g:RubyDebugger.commands.jump_to_breakpoint(cmd)
      elseif match(cmd, '<suspended ') != -1
        call g:RubyDebugger.commands.jump_to_breakpoint(cmd)
      elseif match(cmd, '<exception ') != -1
        call g:RubyDebugger.commands.handle_exception(cmd)
      elseif match(cmd, '<breakpointAdded ') != -1
        call g:RubyDebugger.commands.set_breakpoint(cmd)
      elseif match(cmd, '<catchpointSet ') != -1
        call g:RubyDebugger.commands.set_exception(cmd)
      elseif match(cmd, '<variables>') != -1
        call g:RubyDebugger.commands.set_variables(cmd)
      elseif match(cmd, '<error>') != -1
        call g:RubyDebugger.commands.error(cmd)
      elseif match(cmd, '<message>') != -1
        call g:RubyDebugger.commands.message(cmd)
      elseif match(cmd, '<eval ') != -1
        call g:RubyDebugger.commands.eval(cmd)
      elseif match(cmd, '<processingException ') != -1
        call g:RubyDebugger.commands.processing_exception(cmd)
      elseif match(cmd, '<frames>') != -1
        call g:RubyDebugger.commands.trace(cmd)
      endif
    endif
  endfor
  call g:RubyDebugger.queue.after_hook()
  call g:RubyDebugger.queue.execute()

https://github.com/astashov/vim-ruby-debugger/blob/master/src/ruby_debugger/commands.vim

rdebug-ide --debug --disable-int-handler --evaluation-timeout 10 --rubymine-protocol-extensions --port 61513 --dispatcher-port 61514 -- /Users/johan_lunds/Documents/Kod/apoex2/script/rails server -b 0.0.0.0 -p 3000 -e development

  1. add breakpoint ("break file_path:32")
  2. remove breakpoint ("delete N" or perhaps "delete" to delete all and then re-add with "break ...")
  3. evaluate expressions ("eval ..."). needs to be escaped??? I think ";" is used to separate commands so that needs to be escaped
  4. list backtrace ("backtrace")
  5. move up, down and to specified frame ("up", "down", "frame N")
  6. show variable values ("var inspect "). what can be sent as ??
  7. step over, into, out ("step" = into, "next" = over, "finish" = out). "over" and "into" can have arg "+" = force, which is probably useful.
  8. continue until next breakpoint ("cont")
  9. "var local", "var instance " where object is object id "+0x123abc" or expression ("Rails.env"?), "var global", "var const <CLASS_OR_MODULE>"

    Other: what is "jump" used for?? Other: "thread ..." commands (use together with "backtrace")

    Generate Chrome debugger icon font: http://fontastic.me/

    case 'exception'           then
    case 'breakpointAdded'     then
    case 'catchpointSet'       then
    case 'variables'           then
    case 'error'               then
    case 'message'             then
    case 'eval'                then
    case 'processingException' then
    
    case 'breakpointDeleted'   then
    case 'breakpointEnabled'   then
    case 'breakpointDisabled'  then
    case 'conditionSet'        then
    case 'expressions'         then
    case 'expressionInfo'      then
    case 'threads'             then
    case 'breakpoints'         then
    case 'loadResult'          then
    

    TODO: next up:

    1. variables: locals, globals. click in tree to expand ("var inspect +0x..." or "var instance +0x..." ???)
    2. make panel width resizable (like tree-view does it)
    3. backtrace: "frame N" command to go up/down in backtrace
    4. add/remove breakpoints (context menu, command panel. extra: click in gutter)
    5. step in/out/over
    6. indicate breakpoints + frames visually on editor-lines
    7. console
    8. list breakpoints in panel
    9. watch expressions
    10. deactivate all breakpoints-button
    11. Exception-handling (research!)
    12. hover over variables in text editor shows inspect-popover
    13. conditional breakpoints
    14. CONTINUE TO HERE!