platform/upstream/perl.git
11 years agoExtract _DB__grab_control().
Shlomi Fish [Sun, 30 Sep 2012 17:33:07 +0000 (19:33 +0200)]
Extract _DB__grab_control().

I'm a bit unhappy with the interface - I'm planning to extract a class
and an object to instantiate.

11 years agoExtract _DB__handle_watch_expressions() .
Shlomi Fish [Sun, 30 Sep 2012 17:11:02 +0000 (19:11 +0200)]
Extract _DB__handle_watch_expressions() .

11 years agoExtract _DB__determine_if_we_should_break() .
Shlomi Fish [Sun, 30 Sep 2012 15:22:28 +0000 (17:22 +0200)]
Extract _DB__determine_if_we_should_break() .

11 years ago[perl5db] More refactoring.
Shlomi Fish [Sun, 30 Sep 2012 15:15:18 +0000 (17:15 +0200)]
[perl5db] More refactoring.

11 years agoExtract _restore_shared_globals_after_restart.
Shlomi Fish [Sun, 30 Sep 2012 14:27:39 +0000 (16:27 +0200)]
Extract _restore_shared_globals_after_restart.

11 years agoExtract _restore_globals_after_restart.
Shlomi Fish [Sun, 30 Sep 2012 14:14:15 +0000 (16:14 +0200)]
Extract _restore_globals_after_restart.

11 years ago[perl5db-refactor] Extract a function.
Shlomi Fish [Sun, 30 Sep 2012 13:56:49 +0000 (15:56 +0200)]
[perl5db-refactor] Extract a function.

_restore_options_after_restart() .

11 years ago[perl5db] Extract a subroutine.
Shlomi Fish [Sun, 30 Sep 2012 13:49:18 +0000 (15:49 +0200)]
[perl5db] Extract a subroutine.

11 years ago[perl5db-refactor] Refactoring.
Shlomi Fish [Sun, 30 Sep 2012 13:28:23 +0000 (15:28 +0200)]
[perl5db-refactor] Refactoring.

11 years ago[perl5db-refactor] convert to use vars and &s.
Shlomi Fish [Sun, 30 Sep 2012 13:14:09 +0000 (15:14 +0200)]
[perl5db-refactor] convert to use vars and &s.

11 years ago[perl5db] Extract a function.
Shlomi Fish [Sun, 30 Sep 2012 12:17:09 +0000 (14:17 +0200)]
[perl5db] Extract a function.

11 years ago[perl5db] Remove a stray declaration.
Shlomi Fish [Sun, 30 Sep 2012 11:42:13 +0000 (13:42 +0200)]
[perl5db] Remove a stray declaration.

11 years ago[perl5db-refactor] Extract a method.
Shlomi Fish [Sun, 30 Sep 2012 10:37:31 +0000 (12:37 +0200)]
[perl5db-refactor] Extract a method.

11 years ago[perl5db-refactor] Extract _delete_all_breakpoints.
Shlomi Fish [Sun, 30 Sep 2012 00:51:07 +0000 (02:51 +0200)]
[perl5db-refactor] Extract _delete_all_breakpoints.

11 years ago[perl5db] Remove leading ampersands in sub calls.
Shlomi Fish [Sun, 30 Sep 2012 00:36:09 +0000 (02:36 +0200)]
[perl5db] Remove leading ampersands in sub calls.

11 years agoMore refactoring.
Shlomi Fish [Sun, 30 Sep 2012 00:30:27 +0000 (02:30 +0200)]
More refactoring.

11 years ago[perl5db] Remove ampersand.
Shlomi Fish [Sat, 29 Sep 2012 23:31:27 +0000 (01:31 +0200)]
[perl5db] Remove ampersand.

11 years ago[perl5db-refactor] Merge two conditionals.
Shlomi Fish [Sat, 29 Sep 2012 23:24:07 +0000 (01:24 +0200)]
[perl5db-refactor] Merge two conditionals.

11 years agoAdd more.
Shlomi Fish [Sat, 29 Sep 2012 23:14:56 +0000 (01:14 +0200)]
Add more.

