I am on Ubuntu 18.04 using lua 5.2.4.
While running the tutorial.lua file, the following output occurred (skipping the beginning):
Now try the 'n' command.
(n = step to the Next line in the source code)
tutorial.lua:85 in 'tutorial.lua:0'
debugger.lua> n
tutorial.lua:60 in 'func2'
debugger.lua> n
You used the 'n' command.
tutorial.lua:61 in 'func2'
debugger.lua> n
So it's skipping over the lines in func2().
tutorial.lua:65 in 'func2'
debugger.lua> n
tutorial.lua:67 in 'func2'
debugger.lua> n
tutorial.lua:64 in 'f'
debugger.lua> n
... and anything it might call.
But of course, I expected:
Now try the 'n' command.
(n = step to the Next line in the source code)
./tutorial.lua:85 in '<./tutorial.lua:0>'
debugger.lua> n
You used the 'n' command.
So it's skipping over the lines in func2().
... and anything it might call.
Thus, it seems like n steps into functions just like s does. Likewise, using f inside a function simply did the same as c instead of stopping right after the function.
I assumed n, f worked in the past, so I used git bisect and found that 4cc1189b23 introduced this error (n, f worked fine before 4cc1189b23).
In particular, this line (line 142 in 4cc1189b23):
return info.source:match('^@[%.%/]') ~= nil
matches only files starting with ./
Then I noticed, that n, f work properly if I run the tutorial with
lua ./tutorial.lua
but not with
lua tutorial.lua
Because the latter does not contain ./ and aforementioned line of code does not find a match.
Maybe the pattern '^@[%.%/]' needs to be adapted? Or is the prefix './' always required?
I am on Ubuntu 18.04 using lua 5.2.4.
While running the tutorial.lua file, the following output occurred (skipping the beginning):
> Now try the 'n' command.
> (n = step to the Next line in the source code)
>
> tutorial.lua:85 in '<tutorial.lua:0>'
> debugger.lua> n
> tutorial.lua:60 in 'func2'
> debugger.lua> n
> You used the 'n' command.
> tutorial.lua:61 in 'func2'
> debugger.lua> n
> So it's skipping over the lines in func2().
> tutorial.lua:65 in 'func2'
> debugger.lua> n
> tutorial.lua:67 in 'func2'
> debugger.lua> n
> tutorial.lua:64 in 'f'
> debugger.lua> n
> ... and anything it might call.
But of course, I expected:
> Now try the 'n' command.
> (n = step to the Next line in the source code)
>
> ./tutorial.lua:85 in '<./tutorial.lua:0>'
> debugger.lua> n
> You used the 'n' command.
> So it's skipping over the lines in func2().
> ... and anything it might call.
Thus, it seems like `n` steps into functions just like `s` does. Likewise, using `f` inside a function simply did the same as `c` instead of stopping right after the function.
I assumed `n`, `f` worked in the past, so I used git bisect and found that 4cc1189b23a80 introduced this error (`n`, `f` worked fine before 4cc1189b23a80).
In particular, this line (line 142 in 4cc1189b23a80):
`return info.source:match('^@[%.%/]') ~= nil`
matches only files starting with ./
Then I noticed, that `n`, `f` work properly if I run the tutorial with
`lua ./tutorial.lua`
but not with
`lua tutorial.lua`
Because the latter does not contain ./ and aforementioned line of code does not find a match.
Maybe the pattern `'^@[%.%/]'` needs to be adapted? Or is the prefix './' always required?