develooper Front page | perl.perl5.porters | Postings from October 2012

[perl5db refactoring Grant] Report + Requestion Ideas for FurtherWork

Thread Next
From:
Shlomi Fish
Date:
October 16, 2012 10:47
Subject:
[perl5db refactoring Grant] Report + Requestion Ideas for FurtherWork
Message ID:
20121016194712.6d6569df@lap.shlomifish.org
Hi all,

as you may recall, I received a grant for improving the Perl debugger (writing
tests and refactoring) and have been working on it in this branch:

https://github.com/shlomif/perl/tree/shlomif-perl-d-refactoring

this is a report of the work's status.

My first steps involved adding many tests to lib/perl5db.t (and doing some refactoring
work there) to get a better coverage. I was able to cover most of the commands
that are not too platform or system-dependent.

Eventually, I got tired of just adding tests all the time, and started actually
refactoring lib/perl5db.pl. This was done in many separate commits. Some of the stuff
I did was:

1. Get rid of leading ampersands from subroutine calls.

2. Extract many subroutines.

3. Extract a DB::Obj class which is used by an object that is effectively a
singleton for the duration of the DB::DB subroutine.

4. Convert most commands to a dispatch table and with ->cmd_verb() and cmd_args()
accessors for easier (and possibly somewhat faster) parsing.

5. Fix some bugs in the way (some of them introduced by the refactoring). 

6. Convert every debugger command to its own subroutine call.

7. Clean up and modernise the regular expressions' syntaxes and invocations.

Now in commit https://github.com/shlomif/perl/commit/2cecf8a09111a2471774a7501c91f6059dd953cd
(= latest as of today), I feel that a large part of my aims has already been covered. 

Aside from merging the commit that RJBS (= Ricardo Signes, the Perl pumpking) pointed to
about doing share( ... ) instead of &share ( ... ) (which I'd like to know the branch of),
and putting the commits in the blead branch (they are all rebased based on blead), I could
now use some inspiration for what to do next.

While I can go over the code again and look for
code smells ( http://en.wikipedia.org/wiki/Code_smell ), I'd like to ask if you can think
of any further debugger pet peeves that you'd like to get fixed? Do you think it would be a good
idea to add "use warnings;" to lib/perl5db.pl? From what I understood, currently
breaking the debugger's internal API is out-of-the-question, which leaves
us with some necessary ugliness, but if you're willing to use something more modern
while breaking compatibility you can look at 
https://github.com/rocky/Perl-Devel-Trepan . Nevertheless, I'd
like to see the core debugger internal code quality improved to the largest extent 
possible.

Comments and suggests are welcome.

Regards,

	Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Chuck Norris/etc. Facts - http://www.shlomifish.org/humour/bits/facts/

Chuck Norris writes understandable Perl code.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About