Closed jdratlif closed 3 years ago
DB::DB
is defined by Perl::LanguageServer itself, so it should always be defined.
I don't have any clue, the only thing I could imagine is, that there is some mixup between your Perl 5.16 and 5.18 installation.
Maybe you could try with "reloadModules": false
since reloaded modules adds some complexity.
I turned up the debug log to max. I can get the same thing to work on Linux Mint 20 in VS Code with their 5.30 version of perl in system, but I can't seem to get it to work on CentOS 7.
What version of perl are you using? Maybe I can try another one. The LanguageServer works fine in syntax checking mode. It sure looks to be using my 5.18 version of perl.
##### 9 #####
running: {} coros: {}
LS: end aio read cnt=98
LS: line=<Content-Length: 195>
LS: line=<>
LS: read data={"jsonrpc":"2.0","id":1,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs"}}}
LS: read header={ "Content-Length" => 195 }
LS: ---> Request: {
"id" : 1,
"params" : {
"textDocument" : {
"uri" : "file:///home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs"
}
},
"jsonrpc" : "2.0",
"method" : "textDocument/documentSymbol"
}
LS: handle_req id=1
LS: method=_rpcreq_documentSymbol
LS: start aio read
LS: <--- Response: {
"result" : [
{
"kind" : 12,
"selectionRange" : {
"end" : {
"character" : 7,
"line" : 61
},
"start" : {
"line" : 61,
"character" : 2
}
},
"containerName" : "main::",
"defintion" : "sub",
"children" : [],
"range" : {
"start" : {
"character" : 0,
"line" : 61
},
"end" : {
"character" : 9999,
"line" : 66
}
},
"name" : "usage"
}
],
"jsonrpc" : "2.0",
"id" : "1"
}
LS: done handle_req id=1
DAx: connect from 127.0.0.1:47050
DAx: start aio read
DAx: end aio read cnt=21
DAx: line=<Content-Length: 376>
DAx: start aio read
DAx: end aio read cnt=2
DAx: line=<>
DAx: read data={"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"perl","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us","supportsProgressReporting":true,"supportsInvalidatedEvent":true},"type":"request","seq":1}
DAx: read header={ "Content-Length" => 376 }
DAx: ---> Request: {
"arguments" : {
"supportsVariablePaging" : true,
"supportsVariableType" : true,
"supportsProgressReporting" : true,
"locale" : "en-us",
"clientName" : "Visual Studio Code",
"columnsStartAt1" : true,
"pathFormat" : "path",
"linesStartAt1" : true,
"clientID" : "vscode",
"supportsInvalidatedEvent" : true,
"supportsRunInTerminalRequest" : true,
"adapterID" : "perl"
},
"type" : "request",
"command" : "initialize",
"seq" : 1
}
DAx: handle_req id=-1
DAx: apply_all_roles (Perl::LanguageServer=HASH(0x34532d0), Perl::LanguageServer::Methods::DebugAdapter, Perl/LanguageServer/Methods/DebugAdapter.pm)
DAx: method=_dapreq_initialize
DA: <--- Response: {
"type" : "response",
"request_seq" : 1,
"success" : true,
"command" : "initialize",
"seq" : 1,
"body" : {
"exceptionBreakpointFilters" : [],
"supportsHitConditionalBreakpoints" : false,
"supportsStepInTargetsRequest" : false,
"supportsConditionalBreakpoints" : true,
"supportsStepBack" : false,
"supportsRestartFrame" : false,
"supportedChecksumAlgorithms" : [],
"completionTriggerCharacters" : [],
"supportsGotoTargetsRequest" : false,
"supportsRestartRequest" : false,
"supportsCancelRequest" : true,
"supportTerminateDebuggee" : true,
"supportsLoadedSourcesRequest" : true,
"supportsTerminateThreadsRequest" : true,
"supportsTerminateRequest" : true,
"supportsEvaluateForHovers" : true,
"supportsSetVariable" : true,
"additionalModuleColumns" : [],
"supportsCompletionsRequest" : false,
"supportsModulesRequest" : true,
"supportsBreakpointLocationsRequest" : true,
"supportsConfigurationDoneRequest" : true,
"supportsExceptionInfoRequest" : false,
"supportsSetExpression" : true,
"supportsLogPoints" : false,
"supportsFunctionBreakpoints" : false,
"supportsReadMemoryRequest" : false,
"supportsDelayedStackTraceLoading" : true,
"supportsDataBreakpoints" : false,
"supportsDisassembleRequest" : false,
"supportsValueFormattingOptions" : false,
"supportsExceptionOptions" : false
}
}
DA: done handle_req id=-1
DA: start aio read
DA: end aio read cnt=21
DA: line=<Content-Length: 351>
DA: start aio read
DA: end aio read cnt=2
DA: line=<>
DA: read data={"command":"launch","arguments":{"type":"perl","request":"launch","name":"Parse Logs","program":"/home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs","args":["-t","1"],"stopOnEntry":true,"reloadModules":false,"__configurationTarget":5,"__sessionId":"a66c7ff9-f0bf-4269-9bc7-eab11c244637"},"type":"request","seq":2}
DA: read header={ "Content-Length" => 351 }
DA: ---> Request: {
"arguments" : {
"__sessionId" : "a66c7ff9-f0bf-4269-9bc7-eab11c244637",
"args" : [
"-t",
"1"
],
"reloadModules" : false,
"__configurationTarget" : 5,
"program" : "/home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs",
"request" : "launch",
"stopOnEntry" : true,
"type" : "perl",
"name" : "Parse Logs"
},
"type" : "request",
"command" : "launch",
"seq" : 2
}
DA: handle_req id=-2
DA: method=_dapreq_launch
DA: start /home/jdratlif/perl5/perlbrew/perls/perl-5.18.4/bin/perl -I /home/jdratlif/git/re-service-availability-report/lib -I /home/jdratlif/git/GRNOC-MRT-Parser/lib -d /home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs -t 1
DA: /home/jdratlif/perl5/perlbrew/perls/perl-5.18.4/bin/perl -I /home/jdratlif/git/re-service-availability-report/lib -I /home/jdratlif/git/GRNOC-MRT-Parser/lib -d /home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs -t 1 started
DA: <--- Notification: {
"type" : "event",
"jsonrpc" : "2.0",
"body" : {
"name" : "/home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs",
"startMethod" : "launch",
"systemProcessId" : 3332,
"isLocalProcess" : true
},
"event" : "process"
}
DA: <--- Response: {
"body" : {},
"seq" : 2,
"type" : "response",
"request_seq" : 2,
"success" : true,
"command" : "launch"
}
DA: done handle_req id=-2
DA: start aio read
DAx: connect from 127.0.0.1:47052
DAx: start aio read
DA: end aio read cnt=20
DA: line=<Content-Length: 52>
DA: start aio read
DA: end aio read cnt=2
DA: line=<>
DA: read data={"command":"loadedSources","type":"request","seq":3}
DA: read header={ "Content-Length" => 52 }
DA: ---> Request: {
"seq" : 3,
"type" : "request",
"command" : "loadedSources"
}
DA: handle_req id=-3
DA: method=_dapreq_loadedSources
DA: <--- Response: {
"type" : "response",
"success" : true,
"request_seq" : 3,
"command" : "loadedSources",
"body" : {
"sources" : [
{
"path" : "/home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs"
}
]
},
"seq" : 3
}
DA: done handle_req id=-3
DA: start aio read
DA: stderr No DB::DB routine defined at /home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs line 13.
No DB::DB routine defined at /home/jdratlif/perl5/perlbrew/perls/perl-5.18.4/lib/site_perl/5.18.4/Class/Singleton.pm line 106.
END failed--call queue aborted at /home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs line 13.
No DB::DB routine defined at /home/jdratlif/perl5/perlbrew/perls/perl-5.18.4/lib/site_perl/5.18.4/Log/Log4perl.pm line 5.
END failed--call queue aborted at /home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs line 13.
DA: <--- Notification: {
"event" : "output",
"body" : {
"output" : "No DB::DB routine defined at /home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs line 13.\r\n",
"category" : "stderr"
},
"jsonrpc" : "2.0",
"type" : "event"
}
DA: <--- Notification: {
"jsonrpc" : "2.0",
"type" : "event",
"event" : "output",
"body" : {
"output" : "No DB::DB routine defined at /home/jdratlif/perl5/perlbrew/perls/perl-5.18.4/lib/site_perl/5.18.4/Class/Singleton.pm line 106.\r\n",
"category" : "stderr"
}
}
DA: <--- Notification: {
"type" : "event",
"jsonrpc" : "2.0",
"body" : {
"category" : "stderr",
"output" : "END failed--call queue aborted at /home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs line 13.\r\n"
},
"event" : "output"
}
DA: <--- Notification: {
"event" : "output",
"body" : {
"output" : "No DB::DB routine defined at /home/jdratlif/perl5/perlbrew/perls/perl-5.18.4/lib/site_perl/5.18.4/Log/Log4perl.pm line 5.\r\n",
"category" : "stderr"
},
"jsonrpc" : "2.0",
"type" : "event"
}
DA: <--- Notification: {
"type" : "event",
"jsonrpc" : "2.0",
"body" : {
"category" : "stderr",
"output" : "END failed--call queue aborted at /home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs line 13.\r\n"
},
"event" : "output"
}
DAx: end aio read cnt=
DA: stderr (in cleanup) No DB::DB routine defined at /home/jdratlif/perl5/perlbrew/perls/perl-5.18.4/lib/site_perl/5.18.4/Log/Log4perl/Logger.pm line 82 during global destruction.
(in cleanup) No DB::DB routine defined at /home/jdratlif/perl5/perlbrew/perls/perl-5.18.4/lib/site_perl/5.18.4/Log/Log4perl/Appender.pm line 300 during global destruction.
(in cleanup) No DB::DB routine defined at /home/jdratlif/perl5/perlbrew/perls/perl-5.18.4/lib/site_perl/5.18.4/Log/Log4perl/Appender.pm line 300 during global destruction.
DA: <--- Notification: {
"body" : {
"output" : "\t(in cleanup) No DB::DB routine defined at /home/jdratlif/perl5/perlbrew/perls/perl-5.18.4/lib/site_perl/5.18.4/Log/Log4perl/Logger.pm line 82 during global destruction.\r\n",
"category" : "stderr"
},
"event" : "output",
"jsonrpc" : "2.0",
"type" : "event"
}
DA: <--- Notification: {
"type" : "event",
"jsonrpc" : "2.0",
"event" : "output",
"body" : {
"category" : "stderr",
"output" : "\t(in cleanup) No DB::DB routine defined at /home/jdratlif/perl5/perlbrew/perls/perl-5.18.4/lib/site_perl/5.18.4/Log/Log4perl/Appender.pm line 300 during global destruction.\r\n"
}
}
DA: <--- Notification: {
"jsonrpc" : "2.0",
"type" : "event",
"body" : {
"output" : "\t(in cleanup) No DB::DB routine defined at /home/jdratlif/perl5/perlbrew/perls/perl-5.18.4/lib/site_perl/5.18.4/Log/Log4perl/Appender.pm line 300 during global destruction.\r\n",
"category" : "stderr"
},
"event" : "output"
}
DA: /home/jdratlif/perl5/perlbrew/perls/perl-5.18.4/bin/perl -I /home/jdratlif/git/re-service-availability-report/lib -I /home/jdratlif/git/GRNOC-MRT-Parser/lib -d /home/jdratlif/git/re-service-availability-report/bin/re_service_availability_parse_logs -t 1 ended
DA: <--- Notification: {
"event" : "terminated",
"body" : null,
"type" : "event",
"jsonrpc" : "2.0"
}
DA: <--- Notification: {
"jsonrpc" : "2.0",
"type" : "event",
"body" : {
"exitCode" : 22
},
"event" : "exited"
}
DA: end aio read cnt=20
DA: line=<Content-Length: 79>
DA: start aio read
DA: end aio read cnt=2
DA: line=<>
DA: read data={"command":"disconnect","arguments":{"restart":false},"type":"request","seq":4}
DA: read header={ "Content-Length" => 79 }
DA: ---> Request: {
"seq" : 4,
"type" : "request",
"arguments" : {
"restart" : false
},
"command" : "disconnect"
}
DA: handle_req id=-4
DA: method=_dapreq_disconnect
DA: Send signal KILL to debuggee
DA: <--- Response: {
"type" : "response",
"command" : "disconnect",
"success" : true,
"request_seq" : 4,
"seq" : 4,
"body" : {}
}
DA: done handle_req id=-4
DA: start aio read
DA: end aio read cnt=
I decided to build perl 5.30.3 since that's close to what Linux Mint was using, and now it seems to work. Perhaps something is missing in perl 5.18.4.
I used the debugger with perl 5.18 in the past, but I do not have any system with perl 5.18 anymore to test.
If you are fine with your current solution just close the issue. If it's important for you to get it working, please try to debug a very simple perl program like print "Hello world\n"
and let me know if you face the same issue.
@jdratlif @richterger I managed to get it working with Centos 7 / perl 5.16. I will send you a PR but briefly I added a call DB::DB() after the require to get the symbols into memory before the target program is loaded and changed the prerequisites to 5.16 and warnings. Tested on Centos 7 with perl 5.16.3 and 5.32.0 from VSC and running the unit test.
Diffs
Perl/LanguageServer/DebuggerProcess.pm ../orig/Perl-LanguageServer-2.4.0/lib/Perl/LanguageServer/DebuggerProcess.pm
146c146
< $ENV{PERL5DB} = 'BEGIN { $| = 1 ; ' . $cwd . 'require Perl::LanguageServer::DebuggerInterface; DB::DB(); }' ;
---
> $ENV{PERL5DB} = 'BEGIN { $| = 1 ; ' . $cwd . 'require Perl::LanguageServer::DebuggerInterface }' ;
Perl/LanguageServer/Parser.pm ../orig/Perl-LanguageServer-2.4.0/lib/Perl/LanguageServer/Parser.pm
10c10
< use v5.16;
---
> use v5.18;
12c12
< no if $] >= 5.018, warnings => 'experimental'; # given, when, Smartmatch
---
> no warnings 'experimental' ;
14d13
< use feature 'switch';
Perl/LanguageServer.pm ../orig/Perl-LanguageServer-2.4.0/lib/Perl/LanguageServer.pm
3c3
< use v5.16;
---
> use v5.18;
Makefile.PL ../orig/Perl-LanguageServer-2.4.0/
1c1
< use v5.16;
---
> use v5.18;
ty @peterdragon im having the same issue, gonna test your solution
I want to thank you @peterdragon finally i was able to debug under perl 5.18
And of course a big thanks to @richterger for all his effort and this project
Trying to use the perl LanguageServer debugger in VS Code. I'm on CentOS 7, which has 5.16 perl as standard. I installed perl 5.18.4 with perlbrew and installed perl::LanguageServer with cpan minus.
Whenever I try to debug my program, it writes this in the debug console.
This is my launch.json.