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

Delta Between Two Patch Sets: src/pkg/runtime/panic.c

Issue 100870044: code review 100870044: runtime: make continuation pc available to stack walk (Closed)
Left Patch Set: diff -r 46d573d68ee6 https://code.google.com/p/go/ Created 10 years, 9 months ago
Right Patch Set: diff -r 95cc2b2ebec5 https://code.google.com/p/go/ Created 10 years, 9 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/runtime/mgc0.c ('k') | src/pkg/runtime/proc.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2012 The Go Authors. All rights reserved. 1 // Copyright 2012 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 #include "runtime.h" 5 #include "runtime.h"
6 #include "arch_GOARCH.h" 6 #include "arch_GOARCH.h"
7 #include "stack.h" 7 #include "stack.h"
8 #include "malloc.h" 8 #include "malloc.h"
9 #include "../../cmd/ld/textflag.h" 9 #include "../../cmd/ld/textflag.h"
10 10
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 runtime·panic(Eface e) 213 runtime·panic(Eface e)
214 { 214 {
215 Defer *d, dabort; 215 Defer *d, dabort;
216 Panic p; 216 Panic p;
217 void *pc, *argp; 217 void *pc, *argp;
218 218
219 runtime·memclr((byte*)&p, sizeof p); 219 runtime·memclr((byte*)&p, sizeof p);
220 p.arg = e; 220 p.arg = e;
221 p.link = g->panic; 221 p.link = g->panic;
222 p.stackbase = g->stackbase; 222 p.stackbase = g->stackbase;
223 p.defer = nil;
iant 2014/05/30 21:50:09 Why bother? We just did a memclr of the entire st
rsc 2014/05/30 22:36:39 So we did; I missed that. There was a mysterious c
224 g->panic = &p; 223 g->panic = &p;
225 224
226 dabort.fn = &abortpanicV; 225 dabort.fn = &abortpanicV;
227 dabort.siz = sizeof(&p); 226 dabort.siz = sizeof(&p);
228 dabort.args[0] = &p; 227 dabort.args[0] = &p;
229 » dabort.argp = (void*)-1; // unused because abortpanic never recovers 228 » dabort.argp = NoArgs;
230 dabort.special = true; 229 dabort.special = true;
231 230
232 for(;;) { 231 for(;;) {
233 d = g->defer; 232 d = g->defer;
234 if(d == nil) 233 if(d == nil)
235 break; 234 break;
236 // take defer off list in case of recursive panic 235 // take defer off list in case of recursive panic
237 g->defer = d->link; 236 g->defer = d->link;
238 g->ispanic = true; // rock for runtime·newstack, where runt ime·newstackcall ends up 237 g->ispanic = true; // rock for runtime·newstack, where runt ime·newstackcall ends up
239 argp = d->argp; 238 argp = d->argp;
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 { 557 {
559 rundefer(); 558 rundefer();
560 runtime·goexit(); 559 runtime·goexit();
561 } 560 }
562 561
563 void 562 void
564 runtime·panicdivide(void) 563 runtime·panicdivide(void)
565 { 564 {
566 runtime·panicstring("integer divide by zero"); 565 runtime·panicstring("integer divide by zero");
567 } 566 }
LEFTRIGHT

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