actboy168 / lua-debug

Lua Debug Adapter for Visual Studio Code
MIT License
435 stars 94 forks source link

Shebang on first line causes breakpoint to be ignored - issue regression? #189

Closed s6mike closed 1 year ago

s6mike commented 2 years ago

Hi, I'm using this extension for the first time, and I'm getting the problem described in this closed issue: https://github.com/actboy168/lua-debug/issues/153.

To reproduce, add breakpoint to this file:

!/usr/bin/env lua

print(_VERSION) print 'Hello, World!' print 'Hello, World2!'

breakpoints grey out as soon as I launch debugger.

Commenting out #! line fixes this.

Environment: launch.json: { "arg": [], "name": "launch", "program": "${file}", "request": "launch", "stopOnEntry": false, "type": "lua" },

Extension: v1.58.2 Lua v5.3.4

VSCode: Version: 1.68.1 Commit: 30d9c6cd9483b2cc586687151bcbcd635f373630 Date: 2022-06-15T02:58:26.441Z Electron: 17.4.7 Chromium: 98.0.4758.141 Node.js: 16.13.0 V8: 9.8.177.13-electron.0 OS: Linux x64 5.10.110-15808-ge5740beba59b

actboy168 commented 2 years ago

I can't reproduce it.

s6mike commented 2 years ago

Thanks for trying.

I've just reproduced it with all extensions disabled apart from the debugger and your extensionPath.

Here's a screen recording of me fixing it by commenting out the shebang: https://drive.google.com/file/d/1cy9defZTLnc9nS_2nDyk4E5YB3aQfdjt/view?usp=sharing

Is there any additional info I can provide to help you diagnose the issue? Extra logging output or similar?

s6mike commented 1 year ago

I've just realised that the breakpoints sometimes work, but they don't stop at the line I put the breakpoint on.

Before that, after I hit the debug button, the breakpoints get moved around, some of them disappear. If they end up on a line with code in them then the breakpoint works.

If I remove the shebang, the breakpoints don't move around after I hit the debug button.

(v1.60.1)