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