Giter Site home page Giter Site logo

devel-chitin's People

Contributors

brummett avatar dsteinbrunner avatar jkeenan avatar manwar avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

devel-chitin's Issues

allow running to sub return

It's like step out... It gives control after the return, but before the next statement after the return, and allows the user to change the return value if they want

We'll need this to implement brummett/Devel-hdb#21

Standardize names for things

For example, a Location object has param named "filename", but Breakpoints take "file".

There are probably others. Check the constructors/properties for clues

Trace/Follow mode should allow filters

For example, code in one file changes, and causes different execution in some far-off module. Allow the user to filter out the known change and see what down-stream thing changes.

Add code coverage to the test suite

Devel::Cover is the standard here, but it likely requires the debugger API all to itself.

Alternatively, create a code coverage plugin like Devel::hdb::TraceFollow to do simple line-by-line code coverage. It can be made more capable later.

21-trace-anon-sub test failure

this test has a couple of failures from the 0.15 upload. For example: http://www.cpantesters.org/cpan/report/08088a6e-0b98-11e8-af2b-acaf1d79aee4

Statement unlikely to be reached at (eval 587) line 3.
	(Maybe you meant system() when you said exec()?)

#   Failed test 'next_statement for line 16'
#   at t/21-trace-anon-sub.t line 54.
#          got: '@trace'
#     expected: 'sub {
# 	$a = shift;
# 	$b = 2;
# 	$a + $b
# }->(1)'
# stopped at line 16 callsite 0x81a7ee8c
# 

#   Failed test 'next_statement for line 13'
#   at t/21-trace-anon-sub.t line 54.
#          got: '$a + $b'
#     expected: '$a = shift'
# stopped at line 13 callsite 0x81a7a7fc
Don't know how to handle anonymous subs yet at t/21-trace-anon-sub.t line 61.

#   Failed test 'next_statement for line 1'
#   at /home/njh/perl5/perlbrew/perls/perl-5.18.2-thread-multi-ld/lib/site_perl/5.18.2/Test/Builder.pm line 152.
#          got: 'test2_set_is_end()'
#     expected: '$b = 2'
# stopped at line 1 callsite 0x81c56604
Can't locate object method "_build" via package "Devel::Chitin::OpTree::NULL" at lib/Devel/Chitin/OpTree.pm line 111.
END failed--call queue aborted at t/21-trace-anon-sub.t line 100.
# Looks like your test exited with 22 just after 3.
	(in cleanup) Can't locate object method "_build" via package "Devel::Chitin::OpTree::NULL" at lib/Devel/Chitin/OpTree.pm line 111 during global destruction.
t/21-trace-anon-sub.t .............. 
Failed 5/5 subtests 

Investigate rejecting breakpoints in top-scope of modules

