LEFT | RIGHT |
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 #include "arch_GOARCH.h" | 6 #include "arch_GOARCH.h" |
7 #include "malloc.h" | 7 #include "malloc.h" |
8 #include "funcdata.h" | 8 #include "funcdata.h" |
9 | 9 |
10 void runtime·sigpanic(void); | 10 void runtime·sigpanic(void); |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 if(pc > f->entry) | 319 if(pc > f->entry) |
320 runtime·printf(" +%p", (uintptr)(pc - f->entry)); | 320 runtime·printf(" +%p", (uintptr)(pc - f->entry)); |
321 runtime·printf("\n"); | 321 runtime·printf("\n"); |
322 } | 322 } |
323 } | 323 } |
324 | 324 |
325 void | 325 void |
326 runtime·traceback(uintptr pc, uintptr sp, uintptr lr, G *gp) | 326 runtime·traceback(uintptr pc, uintptr sp, uintptr lr, G *gp) |
327 { | 327 { |
328 int32 n; | 328 int32 n; |
329 » uint32 status; | 329 |
330 | 330 » if((runtime·readgstatus(gp)&~Gscan) == Gsyscall){ |
331 » status = runtime·readgstatus(gp); | |
332 » if(status == Gsyscall || status == Gscansyscall) { | |
333 // Override signal registers if blocked in system call. | 331 // Override signal registers if blocked in system call. |
334 pc = gp->syscallpc; | 332 pc = gp->syscallpc; |
335 sp = gp->syscallsp; | 333 sp = gp->syscallsp; |
336 lr = 0; | 334 lr = 0; |
337 } | 335 } |
338 | 336 |
339 // Print traceback. By default, omits runtime frames. | 337 // Print traceback. By default, omits runtime frames. |
340 // If that means we print nothing at all, repeat forcing all frames prin
ted. | 338 // If that means we print nothing at all, repeat forcing all frames prin
ted. |
341 n = runtime·gentraceback(pc, sp, lr, gp, 0, nil, TracebackMaxFrames, nil
, nil, false); | 339 n = runtime·gentraceback(pc, sp, lr, gp, 0, nil, TracebackMaxFrames, nil
, nil, false); |
342 if(n == 0) | 340 if(n == 0) |
(...skipping 13 matching lines...) Expand all Loading... |
356 pc = (uintptr)runtime·getcallerpc(&skip); | 354 pc = (uintptr)runtime·getcallerpc(&skip); |
357 | 355 |
358 return runtime·gentraceback(pc, sp, 0, g, skip, pcbuf, m, nil, nil, fals
e); | 356 return runtime·gentraceback(pc, sp, 0, g, skip, pcbuf, m, nil, nil, fals
e); |
359 } | 357 } |
360 | 358 |
361 int32 | 359 int32 |
362 runtime·gcallers(G *gp, int32 skip, uintptr *pcbuf, int32 m) | 360 runtime·gcallers(G *gp, int32 skip, uintptr *pcbuf, int32 m) |
363 { | 361 { |
364 return runtime·gentraceback(~(uintptr)0, ~(uintptr)0, 0, gp, skip, pcbuf
, m, nil, nil, false); | 362 return runtime·gentraceback(~(uintptr)0, ~(uintptr)0, 0, gp, skip, pcbuf
, m, nil, nil, false); |
365 } | 363 } |
LEFT | RIGHT |