11 years agoRefactored a loop.
Shlomi Fish [Sat, 29 Sep 2012 23:09:02 +0000 (01:09 +0200)]
Refactored a loop.

11 years ago[perl5db] Avoid predeclaration.
Shlomi Fish [Sat, 29 Sep 2012 22:54:56 +0000 (00:54 +0200)]
[perl5db] Avoid predeclaration.

11 years ago[perl5db] Refactored more.
Shlomi Fish [Sat, 29 Sep 2012 22:46:07 +0000 (00:46 +0200)]
[perl5db] Refactored more.

11 years ago[perl5db-refactor] Remove leading ampersands.
Shlomi Fish [Sat, 29 Sep 2012 22:26:38 +0000 (00:26 +0200)]
[perl5db-refactor] Remove leading ampersands.

From subroutine calls.

11 years ago[perl5db] refactoring + minor bug-fix.
Shlomi Fish [Sat, 29 Sep 2012 22:18:40 +0000 (00:18 +0200)]
[perl5db] refactoring + minor bug-fix.

The regex h\s* matches for every string that starts with "h". It should
match only if h is the only thing so a \z is needed.

11 years ago[perl5db-refactoring] Refactored parse_options.
Shlomi Fish [Sat, 29 Sep 2012 22:08:22 +0000 (00:08 +0200)]
[perl5db-refactoring] Refactored parse_options.

11 years ago[perl5db] Convert $| to ->autoflush(1).
Shlomi Fish [Sat, 29 Sep 2012 21:42:02 +0000 (23:42 +0200)]
[perl5db] Convert $| to ->autoflush(1).

11 years ago[perl5db] Refactor the LineInfo function.
Shlomi Fish [Sat, 29 Sep 2012 21:33:59 +0000 (23:33 +0200)]
[perl5db] Refactor the LineInfo function.

11 years ago[perl5db-refactoring] Got rid of trailing whitespace.
Shlomi Fish [Sat, 29 Sep 2012 21:18:01 +0000 (23:18 +0200)]
[perl5db-refactoring] Got rid of trailing whitespace.

11 years ago[perl5db-Refactor] Convert $_ to a lexical.
Shlomi Fish [Sat, 29 Sep 2012 21:01:25 +0000 (23:01 +0200)]
[perl5db-Refactor] Convert $_ to a lexical.

11 years ago[perl5db] Extract a function.
Shlomi Fish [Sat, 29 Sep 2012 20:53:00 +0000 (22:53 +0200)]
[perl5db] Extract a function.

11 years ago[perl5db] Remove some trailing space.
Shlomi Fish [Sat, 29 Sep 2012 20:42:30 +0000 (22:42 +0200)]
[perl5db] Remove some trailing space.

11 years ago[perl5db] More refactoring.
Shlomi Fish [Sat, 29 Sep 2012 20:34:52 +0000 (22:34 +0200)]
[perl5db] More refactoring.

1. Got rid of a trailing block comment because the block is shorter.

2. Now using something more sensible than s/^/perl/.

11 years ago[perl5db] Convert @pods to a hash and moved it out.
Shlomi Fish [Sat, 29 Sep 2012 20:21:53 +0000 (22:21 +0200)]
[perl5db] Convert @pods to a hash and moved it out.

This is part of the refactoring.

11 years agoMove away from more "or do { ... }" statements.
Shlomi Fish [Sat, 29 Sep 2012 19:29:14 +0000 (21:29 +0200)]
Move away from more "or do { ... }" statements.

11 years ago[perl5db] Refactored do {...}s into ifs.
Shlomi Fish [Sat, 29 Sep 2012 19:10:05 +0000 (21:10 +0200)]
[perl5db] Refactored do {...}s into ifs.

11 years ago[perl5db] More refactoring.
Shlomi Fish [Sat, 29 Sep 2012 18:33:50 +0000 (20:33 +0200)]
[perl5db] More refactoring.

1. Made the POD better.

2. Converted more && do to ifs.

3. More eq conversions.

4. Captures in lexical variables.

5. Using /ms instead of [\x00-\xFF].

