Adding tests to and refactoring the perl debugger - Grant Report #1

No Comments

Shlomi Fish reported:

2012-Aug-28:

  • I received the E-mail that my grant for improving the Perl debugger was accepted in the afternoon today ( 2012-Aug-28 ). My grant manager will be Alan Haggai Alavi, whom I talked with and successfully collaborated with in the past.

  • I decided to start working.

  • I checked the pending tests on my shlomif-perl-d-add-tests-take-2-may-git-burn-in-hell (titled so because git has given me some trouble in the past incarnation of the branch), and after merging the changesets from bleadperl, made sure all tests pass (by re-running Configure, make and make test), and submitted a ticket with a patch with new tests:

    • https://rt.perl.org:443/rt3/Ticket/Display.html?id=114644

    • Notes:

      • To run the make in parallel do make -j4 (for 4 cores).
      • To run the tests in parallel do make -j12 test_harness TEST_JOBS=4" (the -j12 does not affect the tests, just makes sure the dependencies scanning goes quickly).
      • make test_harness TEST_FILES='../lib/perl5db.t' tests only the debugger.
  • Then I experimented with measuring coverage in the debugger. My first attempt was this script: https://gist.github.com/3583186

This caused some tests to fail. I decided not to investigate further for the time being (having spent a lot of time on it), and instead tried Devel::Cover.

  • After experimenting with several ways to enable Devel::Cover the most promising way appeared to be adding a use Devel::Cover; statement to the top of lib/perl5db.pl.

    • This caused some of the tests to segfault in lib/perl5db.t.

    • I decided to stop investigating for now.

    • TODO : Report a bug in Devel::Cover.

  • I talked with a friend on IM and he suggested completely replacing lib/perl5db.pl with either Devel::Ebug or Devel::Trepan. I noted Devel::Trepan was GPLv2+ + Artistic instead of GPLv1+ + Artistic like perl is, which may be problematic, and that its code exhibits some strange things such as prototypes for methods and multiple pragmas on the same lines, and that the author refused to apply a patch which remedied them (for his own reasons).

It's also not completely compatible with perl -d, which means a compatible interface should be written for it, and that adding tests against the current perl debugger with its current behaviour will help test that.

2012-Aug-30:

  • I added a test for the f debugger command, by copying, pasting and modifying a previous test (for the b [filename]:[line]). It runs nicely.

  • As I was testing the /pattern/ command I noticed it failed due to an exception. This turned out to have been caused by the fact that string eval inside the debugger did not handle lexical variables well. This was fixed along with a regression test and some future TODOs.

  • I added a test for the ?pattern? command (to search backward), and this time the test worked immediately, though I'm not sure why the bug is not exhibited now. Maybe due to the previous use vars (...).

  • I sent an up-to-date patch on the previous bug report.

2012-Aug-31:

  • I fixed the older patch by removing an extraneous $i++ (only $i was needed) that was reported in perl5-porters.

  • Reverted some of the changes that invovled converting C-style for(;;) loops into while/continue blocks.

  • Submitted a new patch to the rt.perl.org ticket.

2012-Sep-01:

Leave a comment

About TPF

The Perl Foundation - supporting the Perl community since 2000. Find out more at www.perlfoundation.org.

About this Entry

This page contains a single entry by Alan Haggai Alavi published on September 1, 2012 5:03 PM.

2012Q3 Grant Proposals - Results was the previous entry in this blog.

Improving Perl 5: Grant Report for Month 11 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.38