This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Extract _restore_shared_globals_after_restart.
authorShlomi Fish <shlomif@shlomifish.org>
Sun, 30 Sep 2012 14:27:39 +0000 (16:27 +0200)
committerRicardo Signes <rjbs@cpan.org>
Mon, 12 Nov 2012 14:18:29 +0000 (09:18 -0500)
lib/perl5db.pl

index 6782246..8b82c8d 100644 (file)
@@ -1379,6 +1379,18 @@ back into the appropriate spots in the debugger.
 
 use vars qw(@hist @truehist %postponed_file @typeahead);
 
 
 use vars qw(@hist @truehist %postponed_file @typeahead);
 
+sub _restore_shared_globals_after_restart
+{
+    @hist          = get_list('PERLDB_HIST');
+    %break_on_load = get_list("PERLDB_ON_LOAD");
+    %postponed     = get_list("PERLDB_POSTPONE");
+
+    share(@hist);
+    share(@truehist);
+    share(%break_on_load);
+    share(%postponed);
+}
+
 sub _restore_breakpoints_and_actions {
 
     my @had_breakpoints = get_list("PERLDB_VISITED");
 sub _restore_breakpoints_and_actions {
 
     my @had_breakpoints = get_list("PERLDB_VISITED");
@@ -1428,20 +1440,14 @@ sub _restore_globals_after_restart
     return;
 }
 
     return;
 }
 
+
 if ( exists $ENV{PERLDB_RESTART} ) {
 
     # We're restarting, so we don't need the flag that says to restart anymore.
     delete $ENV{PERLDB_RESTART};
 
     # $restart = 1;
 if ( exists $ENV{PERLDB_RESTART} ) {
 
     # We're restarting, so we don't need the flag that says to restart anymore.
     delete $ENV{PERLDB_RESTART};
 
     # $restart = 1;
-    @hist          = get_list('PERLDB_HIST');
-    %break_on_load = get_list("PERLDB_ON_LOAD");
-    %postponed     = get_list("PERLDB_POSTPONE");
-
-    share(@hist);
-    share(@truehist);
-    share(%break_on_load);
-    share(%postponed);
+    _restore_shared_globals_after_restart();
 
     _restore_breakpoints_and_actions();
 
 
     _restore_breakpoints_and_actions();