11 years agoMore refactoring.
Shlomi Fish [Sat, 29 Sep 2012 17:47:19 +0000 (19:47 +0200)]
More refactoring.

11 years agoConvert some COND() && do to ifs.
Shlomi Fish [Sat, 29 Sep 2012 17:26:27 +0000 (19:26 +0200)]
Convert some COND() && do to ifs.

Also converted "^" and "$" to the less ambiguous \A and \z and converted
an /^q$/ to the "eq" operator.

Here I am starting to refactor the perl debugger.

11 years agoAdd a test for the frame option.
Shlomi Fish [Fri, 28 Sep 2012 18:03:12 +0000 (20:03 +0200)]
Add a test for the frame option.

11 years ago[perl5db] o PrintRet=0 in void context.
Shlomi Fish [Thu, 27 Sep 2012 18:31:27 +0000 (20:31 +0200)]
[perl5db] o PrintRet=0 in void context.

11 years agoTest o PrintRet=1 in void context.
Shlomi Fish [Thu, 27 Sep 2012 18:25:11 +0000 (20:25 +0200)]
Test o PrintRet=1 in void context.

11 years ago[perl5db] Add another test.
Shlomi Fish [Thu, 27 Sep 2012 18:13:18 +0000 (20:13 +0200)]
[perl5db] Add another test.

11 years ago[perl5db] Test o PrintRet in list context.
Shlomi Fish [Thu, 27 Sep 2012 18:04:50 +0000 (20:04 +0200)]
[perl5db] Test o PrintRet in list context.

11 years ago[perl5db] add a test for o PrintRet=0.
Shlomi Fish [Thu, 27 Sep 2012 17:50:05 +0000 (19:50 +0200)]
[perl5db] add a test for o PrintRet=0.

11 years agoAdd a test for o PrintRet.
Shlomi Fish [Thu, 27 Sep 2012 17:40:31 +0000 (19:40 +0200)]
Add a test for o PrintRet.

11 years agoTest o inhibit_exit=0.
Shlomi Fish [Tue, 25 Sep 2012 16:53:12 +0000 (18:53 +0200)]
Test o inhibit_exit=0.

11 years agoFix a bug with o AutoTrace.
Shlomi Fish [Fri, 21 Sep 2012 09:14:35 +0000 (12:14 +0300)]
Fix a bug with o AutoTrace.

There it was.

11 years ago[perl5db] Add a test for t command with sub calls.
Shlomi Fish [Fri, 21 Sep 2012 08:54:39 +0000 (11:54 +0300)]
[perl5db] Add a test for t command with sub calls.

11 years ago[perl5db] Test o AutoTrace .
Shlomi Fish [Fri, 21 Sep 2012 08:36:00 +0000 (11:36 +0300)]
[perl5db] Test o AutoTrace .

It appears to work fine now. Strange.

11 years ago[perl5db] Add a test for the 't' command.
Shlomi Fish [Fri, 21 Sep 2012 08:31:29 +0000 (11:31 +0300)]
[perl5db] Add a test for the 't' command.

Apparently, the 'o AutoTrace' command is broken since perl-5.16.x and I
want to get a good output for 't' first before fixing it.

11 years ago[perl5db] Add a test for warnLevel=1.
Shlomi Fish [Thu, 20 Sep 2012 14:28:39 +0000 (17:28 +0300)]
[perl5db] Add a test for warnLevel=1.

11 years ago[perl5db] Add test for dieLevel option.
Shlomi Fish [Wed, 19 Sep 2012 13:33:22 +0000 (16:33 +0300)]
[perl5db] Add test for dieLevel option.

11 years ago[perl5db] Test the recallCommand option.
Shlomi Fish [Tue, 18 Sep 2012 14:24:14 +0000 (17:24 +0300)]
[perl5db] Test the recallCommand option.

11 years ago[perl5db] Test the M command.
Shlomi Fish [Sat, 15 Sep 2012 14:18:37 +0000 (17:18 +0300)]
[perl5db] Test the M command.

