You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PERLDB_OPTS="white_box" PERL5DB="use DB::Hooks qw'::Terminal ::TraceVariable NonStop'" perl -d $(which morbo) -w /home/kes/work/projects/modal_window/app/public/invoice/api-v1.yaml \
-w lib/ -w templates/ -w etc/ -w ext/ /home/kes/work/projects/modal_window/app/script/invoice
Use of uninitialized value $_[1] in string ne at /home/kes/work/projects/modal_window/app/local/lib/perl5/DB/Hooks.pm line 196.
Use of uninitialized value $_[1] in string ne at /home/kes/work/projects/modal_window/app/local/lib/perl5/DB/Hooks.pm line 196.
Web application available at http://127.0.0.1:3000
^C
Dumping new frames SUB:Syntax::SourceHighlight::DESTROY
main - /home/kes/work/projects/modal_window/app/local/bin/morbo - 0 - DB::__ANON__[/home/kes/work/projects/modal_window/app/local/lib/perl5/DB/Hooks.pm:615]
main - /home/kes/work/projects/modal_window/app/local/bin/morbo - 0 - (eval)
(in cleanup) Modification of non-creatable array value attempted, subscript -1 at /home/kes/work/projects/modal_window/app/local/lib/perl5/DB/Hooks.pm line 196 during global destruction.
Dumping new frames SUB:Syntax::SourceHighlight::LangMap::DESTROY
main - /home/kes/work/projects/modal_window/app/local/bin/morbo - 0 - DB::__ANON__[/home/kes/work/projects/modal_window/app/local/lib/perl5/DB/Hooks.pm:615]
main - /home/kes/work/projects/modal_window/app/local/bin/morbo - 0 - (eval)
(in cleanup) Modification of non-creatable array value attempted, subscript -1 at /home/kes/work/projects/modal_window/app/local/lib/perl5/DB/Hooks.pm line 196 during global destruction.
Dumping new frames SUB:Syntax::SourceHighlight::DESTROY
main - /home/kes/work/projects/modal_window/app/local/bin/morbo - 0 - DB::__ANON__[/home/kes/work/projects/modal_window/app/local/lib/perl5/DB/Hooks.pm:615]
main - /home/kes/work/projects/modal_window/app/local/bin/morbo - 0 - (eval)
(in cleanup) Modification of non-creatable array value attempted, subscript -1 at /home/kes/work/projects/modal_window/app/local/lib/perl5/DB/Hooks.pm line 196 during global destruction.
Dumping new frames SUB:Syntax::SourceHighlight::LangMap::DESTROY
main - /home/kes/work/projects/modal_window/app/local/bin/morbo - 0 - DB::__ANON__[/home/kes/work/projects/modal_window/app/local/lib/perl5/DB/Hooks.pm:615]
main - /home/kes/work/projects/modal_window/app/local/bin/morbo - 0 - (eval)
(in cleanup) Modification of non-creatable array value attempted, subscript -1 at /home/kes/work/projects/modal_window/app/local/lib/perl5/DB/Hooks.pm line 196 during global destruction.
DB/Hooks.pm
...
sub sub {
DB::state( 'ddd' ); <<< here is line 615
...
sub dbstate {
my( $name, $value ) = @;
return @>1 ? $DB::state[-1]{ ddd } = $value : $DB::state[-1]{ ddd } // 0
if $name eq 'ddd';
Description
I am using Syntax::SourceHighlight to highlight code at my debugger. This module is loaded from my debugger like this:
package DB::Commands;
...
my $hl; << I expect to see these package lines when `caller` dumps frames when `DESTROY` sub is called
my $lm; <<
sub highlighting {
require Syntax::SourceHighlight;
$hl = Syntax::SourceHighlight->new('esc.outlang');
$lm = Syntax::SourceHighlight::LangMap->new();
$hl->setStyleFile('esc256.style');
return 1;
}
my $highlight = $is_exists && !$ENV{ DEBUGGER_NO_COLOR } ? highlighting() : 0;
I do not see DESTROY subs at Syntax::SourceHighlight or Syntax::SourceHighlight::LangMap files.
Because these modules are loaded before debugger they are destroyed later, after debugger. Stack looks like this:
Syntax::* are loaded
debugger is loaded
... body of a debugged script
debugger is destroyed << error happened somewhere here, I assume.
Syntax::* are destroyed
During destruction at DB::state sub when I perl tries to run $DB::state[-1] code, the @DB::state array does not exists already (or empty?). And error is occurred.
I dumped from DB::state frames to check from which part of code this call was done
my $lvl;
my $count //= -1; # infinite
my @frames;
local $" = ' - ';
while( $count-- && (my @frame = caller( ++$lvl )) ) {
push @frames, [ @frame[0..3] ];
}
print $DB::OUT "\n\nDumping new frames SUB:$_[2] \n";
print $DB::OUT "@$_\n" for @frames;
I found this line:
main - /home/kes/work/projects/modal_window/app/local/bin/morbo - 0 - (eval)
We see this, because perl adds debuger loading into the source of the debugged script as use DB::Hooks.... as line 0.
It looks like it makes sense, because everything should be destroyed when program is finished, but $hm and $lm are not located at the main script, but these variables actually are located at DB::Commands module. So I expect to see path to DB::Commands package and line where $hm, $lm were defined.
Steps to Reproduce
None. You do not have sources for this debugger. By I tried to describe in details what is going on here.
Expected behavior
When DESTROY is called caller should dump package:line from where these objects were destroyed, or, as another solution, where they were created: $hl = ->new() and $lm = ->new()` lines.
From what I can see global destruction is done with PL_curcop pointing at PL_compiling, which due to the way the values get saved as we recurse during compilation I expect will be set to the script name and line 0.
So the caller you're seeing here seems reasonable.
Note that there's no code in your DB::Commands package doing the destruction, that's being done by perl in perl_destruct.
If you do want DB::Commands in the backtrace you could add END { undef $hl; } to DB/Commands.pm.
Context
DB/Hooks.pm
...
sub sub {
DB::state( 'ddd' ); <<< here is line 615
...
sub dbstate {
my( $name, $value ) = @;
return @>1 ? $DB::state[-1]{ ddd } = $value : $DB::state[-1]{ ddd } // 0
if $name eq 'ddd';
Description
I am using
Syntax::SourceHighlight
to highlight code at my debugger. This module is loaded from my debugger like this:I do not see
DESTROY
subs atSyntax::SourceHighlight
orSyntax::SourceHighlight::LangMap
files.Because these modules are loaded before debugger they are destroyed later, after debugger. Stack looks like this:
During destruction at
DB::state
sub when I perl tries to run$DB::state[-1]
code, the@DB::state
array does not exists already (or empty?). And error is occurred.I dumped from
DB::state
frames to check from which part of code this call was doneI found this line:
We see this, because perl adds debuger loading into the source of the debugged script as
use DB::Hooks....
as line 0.It looks like it makes sense, because everything should be destroyed when program is finished, but
$hm
and$lm
are not located at the main script, but these variables actually are located atDB::Commands
module. So I expect to see path toDB::Commands
package and line where$hm
,$lm
were defined.Steps to Reproduce
None. You do not have sources for this debugger. By I tried to describe in details what is going on here.
Expected behavior
When
DESTROY
is calledcaller
should dump package:line from where these objects were destroyed, or, as another solution, where they were created:$hl = ->new()
and$lm =
->new()` lines.Perl configuration
The text was updated successfully, but these errors were encountered: