mike-lischke / vscode-antlr4

ANTLR4 language support for Visual Studio Code
http://www.soft-gems.net
MIT License
429 stars 60 forks source link

breakpoints are ignored in debug mode #178

Closed elipersonal closed 2 years ago

elipersonal commented 2 years ago

debugging failed to stop at the breakpoints.

gramma: image

Launch.json: { "version": "0.2.0", "configurations": [ { "name": "Debug g4", "type": "antlr-debug", "request": "launch", "input": "${relativeFileDirname}\input.txt", "grammar": "${file}", "printParseTree": true, "visualParseTree": true } ] }

ANTLR4 grammar syntax support version: v2.2.4

VSCode version: Version: 1.64.0 (user setup) Commit: 5554b12acf27056905806867f251c859323ff7e9 Date: 2022-02-03T04:22:20.678Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.19043

mike-lischke commented 2 years ago

Have you tried to break your rules into multiple lines? The way they are now will make the breakpoints be rule exit breakpoints. There are only two types of breakpoints: rule enter and rule exit. If the rule name and its semicolon are on the same line then a breakpoint on that line becomes automatically the exit breakpoint.

elipersonal commented 2 years ago

when i broke rule top into 2 lines, it seems it is still an exit breakpoint. how can i get an rule-enter breakpoint on rule top? thank you very much!

image

elipersonal commented 2 years ago

does anyone know how to do this? I appreciate your help!

mike-lischke commented 2 years ago

Put the semicolon on an own line. When a semicolon is on the line for which a breakpoint is set, that will always become a rule exit breakpoint.

elipersonal commented 2 years ago

that worked. thank you very much Mike!

sagasm commented 6 months ago

I have the same problem too. My grammar file was Calculator.g4, when I changed ${file} to Calculator.g4 the problem disappeared