vscode-perl-debug icon indicating copy to clipboard operation
vscode-perl-debug copied to clipboard

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

Open totempty opened this issue 8 years ago • 14 comments

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

totempty avatar Jun 08 '17 04:06 totempty

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

linzyjx avatar Jun 14 '17 11:06 linzyjx

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

sthiago avatar Jun 16 '17 01:06 sthiago

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

raix avatar Jun 16 '17 20:06 raix

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

sthiago avatar Jun 16 '17 21:06 sthiago

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

raix avatar Jun 17 '17 05:06 raix

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

raix avatar Jun 17 '17 07:06 raix

I ran them, seems in order:

32 passing (16s) 5 pending

sthiago avatar Jun 17 '17 07:06 sthiago

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

sthiago avatar Jun 17 '17 08:06 sthiago

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

raix avatar Jun 17 '17 17:06 raix

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"

sthiago avatar Jun 18 '17 19:06 sthiago

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

raix avatar Jun 18 '17 19:06 raix

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 avatar Aug 22 '18 10:08 lieff

After fixing warnings - everything works as expected.

lieff avatar Aug 22 '18 11:08 lieff

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.

hoehrmann avatar Mar 02 '19 00:03 hoehrmann