11 years agoTest more for the m staetement.
Shlomi Fish [Sat, 15 Sep 2012 14:10:13 +0000 (17:10 +0300)]
Test more for the m staetement.

11 years agoTest the m command.
Shlomi Fish [Sat, 15 Sep 2012 13:54:24 +0000 (16:54 +0300)]
Test the m command.

11 years ago[perl5db] Test the = command.
Shlomi Fish [Sat, 15 Sep 2012 13:46:35 +0000 (16:46 +0300)]
[perl5db] Test the = command.

11 years agoCorrect the test blurbs.
Shlomi Fish [Sat, 15 Sep 2012 13:29:55 +0000 (16:29 +0300)]
Correct the test blurbs.

11 years agoAdd a test for the H command.
Shlomi Fish [Sat, 15 Sep 2012 12:40:21 +0000 (15:40 +0300)]
Add a test for the H command.

11 years ago[perl5db] Add a test for H -7.
Shlomi Fish [Sat, 15 Sep 2012 12:35:07 +0000 (15:35 +0300)]
[perl5db] Add a test for H -7.

11 years ago[perl5db] Fix source cmd from typeahead.
Shlomi Fish [Thu, 13 Sep 2012 14:08:58 +0000 (17:08 +0300)]
[perl5db] Fix source cmd from typeahead.

With a test.

11 years agoAdd a test for the source command.
Shlomi Fish [Thu, 13 Sep 2012 13:52:54 +0000 (16:52 +0300)]
Add a test for the source command.

11 years agoExtract a common subroutine.
Shlomi Fish [Thu, 13 Sep 2012 11:41:59 +0000 (14:41 +0300)]
Extract a common subroutine.

11 years agoRename to something more meaningful.
Shlomi Fish [Thu, 13 Sep 2012 11:34:18 +0000 (14:34 +0300)]
Rename to something more meaningful.

11 years agoConvert to DebugWrap.
Shlomi Fish [Thu, 13 Sep 2012 11:32:41 +0000 (14:32 +0300)]
Convert to DebugWrap.

11 years agoConvert more to DebugWrap.
Shlomi Fish [Thu, 13 Sep 2012 11:26:55 +0000 (14:26 +0300)]
Convert more to DebugWrap.

11 years agoConvert the 61222 test to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 14:13:32 +0000 (17:13 +0300)]
Convert the 61222 test to DebugWrap.

11 years agoExtract _calc_threads_wrapper.
Shlomi Fish [Wed, 12 Sep 2012 14:08:40 +0000 (17:08 +0300)]
Extract _calc_threads_wrapper.

11 years agoRemove some no-longer used code.
Shlomi Fish [Wed, 12 Sep 2012 14:06:27 +0000 (17:06 +0300)]
Remove some no-longer used code.

11 years agoPrepend with an underscore.
Shlomi Fish [Wed, 12 Sep 2012 14:04:49 +0000 (17:04 +0300)]
Prepend with an underscore.

To make it an internally-used subroutine.

11 years agoConvert another test to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 14:03:48 +0000 (17:03 +0300)]
Convert another test to DebugWrap.

11 years agoConvert another test to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 14:01:16 +0000 (17:01 +0300)]
Convert another test to DebugWrap.

11 years agoConvert another test to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 13:54:30 +0000 (16:54 +0300)]
Convert another test to DebugWrap.

11 years agoConvert another test to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 13:51:50 +0000 (16:51 +0300)]
Convert another test to DebugWrap.

11 years agoExtract a constructor.
Shlomi Fish [Wed, 12 Sep 2012 13:29:46 +0000 (16:29 +0300)]
Extract a constructor.

This will help in converting the other instances to DebugWrap.

11 years agoConvert a test to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 13:08:16 +0000 (16:08 +0300)]
Convert a test to DebugWrap.

11 years agoConvert a perl5db.t test to DebugWrap.
Shlomi Fish [Wed, 12 Sep 2012 12:59:12 +0000 (15:59 +0300)]
Convert a perl5db.t test to DebugWrap.

11 years agoAdd a test for l -num.
Shlomi Fish [Wed, 12 Sep 2012 10:35:43 +0000 (13:35 +0300)]
Add a test for l -num.

