LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2010 The Go Authors. All rights reserved. | 1 // Copyright 2010 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 "defs_GOOS_GOARCH.h" | 6 #include "defs_GOOS_GOARCH.h" |
7 #include "os_GOOS.h" | 7 #include "os_GOOS.h" |
8 #include "signals_GOOS.h" | 8 #include "signals_GOOS.h" |
9 | 9 |
10 void | 10 void |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 break; | 66 break; |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 if(flags & SigGoExit) | 70 if(flags & SigGoExit) |
71 runtime·exits(note+9); // Strip "go: exit " prefix. | 71 runtime·exits(note+9); // Strip "go: exit " prefix. |
72 | 72 |
73 if(flags & SigPanic) { | 73 if(flags & SigPanic) { |
74 // Copy the error string from sigtramp's stack into m->notesig s
o | 74 // Copy the error string from sigtramp's stack into m->notesig s
o |
75 // we can reliably access it from the panic routines. | 75 // we can reliably access it from the panic routines. |
76 » » runtime·memmove(m->notesig, note, len+1); | 76 » » runtime·memmove(g->m->notesig, note, len+1); |
77 | 77 |
78 gp->sig = sig; | 78 gp->sig = sig; |
79 gp->sigpc = ureg->pc; | 79 gp->sigpc = ureg->pc; |
80 | 80 |
81 // Only push runtime·sigpanic if PC != 0. | 81 // Only push runtime·sigpanic if PC != 0. |
82 // | 82 // |
83 // If PC == 0, probably panicked because of a call to a nil func
. | 83 // If PC == 0, probably panicked because of a call to a nil func
. |
84 // Not pushing that onto SP will make the trace look like a call | 84 // Not pushing that onto SP will make the trace look like a call |
85 // to runtime·sigpanic instead. (Otherwise the trace will end at | 85 // to runtime·sigpanic instead. (Otherwise the trace will end at |
86 // runtime·sigpanic and we won't get to see who faulted). | 86 // runtime·sigpanic and we won't get to see who faulted). |
(...skipping 10 matching lines...) Expand all Loading... |
97 // TODO(ality): See if os/signal wants it. | 97 // TODO(ality): See if os/signal wants it. |
98 //if(runtime·sigsend(...)) | 98 //if(runtime·sigsend(...)) |
99 // return NCONT; | 99 // return NCONT; |
100 } | 100 } |
101 if(flags & SigKill) | 101 if(flags & SigKill) |
102 goto Exit; | 102 goto Exit; |
103 if(!(flags & SigThrow)) | 103 if(!(flags & SigThrow)) |
104 return NCONT; | 104 return NCONT; |
105 | 105 |
106 Throw: | 106 Throw: |
107 » m->throwing = 1; | 107 » g->m->throwing = 1; |
108 » m->caughtsig = gp; | 108 » g->m->caughtsig = gp; |
109 runtime·startpanic(); | 109 runtime·startpanic(); |
110 | 110 |
111 runtime·printf("%s\n", note); | 111 runtime·printf("%s\n", note); |
112 runtime·printf("PC=%x\n", ureg->pc); | 112 runtime·printf("PC=%x\n", ureg->pc); |
113 runtime·printf("\n"); | 113 runtime·printf("\n"); |
114 | 114 |
115 if(runtime·gotraceback(&crash)) { | 115 if(runtime·gotraceback(&crash)) { |
116 runtime·goroutineheader(gp); | 116 runtime·goroutineheader(gp); |
117 runtime·traceback(ureg->pc, ureg->sp, 0, gp); | 117 runtime·traceback(ureg->pc, ureg->sp, 0, gp); |
118 runtime·tracebackothers(gp); | 118 runtime·tracebackothers(gp); |
(...skipping 20 matching lines...) Expand all Loading... |
139 runtime·sigdisable(uint32 sig) | 139 runtime·sigdisable(uint32 sig) |
140 { | 140 { |
141 USED(sig); | 141 USED(sig); |
142 } | 142 } |
143 | 143 |
144 void | 144 void |
145 runtime·resetcpuprofiler(int32 hz) | 145 runtime·resetcpuprofiler(int32 hz) |
146 { | 146 { |
147 // TODO: Enable profiling interrupts. | 147 // TODO: Enable profiling interrupts. |
148 ········ | 148 ········ |
149 » m->profilehz = hz; | 149 » g->m->profilehz = hz; |
150 } | 150 } |
LEFT | RIGHT |