OLD | NEW |
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 #include "runtime.h" | 5 #include "runtime.h" |
6 | 6 |
7 int32 panicking = 0; | 7 int32 panicking = 0; |
8 int32 maxround = sizeof(uintptr); | 8 int32 maxround = sizeof(uintptr); |
9 int32 fd = 1; | 9 int32 fd = 1; |
10 | 10 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 Slice os·Args; | 140 Slice os·Args; |
141 Slice os·Envs; | 141 Slice os·Envs; |
142 | 142 |
143 void | 143 void |
144 args(int32 c, uint8 **v) | 144 args(int32 c, uint8 **v) |
145 { | 145 { |
146 argc = c; | 146 argc = c; |
147 argv = v; | 147 argv = v; |
148 } | 148 } |
149 | 149 |
| 150 extern int32 isplan9; |
| 151 |
150 void | 152 void |
151 goargs(void) | 153 goargs(void) |
152 { | 154 { |
153 String *gargv; | 155 String *gargv; |
154 String *genvv; | 156 String *genvv; |
155 int32 i, envc; | 157 int32 i, envc; |
156 | 158 » |
157 » for(envc=0; argv[argc+1+envc] != 0; envc++) | 159 » if(isplan9) |
158 » » ; | 160 » » envc=0; |
| 161 » else |
| 162 » » for(envc=0; argv[argc+1+envc] != 0; envc++) |
| 163 » » » ; |
159 | 164 |
160 gargv = malloc(argc*sizeof gargv[0]); | 165 gargv = malloc(argc*sizeof gargv[0]); |
161 genvv = malloc(envc*sizeof genvv[0]); | 166 genvv = malloc(envc*sizeof genvv[0]); |
162 | 167 |
163 for(i=0; i<argc; i++) | 168 for(i=0; i<argc; i++) |
164 gargv[i] = gostringnocopy(argv[i]); | 169 gargv[i] = gostringnocopy(argv[i]); |
165 os·Args.array = (byte*)gargv; | 170 os·Args.array = (byte*)gargv; |
166 os·Args.len = argc; | 171 os·Args.len = argc; |
167 os·Args.cap = argc; | 172 os·Args.cap = argc; |
168 | 173 |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 retn = callers(skip, (uintptr*)pc.array, pc.len); | 530 retn = callers(skip, (uintptr*)pc.array, pc.len); |
526 FLUSH(&retn); | 531 FLUSH(&retn); |
527 } | 532 } |
528 | 533 |
529 void | 534 void |
530 ·FuncForPC(uintptr pc, void *retf) | 535 ·FuncForPC(uintptr pc, void *retf) |
531 { | 536 { |
532 retf = findfunc(pc); | 537 retf = findfunc(pc); |
533 FLUSH(&retf); | 538 FLUSH(&retf); |
534 } | 539 } |
OLD | NEW |