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