11 years agoTest the ! command.
Shlomi Fish [Wed, 12 Sep 2012 09:56:51 +0000 (12:56 +0300)]
Test the ! command.

11 years agoTest the { * command.
Shlomi Fish [Wed, 12 Sep 2012 07:56:54 +0000 (10:56 +0300)]
Test the { * command.

11 years agoConvert to a different quoting.
Shlomi Fish [Wed, 12 Sep 2012 07:52:12 +0000 (10:52 +0300)]
Convert to a different quoting.

This was done so gvim won't be confused with the bracket-matching.
I'll report the problem to the perl.vim project.

11 years agoTest for the { and { ? commands.
Shlomi Fish [Wed, 12 Sep 2012 07:47:19 +0000 (10:47 +0300)]
Test for the { and { ? commands.

11 years agoAdd a test for the < and > commands together.
Shlomi Fish [Wed, 12 Sep 2012 07:22:26 +0000 (10:22 +0300)]
Add a test for the < and > commands together.

11 years agormv context from Perl_croak_no_modify and Perl_croak_xs_usage
Daniel Dragan [Mon, 12 Nov 2012 05:04:00 +0000 (00:04 -0500)]
rmv context from Perl_croak_no_modify and Perl_croak_xs_usage

Remove the context/pTHX from Perl_croak_no_modify and Perl_croak_xs_usage.
For croak_no_modify, it now has no parameters (and always has been
no return), and on some compilers will now be optimized to a conditional
jump. For Perl_croak_xs_usage one push asm opcode is removed at the caller.
For both funcs, their footprint in their callers (which probably are hot
code) is smaller, which means a tiny bit more room in the cache. My text
section went from 0xC1A2F to 0xC198F after apply this. Also see
http://www.nntp.perl.org/group/perl.perl5.porters/2012/11/msg195233.html .

11 years agoPADRANGE: don't assume targs are contiguous
David Mitchell [Mon, 12 Nov 2012 10:36:55 +0000 (10:36 +0000)]
PADRANGE: don't assume targs are contiguous

Normally in something like my($x,$y,$z), the 3 targs are contiguous;
however eternal modules like Function::Parameters can break that
assumption, so don't assume it.

11 years agofix hash order dependency bug in new Module::Corelist::deprecated_in()
Yves Orton [Mon, 12 Nov 2012 08:35:57 +0000 (09:35 +0100)]
fix hash order dependency bug in new Module::Corelist::deprecated_in()

The code was doing

    $version= List::Util::min(keys %$versions);

which introduces a hash order dependency as min() returns either the first or last
(i didnt check which) of the lowest items in the list, and considers 5.011000 and
5.011 to be equivalent. Depending on the hash order it would return
either one. Hash randomization revealed this bug immediately.

Changing the function to use List::Util::minstr() eliminates the
dependency.

    $version= List::Util::minstr(keys %$versions);

11 years ago[perl #43077] Make goto &sub leave @_ alone
Father Chrysostomos [Mon, 12 Nov 2012 06:16:35 +0000 (22:16 -0800)]
[perl #43077] Make goto &sub leave @_ alone

It is a little tricky, as we have to hang on to @_ while unwinding the
effects of local @_.

11 years agoleakfinder.pl: Many more exceptions
Father Chrysostomos [Sun, 11 Nov 2012 08:36:33 +0000 (00:36 -0800)]
leakfinder.pl: Many more exceptions

11 years agoEnv.pm: Fix splice in list context
Father Chrysostomos [Fri, 9 Nov 2012 20:50:59 +0000 (12:50 -0800)]
Env.pm: Fix splice in list context

It was passing an extra argument to splice, causing splice @PATH, 0, 0
to append ":0" to the environment variable.

11 years agoIncrease $Env::VERSION to 1.04
Father Chrysostomos [Fri, 9 Nov 2012 20:47:39 +0000 (12:47 -0800)]
Increase $Env::VERSION to 1.04

11 years agoEven more regexp charclass leaks
Father Chrysostomos [Fri, 9 Nov 2012 14:14:49 +0000 (06:14 -0800)]
Even more regexp charclass leaks

11 years agotoke.c: White-space only; no code changes
Karl Williamson [Sun, 11 Nov 2012 22:07:14 +0000 (15:07 -0700)]
toke.c: White-space only; no code changes

This indents a newly formed block, and changes one other line to line up
better.

11 years agotoke.c: Don't force \N{} into utf8 unnecessarily
Karl Williamson [Sun, 11 Nov 2012 21:47:53 +0000 (14:47 -0700)]
toke.c: Don't force \N{} into utf8 unnecessarily

regcomp.c no longer requires everything containing \N{} to be in UTF-8.
I'm not sure of the exact commit; it might even have been in 5.16.  But
it was done by the time 86e88272fdabc40e3b168a3cc43af5e86284d01b was
done.

Therefore we can remove the temporary code that forced utf8, and replace
it with code that handles the non-utf8 case.

Note that outside patterns, \N{} still forces utf8.  This is so that
Unicode semantics will be imposed on the string it resides in, no matter
how it is used.  Patterns have a flag that indicates Unicode semantics,
so don't need to be in utf8.

11 years agotoke.c: Remove redundant checks
Karl Williamson [Sun, 11 Nov 2012 21:45:19 +0000 (14:45 -0700)]
toke.c: Remove redundant checks

This code is redundant, as the whole string has been checked earlier for
valid utf8ness, or we assume that the internal Perl handler, charnames,
is correctly returning valid utf8.

11 years agotoke.c: Reorder declaration
Karl Williamson [Sun, 11 Nov 2012 21:28:17 +0000 (14:28 -0700)]
toke.c: Reorder declaration

This is in preparation for the next commit.

11 years agotoke.c: Use UTF-8 macros for portability
Karl Williamson [Thu, 8 Nov 2012 19:02:29 +0000 (12:02 -0700)]
toke.c: Use UTF-8 macros for portability

I noticed this code in toke.c that hand-rolled its own UTF-8 handling,
and is assuming an ASCII platform.  There are macros that do the same
thing that this code does, and are portable.

11 years agoutf8.h: Add macro that handled malformed 2-byte UTF-8
Karl Williamson [Thu, 8 Nov 2012 19:04:34 +0000 (12:04 -0700)]
utf8.h: Add macro that handled malformed 2-byte UTF-8

The macro used traditionally to see if there is a two-byte UTF-8
sequence doesn't make sure that there actually is a second byte
available; it only checks if the first byte indicates that there is.
This adds a macro that is safe in the face of malformed UTF-8.

I inspected the existing calls in the core to the unsafe macro, and I
believe that none of them need to be converted to the safe version.

11 years agoutil.c: Add some asserts()
Karl Williamson [Thu, 8 Nov 2012 18:11:41 +0000 (11:11 -0700)]
util.c: Add some asserts()

These functions improperly have a signed parameter, when the value
should always be at least 0.  We have a field report that one of them is
getting called with a negative value.  Add asserts to catch this
condition (if compiling assertions is on) earlier.

11 years agoutf8.c: Remove redundant unlikely branches
Karl Williamson [Tue, 30 Oct 2012 16:15:38 +0000 (10:15 -0600)]
utf8.c: Remove redundant unlikely branches

The 2 lines removed in each function provide an early exit if the input
is malformed UTF-8.  Other code executed later makes the same test.
But most inputs are going to be well-formed, so the test will almost
always fail, so will slow things up.

11 years agoValidate above-Latin1 characters in \N{} aliases
Karl Williamson [Fri, 9 Nov 2012 17:18:17 +0000 (10:18 -0700)]
Validate above-Latin1 characters in \N{} aliases

This completes the process of allowing users to define their own aliases
for \N{} in any language they choose.  Names have some validation
applied so that they can't, for example, begin with something that is a
digit in some Unicode script.  Tests and documentation are included in
this patch.  The loop in toke.c that does the validation for
user-supplied translators is revamped, and the messages that are output
when there is an error are fixed to work with UTF-8.