This issue (brummett/Devel-hdb#115) in Devel::hdb was caused by a bug in perl caused by setting a breakpoint in a module's top scope after it's run. Internally, Perl frees some memory associated with these lines' OPs since they've already run and can never run again. The same problem can occur in the top-scope of any eval.

The fix for that test was to set the breakpoint to a line within a sub.

Investigate what it would take to reject setting one of these kinds of breakpoints. The first thing that comes to mind is to find that line's COP and determine whether it's within a sub (safe) or in the top-scope (unsafe).

Deparse failure with dev Perl - pp_aelemfastlex_store

After fixing #83, a new error appears:

Use of uninitialized value $got in concatenation (.) or string at t/20-optree-deparse.t line 91.
    not ok 8 - t/20-optree-deparse/01-assignment/list_index_assignment
    # Failed test 't/20-optree-deparse/01-assignment/list_index_assignment'
    # at t/20-optree-deparse.t line 91.
    # +-----+----+---------------------------+
    # | GOT | OP | CHECK                     |
    # +-----+----+---------------------------+
    # | \n  | eq | (@the_list, $idx);\n      |
    # |     |    | $the_list[2] = 'foo';\n   |
    # |     |    | $the_list[$idx] = 'bar'\n |
    # +-----+----+---------------------------+
Use of uninitialized value $got in split at t/20-optree-deparse.t line 92.
    # Showing whitespace:
    # >><<
    # $@: Can't locate object method "pp_aelemfastlex_store" via package "Devel::Chitin::OpTree::UNOP" at lib/Devel/Chitin/OpTree.pm line 182.
    #
    # Tree:
UNOP leavesub (KIDS)  BARE, SLICE 0x7fc74d362bb0
  LISTOP lineseq (KIDS, PARENS)   0x7fc74d364550
    COP nextstate (WANT_LIST, WANT_VOID) (eval 76):1  0x7fc74d364820
    LISTOP list (KIDS, PARENS, WANT_LIST, WANT_VOID)   0x7fc74d364b68
      OpTree padrange (MOD, WANT_LIST, WANT_VOID)   0x7fc74d364c40
      OpTree padav (MOD, WANT_LIST, WANT_VOID) @the_list  0x7fc74d364f70
      OpTree padsv (MOD, WANT_LIST, WANT_VOID) $idx  0x7fc74d365048
    COP nextstate (WANT_LIST, WANT_VOID) (eval 76):2  0x7fc74d365120
    UNOP aelemfastlex_store (KIDS, STACKED, WANT_LIST, WANT_VOID)   0x7fc74d365240
      SVOP const (WANT_LIST, WANT_SCALAR) 'foo'  0x7fc74d365300
      BINOP null (ex-pp_aelem) (KIDS, MOD, REF, SPECIAL, WANT_LIST, WANT_SCALAR)   0x7fc74d365418
        OpTree null (ex-pp_aelemfast_lex) (MOD, REF, WANT_LIST, WANT_SCALAR)   0x7fc74d3654d8
        OpTree null (ex-pp_const) (WANT_LIST, WANT_SCALAR)   0x7fc74d365820
    COP nextstate (WANT_LIST, WANT_VOID) (eval 76):3  0x7fc74d3658f8
    BINOP sassign (KIDS, STACKED, WANT_LIST, WANT_SCALAR)   0x7fc74d365a30
      SVOP const (WANT_LIST, WANT_SCALAR) 'bar'  0x7fc74d365b20
      UNOP null (ex-pp_aelem) (KIDS, MOD, REF, SPECIAL, WANT_LIST, WANT_SCALAR)   0x7fc74d365bc8
        UNOP_AUX multideref (KIDS, MOD, WANT_LIST, WANT_SCALAR)   0x7fc74d365ca0
not ok 1 - Subtest: t/20-optree-deparse/01-assignment
# Failed test 'Subtest: t/20-optree-deparse/01-assignment'
# at t/20-optree-deparse.t line 43.

It's related to this Perl PR that defined the new opcode for combined sassign/aelem: Perl/perl5#20063

07-stack.t failure on 0.15

Several failures for this test. For example: http://www.cpantesters.org/cpan/report/c3873cfe-0b9d-11e8-af2b-acaf1d79aee4
and http://www.cpantesters.org/cpan/report/391ff954-0b9b-11e8-af2b-acaf1d79aee4

#   Failed test 'callsite has a value'
#   at t/07-stack.t line 245.

#   Failed test 'callsite has a value'
#   at t/07-stack.t line 245.
Undefined value assigned to typeglob at lib/Devel/Chitin.pm line 659.
# Looks like you failed 2 tests of 79.
Child test program exited with status 512 at t/07-stack.t line 36.
t/07-stack.t ....................... 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/79 subtests 

Tests fail on Windows due to interpolation of path into regex pattern

See also my blog post "You've gotta quotemeta!" for background.

C:\...\Devel-Chitin-0.06> prove -b t\07-stack.t
t\07-stack.t .. 1/79
#   Failed test 'Execution stack frame filename matches: (?^:\(eval \d+\)\[t\07-stack.t:27\]):1'
#   at t\07-stack.t line 255.
#                   '(eval 9)[t\07-stack.t:27]'
#     doesn't match '(?^:\(eval \d+\)\[t\07-stack.t:27\])'

#   Failed test 'Execution stack frame filename matches: (?^:\(eval \d+\)\[t\07-stack.t:27\]):1 iterator'
#   at t\07-stack.t line 255.
#                   '(eval 9)[t\07-stack.t:27]'
#     doesn't match '(?^:\(eval \d+\)\[t\07-stack.t:27\])'
# Looks like you failed 2 tests of 79.
Child test program exited with status 512 at t\07-stack.t line 36.
t\07-stack.t .. Dubious, test returned 25 (wstat 6400, 0x1900)
Failed 2/79 subtests

Fixed by changing line 64 in t\07-stack.t to:

        filename    => qr/\(eval \d+\)\[\Q$filename\E:27\]/,

Also:

C:\...\Devel-Chitin-0.06> prove -b t\15-subroutine-location.t
t\15-subroutine-location.t .. 1/25
#   Failed test 'Bar::sub_in_eval location filename'
#   at t\15-subroutine-location.t line 41.
#                   '(eval 9)[t\15-subroutine-location.t:22]'
#     doesn't match '(?^:^\(eval \d+\)\[t\15-subroutine-location.t:22\]$)'
# Looks like you failed 1 test of 25.
Child test program exited with status 256 at t\15-subroutine-location.t line 29.
t\15-subroutine-location.t .. Dubious, test returned 25 (wstat 6400, 0x1900)
Failed 1/25 subtests

Test Summary Report
-------------------
t\15-subroutine-location.t (Wstat: 6400 Tests: 25 Failed: 1)
  Failed test:  21
  Non-zero exit status: 25
Files=1, Tests=25,  1 wallclock secs ( 0.06 usr +  0.00 sys =  0.06 CPU)
Result: FAIL

Fixed by line 99 in t\15-subroutine-location.t to

        filename => qr{^\(eval \d+\)\[\Q$this_file\E:22\]$},

HTH.

Allow running to sub return

It's like step out... It gives control after the return, but before the next statement after the return, and allows the user to change the return value if they want

Perl 5.37.6 compatibility

Hello,

Per Perl/perl5#20384, this module is currently broken on development perls.

At issue are two tests: t/20-optree-deparse.t and t/21-deparse-trace-anon-sub.t. There is a PR that fixes t/21-deparse-trace-anon-sub.t, but t/20-optree-deparse.t, since it makes assumptions about how Perl parses code into ops, may be “legitimate” breakage.

Are you able to investigate this?

Can't call next_statement() within init

Found while rewriting some of the tests. Looks like current_location isn't set until after it's called init() on all the registered debuggers. Try moving where it's set to above the call to init()s

add method continue_to()

Should accept either a subroutine name (qualified or not) or file name + line number. It will create a 'once' breakpoint to fire when it reaches there.

Can't locate object method "_build" via package "Devel::Chitin::OpTree::NULL" using -d:hdb

I'm getting this message at the end of every run using hdb.

Here's a trivial reproduction. Same on 5.10.1 and 5.36.0.

$ perl -d:hdb -e1
Debugger pid 22503 listening on http://127.0.0.1:8080/debugger-gui
Debugged program pid 22503 terminated with exit code 0
Trapped exception getting next statement: Can't locate object method "_build" via package "Devel::Chitin::OpTree::NULL" at /usr/local/share/perl5/Devel/Chitin/OpTree.pm line 115.

(after clicking "Run" button in web page)

deparse test fails in latest blead perl 5.35.10

A copy of the report from the RT system: https://rt.cpan.org/Public/Bug/Display.html?id=141554

Correction of a bug in the development branch of the Perl 5 core distribution has triggered a failure in one of Devel-Chitin's test files.

The change in Perl 5 is found here:
Perl/perl5@bb5bc9

The "Blead Breaks CPAN" issue ticket covering this case can be found here:
Perl/perl5#19462

A portion of the output from the failing test file can be found here:
Perl/perl5#19462 (comment)

Here is a CPANtesters report documenting this test failure:
http://www.cpantesters.org/cpan/report/9e68c4d0-9512-11ec-9dd8-3807b7968dbf

It sometimes happens that correction of a bug in the Perl 5 core distribution exposes problems in CPAN code that the bug was previously covering up. That may be the case here, but further investigation is needed.

Thank you very much.
Jim Keenan

Deparse failures with latest dev Perl (pp_padsv_store)

5.37.3 and 5.37.4 both have several deparse related failures. Here's the 5.37.4 report: http://www.cpantesters.org/cpan/report/d41228da-2674-11ed-86cf-e3977c1fe49f

One type of failure (Can't locate object method "pp_padsv_store" via package "Devel::Chitin::OpTree::UNOP") is from an item mentioned in the 5.37.3 changelog. There's a new OP named OP_PADSV_STORE that combines a couple of ops sassign+padsv. The PR for it is here: https://github.com/Perl/perl5/pull/19943/files

Enable CI testing with Github Actions

Once upon a time, this repo and Devel::hdb had TravisCI set up to test many Perl versions on each PR. This was very valuable. TravisCI has since gone away and is replaced with Github Actions.

Here are some links to getting it working with Perl modules:
https://github.com/FGasper/perl-github-action-tips
https://perlmaven.com/ci
https://perlmaven.com/os
https://simbabque.github.io/posts/github-workflow-guide-for-modules/
https://github.com/Perl/docker-perl-tester

It should test on the latest point release of each release version (even numbers) as well as the latest
dev release and perl-blead. Also include threaded versions.

Deparse failures with dev Perl - PV is not a method on B::SPECIAL

5.37.3 and 5.37.4 both have several deparse related failures. Here's the 5.37.4 report: http://www.cpantesters.org/cpan/report/d41228da-2674-11ed-86cf-e3977c1fe49f

The error "Can't locate object method "PV" via package "B::SPECIAL"" comes up several times in the test runs. The offending function is Devel::Chitin::OpTree::pp_padsv(), used to get the name of a variable. It might be related to #83 which defines a new OP for assigning to a variable

07-stack.t failures on freebsd and perl 5.10

Seems to be failing pretty regularly, for example: http://www.cpantesters.org/cpan/report/1ab0a526-c6dc-11e7-abde-b912e8d69c8f

#   Failed test 'callsite has a value'
#   at t/07-stack.t line 245.

#   Failed test 'callsite has a value'
#   at t/07-stack.t line 245.
# Looks like you failed 2 tests of 79.
Child test program exited with status 512 at t/07-stack.t line 36
t/07-stack.t ....................... 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/79 subtests 

It's failed 9 out of 10 times on freebsd and perl 5.10.0 or 5.10.1. Strangely it passed once?!

Stepping over lvalue sub dies

Stepping-over a line that executes an lvalue sub dies with the error Can't modify non-lvalue subroutine call of &DB::sub. This sample program demonstrates the issue:

my $x = 1;
sub x : lvalue {
    $x;
}
print "$x\n";
x() = 2;    # Dies here!
print "$x\n";

This issue originates from https://rt.cpan.org/Ticket/Display.html?id=127319. The original reporter says the standard perl debugger handles his example, so there should be a clue about handling lvalue subs in perl5db.

21-trace-statements and 21-trace-fib tests fail with 0.15

A couple of test runs for 0.15 failed similarly. For example: http://www.cpantesters.org/cpan/report/08088a6e-0b98-11e8-af2b-acaf1d79aee4

trace-statements:

#   Failed test 'next_statement for line 12'
#   at t/21-trace-fib.t line 63.
#          got: '@trace'
#     expected: '$answer = fib(3)'
# stopped at line 12 callsite 0x81378ec0
# 

#   Failed test 'next_statement for line 14'
#   at t/21-trace-fib.t line 63.
#          got: 'return(fib($n - 1) + fib($n - 2))'
#     expected: '$n = shift'
# stopped at line 14 callsite 0x813747ec

#   Failed test 'next_statement for line 12'
#   at t/21-trace-statements.t line 90.
#          got: '@trace'
#     expected: '$line = 12'
# stopped at line 12 callsite 0x81094080
# 

#   Failed test 'next_statement for line 15'
#   at t/21-trace-fib.t line 63.
#          got: 'return(fib($n - 1) + fib($n - 2))'
#     expected: 'return(1) if $n <= 1'
# stopped at line 15 callsite 0x81873868
# 
Can't call method "op" on an undefined value at lib/Devel/Chitin.pm line 405.

#   Failed test 'next_statement for line 1'
#   at /home/njh/perl5/perlbrew/perls/perl-5.18.2-thread-multi-ld/lib/site_perl/5.18.2/Test/Builder.pm line 152.
#          got: 'test2_set_is_end()'
#     expected: '$i = 0'
# stopped at line 1 callsite 0x81596e94
Can't locate object method "_build" via package "Devel::Chitin::OpTree::NULL" at lib/Devel/Chitin/OpTree.pm line 111.
END failed--call queue aborted at t/21-trace-statements.t line 405.
# Looks like your test exited with 22 just after 2.
	(in cleanup) Can't locate object method "_build" via package "Devel::Chitin::OpTree::NULL" at lib/Devel/Chitin/OpTree.pm line 111 during global destruction.
	(in cleanup) Can't locate object method "_build" via package "Devel::Chitin::OpTree::NULL" at lib/Devel/Chitin/OpTree.pm line 111 during global destruction.
Child test program exited with status 5632 at t/21-trace-statements.t line 7.
t/21-trace-statements.t ............ 
Dubious, test returned 22 (wstat 5632, 0x1600)
Failed 51/51 subtests 

and trace-fib

#   Failed test 'next_statement for line 14'
#   at t/21-trace-fib.t line 63.
#          got: 'return(fib($n - 1) + fib($n - 2))'
#     expected: '$n = shift'
# stopped at line 14 callsite 0x813747ec
# 

#   Failed test 'next_statement for line 15'
#   at t/21-trace-fib.t line 63.
#          got: 'return(fib($n - 1) + fib($n - 2))'
#     expected: 'return(1) if $n <= 1'
# stopped at line 15 callsite 0x81873868
# 

#   Failed test 'next_statement for line 14'
#   at t/21-trace-fib.t line 63.
#          got: 'return(fib($n - 1) + fib($n - 2))'
#     expected: '$n = shift'
# stopped at line 14 callsite 0x813747ec
# 

#   Failed test 'next_statement for line 15'
#   at t/21-trace-fib.t line 63.
#          got: 'return(fib($n - 1) + fib($n - 2))'
#     expected: 'return(1) if $n <= 1'
# stopped at line 15 callsite 0x81873868
# 

#   Failed test 'next_statement for line 14'
#   at t/21-trace-fib.t line 63.
#          got: 'return(fib($n - 1) + fib($n - 2))'
#     expected: '$n = shift'
# stopped at line 14 callsite 0x813747ec
# 

#   Failed test 'next_statement for line 15'
#   at t/21-trace-fib.t line 63.
#          got: 'return(fib($n - 1) + fib($n - 2))'
#     expected: 'return(1) if $n <= 1'
# stopped at line 15 callsite 0x81873868
# 

#   Failed test 'next_statement for line 14'
#   at t/21-trace-fib.t line 63.
#          got: 'return(fib($n - 1) + fib($n - 2))'
#     expected: '$n = shift'
# stopped at line 14 callsite 0x813747ec
# 

#   Failed test 'next_statement for line 15'
#   at t/21-trace-fib.t line 63.
#          got: 'return(fib($n - 1) + fib($n - 2))'
#     expected: 'return(1) if $n <= 1'
# stopped at line 15 callsite 0x81873868
# 
t/21-trace-fib.t ................... 
Failed 11/13 subtests 

Devel::StackTrace

Consider using Devel::StackTrace instead of our Devel::Chitin::Stack

Won't install on 5.8.9

Since the inclusion of

[Prereqs / TestRequires ]
experimental = 0

in dist.ini (because of the optree.t test), Devel::Chitin won't install with cpanm, since experimental.pm won't install on 5.8.

Work out some solution. Maybe a patch to experimental to allow it to install, even though it won't do anything. Maybe work out the install process so it won't try installing on 5.8, and ensure it won't be using when testing on 5.8.

21* test failures on 0.15

0.15 had several runs fail the 21* tests. For example: http://www.cpantesters.org/cpan/report/33220972-0b99-11e8-af2b-acaf1d79aee4

Each test fails similarly:

Can't call method "op" on an undefined value at lib/Devel/Chitin.pm line 354.

#   Failed test 'next_statement for line 2589'
#   at t/21-trace-anon-sub.t line 54.
#          got: '$Test->_ending() if defined($Test)'
#     expected: '$a = shift'
# stopped at line 2589 callsite 0x813e4e0c
Can't locate object method "_build" via package "Devel::Chitin::OpTree::NULL" at lib/Devel/Chitin/OpTree.pm line 111.
END failed--call queue aborted.
	(in cleanup) Can't locate object method "_build" via package "Devel::Chitin::OpTree::NULL" at lib/Devel/Chitin/OpTree.pm line 111 during global destruction.
Child test program exited with status 5632 at t/21-trace-anon-sub.t line 7.
t/21-trace-anon-sub.t .............. 
Dubious, test returned 22 (wstat 5632, 0x1600)
Failed 5/5 subtests 

Investigate using $^P instead of $in_debugger

Look into clearing the lowest-order two bits from $^P

  • 0x01 Debug subroutine enter/exit
  • 0x02 Line-by-line debugging
    instead of using the flag $in_debugger. It might simplify finding the first program frame when constructing the Stack object, too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.