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

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

Issue 884041: code review 884041: runtime: various arm fixes (Closed)
Left Patch Set: code review 884041: runtime: various arm fixes Created 15 years ago
Right Patch Set: code review 884041: runtime: various arm fixes Created 14 years, 12 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/amd64/asm.s ('k') | src/pkg/runtime/arm/arch.h » ('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 #include "runtime.h" 5 #include "runtime.h"
6 #include "malloc.h" 6 #include "malloc.h"
7 7
8 // This code is also used for the 386 tracebacks. 8 // This code is also used for the 386 tracebacks.
9 // Use uintptr for an appropriate word-sized integer. 9 // Use uintptr for an appropriate word-sized integer.
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 if(f->frame < sizeof(uintptr)) // assembly functions lie 92 if(f->frame < sizeof(uintptr)) // assembly functions lie
93 sp += sizeof(uintptr); 93 sp += sizeof(uintptr);
94 else 94 else
95 sp += f->frame; 95 sp += f->frame;
96 pc = *((uintptr*)sp - 1); 96 pc = *((uintptr*)sp - 1);
97 } 97 }
98 return n; 98 return n;
99 } 99 }
100 100
101 void 101 void
102 traceback(byte *pc0, byte *sp, byte *lr, G *g) 102 traceback(byte *pc0, byte *sp, byte*, G *g)
103 { 103 {
104 gentraceback(pc0, sp, g, 0, nil, 100); 104 gentraceback(pc0, sp, g, 0, nil, 100);
105 } 105 }
106 106
107 int32 107 int32
108 callers(int32 skip, uintptr *pcbuf, int32 m) 108 callers(int32 skip, uintptr *pcbuf, int32 m)
109 { 109 {
110 byte *pc, *sp; 110 byte *pc, *sp;
111 111
112 // our caller's pc, sp. 112 // our caller's pc, sp.
113 sp = (byte*)&skip; 113 sp = (byte*)&skip;
114 pc = ·getcallerpc(&skip); 114 pc = ·getcallerpc(&skip);
115 115
116 return gentraceback(pc, sp, g, skip, pcbuf, m); 116 return gentraceback(pc, sp, g, skip, pcbuf, m);
117 } 117 }
LEFTRIGHT

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