raix / vscode-perl-debug

LOOKING FOR MAINTAINERS. Perl debugger extension for visual studio code
MIT License
63 stars 35 forks source link

Unable to get into debugger/hit breakpoints on windows 10 & ActiveState 5.24 #26

Open totempty opened 7 years ago

totempty commented 7 years ago

I have a super simple perl script that prints and calls a sub, but I am unable to hit bp or anything debugger related. Below is the info from perl -v. Is there any way I can turn on log or debug info to understand better what's the problem on my machines?


C:\Users>perl -v

This is perl 5, version 24, subversion 1 (v5.24.1) built for MSWin32-x64-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2017, Larry Wall

Binary build 2402 [401627] provided by ActiveState http://www.ActiveState.com
Built Jan  5 2017 02:08:02
...

C:\Users>systeminfo` | findstr /B /C:"OS Name" /C:"OS Version"
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.15063 N/A Build 15063
linzyjx commented 7 years ago

I may have met the same problem. This is the output of the debug console:

Platform: win32
Launch "perl -d c:\Users\...\perl\test.pl" in "c:\Users\...\perl\"
perl -d c:\Users\...\perl\test.pl
Error
Error: spawn perl ENOENT
Debugged program terminated.  Use q to quit or R to restart,
use o inhibit_exit to avoid stopping after program termination,
Debugger connection closed
OS Name:                   Microsoft Windows 10 Home
OS Version:                10.0.15063 N/A Build 15063
VS Code Version:           1.13.0
Perl Debug Version:        0.2.1

C:\Users>perl -v

This is perl 5, version 24, subversion 1 (v5.24.1) built for MSWin32-x64-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2017, Larry Wall

Binary build 2402 [401627] provided by ActiveState http://www.ActiveState.com
Built Jan  5 2017 02:08:02
sthiago commented 7 years ago

I think I have the same problem. It doesn't hit any BPs, but if I leave "stopOnEntry": true, it actually stops in the entry point. However, there is no indication (yellow arrow) of the current line of code that is to be executed next. I can step through the code this way, but again, no indication of the current line and also there's nothing in the variables, watch or call stack sections.

If I use "stopOnEntry": false, the program executes to the end, no breakpoints are hit. Maybe you two can check that this behaviour is the same as yours?

Edit: I have strawberry 5.16.3 and windows 10

raix commented 7 years ago

just released 0.2.2 not sure if it solves part of this issue - it contains a windows related fix

sthiago commented 7 years ago

it didn't solve the issue here, you think it's windows 10 related?

raix commented 7 years ago

It might, seems like the pipe is broken - Could you clone the repo and run the tests?

raix commented 7 years ago

I've added an initial guide for running tests locally DEBUGGING.md

sthiago commented 7 years ago

I ran them, seems in order:

32 passing (16s) 5 pending

sthiago commented 7 years ago

It seems the problem is in VS Code: https://github.com/Microsoft/vscode/issues/5422#issuecomment-217064133

It's an old comment, but schemburkar described the same behavior as mine

raix commented 7 years ago

Thanks, I'll see if it's possible to replicate

sthiago commented 7 years ago

I tried debugging your extensions after cloning the repo and couldn't hit any breakpoints in it either, maybe I'm missing something?

I also cloned vscode-mock-debug, there are some errors upon compile but the yellow indicator of current line appears when I select "debug anyway"

raix commented 7 years ago

I have some ideas - but I have to investigate further,

Errors when setting break points could be related to paths - you should be able to enter perl5db commands manually directly in the vs code debug console to see if things work (the extension always sets the file context and then the break point)

It seems like tests regarding break points are not 100% stable atm. on linux https://travis-ci.org/raix/vscode-perl-debug/jobs/244149956 it could be related.

I should add more tests between vs code and the extension eg. https://github.com/raix/vscode-perl-debug/blob/master/src/tests/adapter.test.ts#L135

lieff commented 6 years ago

I have same issue (but on linux). Debugger console have some "keys on reference is experimental" warnings and ends with following message:

onException: keys on reference is experimentalDebugger connection closed

It seems treated warnings as error. Without debugger or manual execution with perl -d proceeds normally.

lieff commented 6 years ago

After fixing warnings - everything works as expected.

hoehrmann commented 5 years ago

I think I have the same problem. It doesn't hit any BPs, but if I leave "stopOnEntry": true, it actually stops in the entry point. However, there is no indication (yellow arrow) of the current line of code that is to be executed next. I can step through the code this way, but again, no indication of the current line and also there's nothing in the variables, watch or call stack sections.

If I use "stopOnEntry": false, the program executes to the end, no breakpoints are hit. Maybe you two can check that this behaviour is the same as yours?

Edit: I have strawberry 5.16.3 and windows 10

That you get no yellow arrow is because the T (stack trace) command in Perl 5.16.3 does not report anything for top-level code. That is unrelated to the issue reported here initially.