Skip to content

Commit

Permalink
Fixed references handling in debugger
Browse files Browse the repository at this point in the history
- Suppressed any squashing
- Proper expanding
- Some rendering improvements

This is unfinished fix, see #58
  • Loading branch information
hurricup committed Jul 8, 2021
1 parent 7c94956 commit c530dcd
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions lib/Devel/Camelcadedb.pm
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ sub _get_reference_subelements
}
elsif ($reftype eq 'REF')
{
push @$data, _get_reference_descriptor( $source_data, \$$source_data );
push @$data, _get_reference_descriptor($source_data, $$source_data);
}
elsif ($reftype eq 'GLOB')
{
Expand Down Expand Up @@ -583,22 +583,13 @@ sub _get_reference_descriptor
$is_utf = defined $$value && utf8::is_utf8( $$value ) ? \1 : \0;
$value = defined $$value ? "\"$$value\"" : 'undef'; #_escape_scalar(
}
elsif ($reftype eq 'REF')
{
my $target_reftype = Scalar::Util::reftype($$value);
elsif ($reftype eq 'REF') {
$type = overload::StrVal($$value) || 'unknown';
$tied = tied $value;

if ($target_reftype eq 'REF' || $tied) {
# deep reference or tied reference, using expanding
$size = 1;
$expandable = \1;
$value = "Reference";
}
else {
my $result = _get_reference_descriptor($name, $$value);
$result->{ref_depth}++;
return $result;
}
$size = 1;
$expandable = \1;
$ref_depth = 1;
$ref = undef; # to prevent rendering data
}
elsif ($reftype eq 'ARRAY')
{
Expand Down

0 comments on commit c530dcd

Please sign in to comment.