Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add backtrace commands to vim debug session #2

@albfan

Description

@albfan

Is plain to see there must be a stack with the execution info. Find it and add commands to show and move around stack.

Test case:

function! Foo()
   let var1 = 5
   let var2 = Bar(var1)
   return var2 + 5
endfunction

function! Bar(var)
    let var2 = 7
    return a:var + var2
endfunction

A desired debug session

:debug call Foo()
>step
>next
>backtrace
  #0 function Foo()
  >1 function Bar()
>echo  var2
7
>echo var1
(undefined)
>up
>echo var1
5
>backtrace
  >0 function Foo()
  #1 function Bar()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions