Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(685)

Side by Side Diff: src/cmd/cov/main.c

Issue 871042: code review 871042: runtime: turn run time errors checks into panics (Closed)
Patch Set: code review 871042: runtime: turn run time errors checks into panics Created 14 years, 12 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/cmd/8g/reg.c ('k') | src/cmd/gc/builtin.c.boot » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 /* 5 /*
6 * code coverage 6 * code coverage
7 */ 7 */
8 8
9 #include <u.h> 9 #include <u.h>
10 #include <time.h> 10 #include <time.h>
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 // check whether last instruction is call to morestack. 194 // check whether last instruction is call to morestack.
195 // the -5 below is the length of 195 // the -5 below is the length of
196 // CALL sys.morestack. 196 // CALL sys.morestack.
197 buf[0] = 0; 197 buf[0] = 0;
198 machdata->das(text, epc-5, 0, buf, sizeof buf); 198 machdata->das(text, epc-5, 0, buf, sizeof buf);
199 if(strstr(buf, "morestack")) 199 if(strstr(buf, "morestack"))
200 return; 200 return;
201 } 201 }
202 202
203 if(epc - pc == 5) { 203 if(epc - pc == 5) {
204 » » // check for CALL sys.throwindex 204 » » // check for CALL sys.panicindex
205 buf[0] = 0; 205 buf[0] = 0;
206 machdata->das(text, pc, 0, buf, sizeof buf); 206 machdata->das(text, pc, 0, buf, sizeof buf);
207 » » if(strstr(buf, "throwindex")) 207 » » if(strstr(buf, "panicindex"))
208 return; 208 return;
209 } 209 }
210 210
211 if(epc - pc == 2 || epc -pc == 3) { 211 if(epc - pc == 2 || epc -pc == 3) {
212 // check for XORL inside shift. 212 // check for XORL inside shift.
213 // (on x86 have to implement large left or unsigned right shift with explicit zeroing). 213 // (on x86 have to implement large left or unsigned right shift with explicit zeroing).
214 // f+90 0x00002c9f CMPL CX,$20 214 // f+90 0x00002c9f CMPL CX,$20
215 // f+93 0x00002ca2 JCS f+97(SB) 215 // f+93 0x00002ca2 JCS f+97(SB)
216 // f+95 0x00002ca4 XORL AX,AX <<< 216 // f+95 0x00002ca4 XORL AX,AX <<<
217 // f+97 0x00002ca6 SHLL CL,AX 217 // f+97 0x00002ca6 SHLL CL,AX
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 breakpoints.cmp = rangecmp; 471 breakpoints.cmp = rangecmp;
472 cover(); 472 cover();
473 n = go(); 473 n = go();
474 walktree(breakpoints.root); 474 walktree(breakpoints.root);
475 if(chatty) 475 if(chatty)
476 print("%d breakpoints\n", n); 476 print("%d breakpoints\n", n);
477 detachproc(mem); 477 detachproc(mem);
478 exits(0); 478 exits(0);
479 } 479 }
480 480
OLDNEW
« no previous file with comments | « src/cmd/8g/reg.c ('k') | src/cmd/gc/builtin.c.boot » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b