Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger displays wrong lexical and global variables #58

Open
hurricup opened this issue Jul 8, 2021 · 0 comments
Open

Debugger displays wrong lexical and global variables #58

hurricup opened this issue Jul 8, 2021 · 0 comments
Labels

Comments

@hurricup
Copy link
Collaborator

hurricup commented Jul 8, 2021

Because of references mess, we show @_ and lexicals/globals differently.

Reproduction example (put a breakpoint at say 1;

use strict;
use warnings FATAL => 'all';
use v5.10;

my $scalar = 'test';
say $scalar;
my $scalar_ref = \$scalar;
say $scalar_ref;
my $scalar_ref_ref = \$scalar_ref;
say $scalar_ref_ref;

my @array = ('tests');
say @array;
my $array_ref = \@array;
say $array_ref;
my $array_ref_ref = \$array_ref;
say $array_ref_ref;

my %hash = (key => 'val');
say %hash;
my $hash_ref = \%hash;
say $hash_ref;
my $hash_ref_ref = \$hash_ref;
say $hash_ref_ref;

my $glob = *STDOUT;
say STDOUT $glob;
my $glob_ref = \$glob;
say $glob_ref;
my $glob_ref_ref = \$glob_ref;
say $glob_ref_ref;

my $code = sub{}; # actually a ref
say $code;
my $code_ref = \$code;
say $code_ref;
my $code_ref_ref = \$code_ref;
say $code_ref_ref;

sub something {
    say 1;
}

something(
    $scalar, $scalar_ref, $scalar_ref_ref,
    @array, $array_ref, $array_ref_ref,
    %hash, $hash_ref, $hash_ref_ref,
    $glob, $glob_ref, $glob_ref_ref,
    $code, $code_ref, $code_ref_ref
);

Expected: same results for lexical vars and something arguments.
Actually: lexical and globals has another level of reference. Because peek_my and peek_our returns names and references, not values (not possible to return value of array or hash.

@hurricup hurricup added the bug label Jul 8, 2021
hurricup added a commit that referenced this issue Jul 8, 2021
- Suppressed any squashing
- Proper expanding
- Some rendering improvements

This is unfinished fix, see #58
hurricup added a commit to Camelcade/Perl5-IDEA that referenced this issue Jul 27, 2021
hurricup added a commit to Camelcade/Perl5-IDEA that referenced this issue Jul 27, 2021
We need more tests.

See: Camelcade/Devel-Camelcadedb#58
(cherry picked from commit 90da4df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant