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

Side by Side Diff: src/pkg/runtime/traceback_arm.c

Issue 12163043: code review 12163043: cmd/gc: record argument size for all indirect function calls (Closed)
Patch Set: diff -r 475e11851fc1 https://dvyukov%40google.com@code.google.com/p/go/ Created 11 years, 8 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:
View unified diff | Download patch
« no previous file with comments | « src/pkg/reflect/asm_arm.s ('k') | src/pkg/runtime/traceback_x86.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 runtime·throw("unknown caller pc"); 95 runtime·throw("unknown caller pc");
96 } 96 }
97 } 97 }
98 98
99 frame.varp = (byte*)frame.fp; 99 frame.varp = (byte*)frame.fp;
100 100
101 // Derive size of arguments. 101 // Derive size of arguments.
102 // Most functions have a fixed-size argument block, 102 // Most functions have a fixed-size argument block,
103 // so we can use metadata about the function f. 103 // so we can use metadata about the function f.
104 // Not all, though: there are some variadic functions 104 // Not all, though: there are some variadic functions
105 » » // in package runtime, and for those we use call-specific 105 » » // in package runtime and reflect, and for those we use call-spe cific
106 // metadata recorded by f's caller. 106 // metadata recorded by f's caller.
107 if(callback != nil || printing) { 107 if(callback != nil || printing) {
108 frame.argp = (byte*)frame.fp + sizeof(uintptr); 108 frame.argp = (byte*)frame.fp + sizeof(uintptr);
109 if(f->args != ArgsSizeUnknown) 109 if(f->args != ArgsSizeUnknown)
110 frame.arglen = f->args; 110 frame.arglen = f->args;
111 else if(flr == nil) 111 else if(flr == nil)
112 frame.arglen = 0; 112 frame.arglen = 0;
113 else if(frame.lr == (uintptr)runtime·lessstack) 113 else if(frame.lr == (uintptr)runtime·lessstack)
114 frame.arglen = stk->argsize; 114 frame.arglen = stk->argsize;
115 else if((i = runtime·funcarglen(flr, frame.lr)) >= 0) 115 else if((i = runtime·funcarglen(flr, frame.lr)) >= 0)
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 int32 238 int32
239 runtime·callers(int32 skip, uintptr *pcbuf, int32 m) 239 runtime·callers(int32 skip, uintptr *pcbuf, int32 m)
240 { 240 {
241 uintptr pc, sp; 241 uintptr pc, sp;
242 ········ 242 ········
243 sp = runtime·getcallersp(&skip); 243 sp = runtime·getcallersp(&skip);
244 pc = (uintptr)runtime·getcallerpc(&skip); 244 pc = (uintptr)runtime·getcallerpc(&skip);
245 245
246 return runtime·gentraceback(pc, sp, 0, g, skip, pcbuf, m, nil, nil, fals e); 246 return runtime·gentraceback(pc, sp, 0, g, skip, pcbuf, m, nil, nil, fals e);
247 } 247 }
OLDNEW
« no previous file with comments | « src/pkg/reflect/asm_arm.s ('k') | src/pkg/runtime/traceback_x86.c » ('j') | no next file with comments »

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