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

Delta Between Two Patch Sets: src/pkg/runtime/traceback.go

Issue 134200044: code review 134200044: runtime: convert traceback*.c to Go (Closed)
Left Patch Set: diff -r df0572446e37549332e1d1154955409e2cff6008 https://code.google.com/p/go/ Created 10 years, 6 months ago
Right Patch Set: diff -r df0572446e37549332e1d1154955409e2cff6008 https://code.google.com/p/go/ Created 10 years, 6 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/stubs.go ('k') | src/pkg/runtime/traceback_arm.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 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 package runtime 5 package runtime
6 6
7 import "unsafe" 7 import "unsafe"
8 8
9 // The code in this file implements stack trace walking for all architectures. 9 // The code in this file implements stack trace walking for all architectures.
10 // The most important fact about a given architecture is whether it uses a link register. 10 // The most important fact about a given architecture is whether it uses a link register.
(...skipping 10 matching lines...) Expand all
21 // The other important fact is the size of a pointer: on 32-bit systems the LR 21 // The other important fact is the size of a pointer: on 32-bit systems the LR
22 // takes up only 4 bytes on the stack, while on 64-bit systems it takes up 8 byt es. 22 // takes up only 4 bytes on the stack, while on 64-bit systems it takes up 8 byt es.
23 // Typically this is ptrSize. 23 // Typically this is ptrSize.
24 // 24 //
25 // As an exception, amd64p32 has ptrSize == 4 but the CALL instruction still 25 // As an exception, amd64p32 has ptrSize == 4 but the CALL instruction still
26 // stores an 8-byte return PC onto the stack. To accommodate this, we use regSiz e 26 // stores an 8-byte return PC onto the stack. To accommodate this, we use regSiz e
27 // as the size of the architecture-pushed return PC. 27 // as the size of the architecture-pushed return PC.
28 // 28 //
29 // usesLR is defined below. ptrSize and regSize are defined in stubs.go. 29 // usesLR is defined below. ptrSize and regSize are defined in stubs.go.
30 30
31 const usesLR = GOARCH == "arm" 31 const usesLR = GOARCH != "amd64" && GOARCH != "amd64p32" && GOARCH != "386"
32 32
33 // jmpdeferPC is the PC at the beginning of the jmpdefer assembly function. 33 // jmpdeferPC is the PC at the beginning of the jmpdefer assembly function.
34 // The traceback needs to recognize it on link register architectures. 34 // The traceback needs to recognize it on link register architectures.
35 var jmpdeferPC uintptr 35 var jmpdeferPC uintptr
36 36
37 func init() { 37 func init() {
38 f := jmpdefer 38 f := jmpdefer
39 jmpdeferPC = **(**uintptr)(unsafe.Pointer(&f)) 39 jmpdeferPC = **(**uintptr)(unsafe.Pointer(&f))
40 } 40 }
41 41
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 495
496 func callers(skip int, pcbuf *uintptr, m int) int { 496 func callers(skip int, pcbuf *uintptr, m int) int {
497 sp := getcallersp(unsafe.Pointer(&skip)) 497 sp := getcallersp(unsafe.Pointer(&skip))
498 pc := uintptr(getcallerpc(unsafe.Pointer(&skip))) 498 pc := uintptr(getcallerpc(unsafe.Pointer(&skip)))
499 return gentraceback(pc, sp, 0, getg(), skip, pcbuf, m, nil, nil, false) 499 return gentraceback(pc, sp, 0, getg(), skip, pcbuf, m, nil, nil, false)
500 } 500 }
501 501
502 func gcallers(gp *g, skip int, pcbuf *uintptr, m int) int { 502 func gcallers(gp *g, skip int, pcbuf *uintptr, m int) int {
503 return gentraceback(^uintptr(0), ^uintptr(0), 0, gp, skip, pcbuf, m, nil , nil, false) 503 return gentraceback(^uintptr(0), ^uintptr(0), 0, gp, skip, pcbuf, m, nil , nil, false)
504 } 504 }
LEFTRIGHT

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