rokucommunity / vscode-brightscript-language

A Visual Studio Code extension for Roku's BrightScript language
MIT License
110 stars 40 forks source link

Debugging stopped working between 1.30 and the latest version #56

Closed kbunch closed 5 years ago

kbunch commented 5 years ago

The debugger has stopped working between 1.30 and the latest version. It will freeze at the start of the app but the debugger won't show up with a continue/run option. This leaves it completely inoperable.

TwitchBronBron commented 5 years ago

I saw this happen 1 time during my testing, and was hoping it was just a fluke (apparently not). Does it freeze every single time, or does it work sometimes?

kbunch commented 5 years ago

On rare instances it works, but the majority of times it freezes. I reverted back to an earlier version and it was fine.

TwitchBronBron commented 5 years ago

I'll do some more testing on my end, see if I can find out why it's failing.

@georgejecook you recently did some changes to the debugger code. Is there anything you can think of that might have caused this?

kbunch commented 5 years ago

@TwitchBronBron @georgejecook Narrowed it down to happening between 1.3.2 and 1.4.0

georgejecook commented 5 years ago

Can't think off the top of my head. I can look into it tomorrow am.

On Wed, Dec 12, 2018, 4:24 PM Kenny Bunch <notifications@github.com wrote:

@TwitchBronBron https://github.com/TwitchBronBron @georgejecook https://github.com/georgejecook Narrowed it down to happening between 1.3.2 and 1.4.0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TwitchBronBron/vscode-brightscript-language/issues/56#issuecomment-446749549, or mute the thread https://github.com/notifications/unsubscribe-auth/ABKIUSsa-YN_qw52hmKp_TX6wnxokr5_ks5u4XQlgaJpZM4ZQZqz .

bvisin commented 5 years ago

roku-sample.zip

When running this sample app on 1.3.2 (https://github.com/TwitchBronBron/vscode-brightscript-language/commit/4947b0847b3059185cf51bff41c3d448b8c6c278)

I get a successful running debug session.

Debug Console:

12-13 00:31:23.403 [scrpt.cmpl] Compiling 'Roku Requests', id 'dev'
12-13 00:31:23.405 [scrpt.load.mkup] Loading markup dev 'Roku Requests'
12-13 00:31:23.407 [scrpt.parse.mkup.time] Parsed markup dev 'Roku Requests' in 1 milliseconds

------ Compiling dev 'Roku Requests' ------
12-13 00:31:23.409 [scrpt.ctx.cmpl.time] Compiled 'Roku Requests', id 'dev' in 1 milliseconds
12-13 00:31:23.410 [scrpt.proc.mkup.time] Processed markup dev 'Roku Requests' in 0 milliseconds
12-13 00:31:23.414 [ui.frm.plugin.running.enter] Entering PLUGIN_RUNNING for dev
12-13 00:31:24.827 [scrpt.ctx.run.enter] UI: Entering 'Roku Requests', id 'dev'

------ Running dev 'Roku Requests' main ------

BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.

Current Function:
001:  sub Main(args as dynamic)
002:* STOP
003:      ? "Launching with args " 
004:      ? args
005:      m.args = args
006:  
STOP (runtime error &hf7) in pkg:/source/main.brs(2)
002: STOP
Backtrace:
#0  Function main(args As Dynamic) As Void
   file/line: pkg:/source/main.brs(3)
Local Variables:
args             roAssociativeArray refcnt=2 count:4
global           Interface:ifGlobal
m                roAssociativeArray refcnt=2 count:0

Brightscript Debugger> Launching with args 
<Component: roAssociativeArray> =
{
    instant_on_run_mode: "foreground"
    lastExitOrTerminationReason: "EXIT_UNKNOWN"
    source: "auto-run-dev"
    splashTime: "1600"
}

Which is expected behavior.

When running it on the next commit (https://github.com/TwitchBronBron/vscode-brightscript-language/commit/91dacb3fc20de2fcdb9afb1ef4d3942db65224df) I am now required to add in "outDir": "${workspaceFolder}/out", and it crashes? the debugger.

Debug Console:

BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.

Current Function:
001:  sub Main(args as dynamic)
002:* STOP
003:      ? "Launching with args " 
004:      ? args
005:      m.args = args
006:  
STOP (runtime error &hf7) in pkg:/source/main.brs(2)
002: STOP
Backtrace:
#0  Function main(args As Dynamic) As Void
   file/line: pkg:/source/main.brs(3)
Local Variables:
args             roAssociativeArray refcnt=2 count:4
global           Interface:ifGlobal
m                roAssociativeArray refcnt=2 count:0

Brightscript Debugger>

Which puts it in a stoped state that is not able to be continued.

georgejecook commented 5 years ago

I think I have this resolved in https://github.com/TwitchBronBron/vscode-brightscript-language/pull/58

There were some timing issues which never manifested in the way I was running (sorry folks) - run from the debugServer, which never exhibited this behaviour (as confirmed by @bvisin)

The fix I've submitted is more robust, and worked as expected in my testing; plus has better support for the (worse) xml compiler error messages in FW 9.0+ (which is part of the new solution).