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

[perl5db refactoring Grant] Report + Requestion Ideas for FurtherWork

Thread Next
Shlomi Fish
October 16, 2012 10:47
[perl5db refactoring Grant] Report + Requestion Ideas for FurtherWork
Message ID:
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:

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/ 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
(= 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 ( ), 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/ 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 . Nevertheless, I'd
like to see the core debugger internal code quality improved to the largest extent 

Comments and suggests are welcome.


	Shlomi Fish

Shlomi Fish
Chuck Norris/etc. Facts -

Chuck Norris writes understandable Perl code.

Please reply to list if it's a mailing list post - .

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About