Open gstead opened 4 years ago
@gstead: Try replacing the relative path in use lib '.'
with an absolute path, like
use FindBin;
use lib "$FindBin::Bin";
Some months ago I changed all the test scripts to use that, and if this makes a difference, it would explain why the test suite passes on your system.
Many thanks for the suggestion. I changed those lines to switch to an absolute path, but the behavior stayed the same.
Included an animated gif below in case it helps.
I believe the debugger may have stopped in the right place...vscode just displays the wrong place (wrong file?). In the gif I type the y
and v
commands, and they behave as it the debugger stopped in the correct spot. Not sure if that helps...
I guess I have the same issue as yours but on Windows. Your code debugging works correctly on my macOS 10.14.6 with internal Perl 5.18.4 (that came with the OS) & PadWalker 2.3. But on my Windows it behaves as the gif shows. I think this problem somehow connected with the "Variable, Watch, Step by Step not working" issue. The '.' path cannot be resolved for an unknown reason so the debugger doesn't know where to stop or put the yellow cursor. If we can find out how we can fix it on your plarform maybe we can get closer resolving the other issue too.
As I recall it, when the debugger stops, we send a StoppedEvent. vscode will then make a StackTrace request, and we respond with StackFrames that indicate their Source. The published version of the debug extension generates the StackTrace with the perl5db.pl T
command. The command behaves differently between versions of Perl / perl5db.pl, e.g.
bjoern@hpx360 ~ perlbrew use hpx360perl-5.28.1
bjoern@hpx360 ~ perl -d -e '
print 123;
print 456;
'
Loading DB routines from perl5db.pl version 1.53
Editor support available.
Enter h or 'h h' for help, or 'man perldebug' for more help.
main::(-e:2): print 123;
DB<1> b 2
DB<2> b 3
DB<3> s
main::(-e:3): print 456;
DB<3> T
@ = DB::DB called from -e line 3
DB<3>
versus
bjoern@hpx360 ~ perlbrew use hpx360perl-5.16.3
bjoern@hpx360 ~ perl -d -e '
print 123;
print 456;
'
Loading DB routines from perl5db.pl version 1.37
Editor support available.
Enter h or 'h h' for help, or 'man perldebug' for more help.
main::(-e:2): print 123;
DB<1> b 2
DB<2> b 3
DB<3> s
main::(-e:3): print 456;
DB<3> 123T
DB<3> q
The older version of the debugger produces empty output. There may be other such issues. In any case, checking what Sources we report would probably be the biggest clue. I would also suspect that https://github.com/raix/vscode-perl-debug/pull/91 fixes this problem.
perl-debug is great and a main reason I switched to vscode. But I can't get breakpoints to break at the right place.
To reproduce:
code .
TestPackage.pm
. I suggest somewhere insub a
orsub b
c
in console)TestPackage.pl
instead of the breakpoints inTestPackage.pm
If I had to guess, I'd day the debugger breaks on the correct line in
TestPackage.pm
. But perhaps vscode loads the wrong file and displays the break in the wrong place.My environment
Mac OS/X Mojave; perl 5.16.3; perlbrew; Perl Debug 0.6.3
vscode details:
Things I debugged/checked:
Check 1) confirm the cli debugger works correctly (no vscode):
Check 2) in
launch.json
I activated"debugRaw": true
and"debugLog": true
and then monitored the OUTPUT console while debugging. The commands there look correctf TestPackage.pm
,b <line>
to set breakpoints, andy 0
andy 1
This is exactly as one would expect.
Check 3) read
DEBUGGING.md
and then confirmed all debugger tests pass: