home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / perl-4.036.tar.gz / perl-4.036.tar / perl-4.036 / atarist / perldb.diff < prev    next >
Text File  |  1993-02-08  |  5KB  |  180 lines

  1. *** ../../../lib/perldb.pl    Mon Nov 11 10:40:22 1991
  2. --- perldb.pl    Mon May 18 17:00:56 1992
  3. ***************
  4. *** 1,10 ****
  5.   package DB;
  6.   
  7. ! # modified Perl debugger, to be run from Emacs in perldb-mode
  8. ! # Ray Lischner (uunet!mntgfx!lisch) as of 5 Nov 1990
  9. ! # Johan Vromans -- upgrade to 4.0 pl 10
  10. ! $header = '$RCSfile: perldb.diff,v $$Revision: 4.0.1.1 $$Date: 92/06/08 11:50:28 $';
  11.   #
  12.   # This file is automatically included if you do perl -d.
  13.   # It's probably not useful to include this yourself.
  14. --- 1,6 ----
  15.   package DB;
  16.   
  17. ! $header = '$RCSfile: perldb.diff,v $$Revision: 4.0.1.1 $$Date: 92/06/08 11:50:28 $';
  18.   #
  19.   # This file is automatically included if you do perl -d.
  20.   # It's probably not useful to include this yourself.
  21. ***************
  22. *** 14,22 ****
  23.   # have a breakpoint.  It also inserts a do 'perldb.pl' before the first line.
  24.   #
  25.   # $Log:    perldb.diff,v $
  26.   # Revision 4.0.1.1  92/06/08  11:50:28  lwall
  27.   # Initial revision
  28.   # 
  29. - # Revision 4.0.1.2  91/11/05  17:55:58  lwall
  30. - # patch11: perldb.pl modified to run within emacs in perldb-mode
  31. - # 
  32.   # Revision 4.0.1.1  91/06/07  11:17:44  lwall
  33.   # patch4: added $^P variable to control calling of perldb routines
  34.   # patch4: debugger sometimes listed wrong number of lines for a statement
  35. --- 10,15 ----
  36. ***************
  37. *** 56,63 ****
  38.   # 
  39.   #
  40.   
  41. ! open(IN, "</dev/tty") || open(IN,  "<&STDIN");    # so we don't dingle stdin
  42. ! open(OUT,">/dev/tty") || open(OUT, ">&STDOUT");    # so we don't dongle stdout
  43.   select(OUT);
  44.   $| = 1;                # for DB'OUT
  45.   select(STDOUT);
  46. --- 49,56 ----
  47.   # 
  48.   #
  49.   
  50. ! open(IN, "</dev/console") || open(IN,  "<&STDIN");    # so we don't dingle stdin
  51. ! open(OUT,">/dev/console") || open(OUT, ">&STDOUT");    # so we don't dongle stdout
  52.   select(OUT);
  53.   $| = 1;                # for DB'OUT
  54.   select(STDOUT);
  55. ***************
  56. *** 64,79 ****
  57.   $| = 1;                # for real STDOUT
  58.   $sub = '';
  59.   
  60. - # Is Perl being run from Emacs?
  61. - $emacs = $main'ARGV[$[] eq '-emacs';
  62. - shift(@main'ARGV) if $emacs;
  63.   $header =~ s/.Header: ([^,]+),v(\s+\S+\s+\S+).*$/$1$2/;
  64. ! print OUT "\nLoading DB routines from $header\n";
  65. ! print OUT ("Emacs support ",
  66. !        $emacs ? "enabled" : "available",
  67. !        ".\n");
  68. ! print OUT "\nEnter h for help.\n\n";
  69.   
  70.   sub DB {
  71.       &save;
  72. --- 57,64 ----
  73.   $| = 1;                # for real STDOUT
  74.   $sub = '';
  75.   
  76.   $header =~ s/.Header: ([^,]+),v(\s+\S+\s+\S+).*$/$1$2/;
  77. ! print OUT "\nLoading DB routines from $header\n\nEnter h for help.\n\n";
  78.   
  79.   sub DB {
  80.       &save;
  81. ***************
  82. *** 93,107 ****
  83.       }
  84.       }
  85.       if ($single || $trace || $signal) {
  86. !     if ($emacs) {
  87. !         print OUT "\032\032$filename:$line:0\n";
  88. !     } else {
  89. !         print OUT "$package'" unless $sub =~ /'/;
  90. !         print OUT "$sub($filename:$line):\t",$dbline[$line];
  91. !         for ($i = $line + 1; $i <= $max && $dbline[$i] == 0; ++$i) {
  92. !         last if $dbline[$i] =~ /^\s*(}|#|\n)/;
  93. !         print OUT "$sub($filename:$i):\t",$dbline[$i];
  94. !         }
  95.       }
  96.       }
  97.       $evalarg = $action, &eval if $action;
  98. --- 78,88 ----
  99.       }
  100.       }
  101.       if ($single || $trace || $signal) {
  102. !     print OUT "$package'" unless $sub =~ /'/;
  103. !     print OUT "$sub($filename:$line):\t",$dbline[$line];
  104. !     for ($i = $line + 1; $i <= $max && $dbline[$i] == 0; ++$i) {
  105. !         last if $dbline[$i] =~ /^\s*(;|}|#|\n)/;
  106. !         print OUT "$sub($filename:$i):\t",$dbline[$i];
  107.       }
  108.       }
  109.       $evalarg = $action, &eval if $action;
  110. ***************
  111. *** 263,276 ****
  112.               $i = $2;
  113.               $i = $line if $i eq '.';
  114.               $i = 1 if $i < 1;
  115. !             if ($emacs) {
  116. !             print OUT "\032\032$filename:$i:0\n";
  117. !             $i = $end;
  118. !             } else {
  119. !             for (; $i <= $end; $i++) {
  120. !                 print OUT "$i:\t", $dbline[$i];
  121. !                 last if $signal;
  122. !             }
  123.               }
  124.               $start = $i;    # remember in case they want more
  125.               $start = $max if $start > $max;
  126. --- 244,252 ----
  127.               $i = $2;
  128.               $i = $line if $i eq '.';
  129.               $i = 1 if $i < 1;
  130. !             for (; $i <= $end; $i++) {
  131. !             print OUT "$i:\t", $dbline[$i];
  132. !             last if $signal;
  133.               }
  134.               $start = $i;    # remember in case they want more
  135.               $start = $max if $start > $max;
  136. ***************
  137. *** 417,427 ****
  138.               $start = 1 if ($start > $max);
  139.               last if ($start == $end);
  140.               if ($dbline[$start] =~ m'."\n$pat\n".'i) {
  141. !                 if ($emacs) {
  142. !                 print OUT "\032\032$filename:$start:0\n";
  143. !                 } else {
  144. !                 print OUT "$start:\t", $dbline[$start], "\n";
  145. !                 }
  146.                   last;
  147.               }
  148.               } ';
  149. --- 393,399 ----
  150.               $start = 1 if ($start > $max);
  151.               last if ($start == $end);
  152.               if ($dbline[$start] =~ m'."\n$pat\n".'i) {
  153. !                 print OUT "$start:\t", $dbline[$start], "\n";
  154.                   last;
  155.               }
  156.               } ';
  157. ***************
  158. *** 445,455 ****
  159.               $start = $max if ($start <= 0);
  160.               last if ($start == $end);
  161.               if ($dbline[$start] =~ m'."\n$pat\n".'i) {
  162. !                 if ($emacs) {
  163. !                 print OUT "\032\032$filename:$start:0\n";
  164. !                 } else {
  165. !                 print OUT "$start:\t", $dbline[$start], "\n";
  166. !                 }
  167.                   last;
  168.               }
  169.               } ';
  170. --- 417,423 ----
  171.               $start = $max if ($start <= 0);
  172.               last if ($start == $end);
  173.               if ($dbline[$start] =~ m'."\n$pat\n".'i) {
  174. !                 print OUT "$start:\t", $dbline[$start], "\n";
  175.                   last;
  176.               }
  177.               } ';
  178.