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