Update gcc/ChangeLog for r174861.
[official-gcc.git] / libgo / runtime / go-caller.c
blobb18759f2f4b8968fec7c670d528cd0e96a9e5f7e
1 /* go-caller.c -- runtime.Caller and runtime.FuncForPC for Go.
3 Copyright 2009 The Go Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file. */
7 /* Implement runtime.Caller. */
9 #include <stdint.h>
11 #include "go-string.h"
13 /* The values returned by runtime.Caller. */
15 struct caller_ret
17 uintptr_t pc;
18 struct __go_string file;
19 int line;
20 _Bool ok;
23 /* Implement runtime.Caller. */
25 struct caller_ret Caller (int n) asm ("libgo_runtime.runtime.Caller");
27 struct caller_ret
28 Caller (int n __attribute__ ((unused)))
30 struct caller_ret ret;
32 /* A proper implementation needs to dig through the debugging
33 information. */
34 ret.pc = (uint64_t) (uintptr_t) __builtin_return_address (0);
35 ret.file.__data = NULL;
36 ret.file.__length = 0;
37 ret.line = 0;
38 ret.ok = 0;
40 return ret;
43 /* Implement runtime.FuncForPC. */
45 void *FuncForPC (uintptr_t) asm ("libgo_runtime.runtime.FuncForPC");
47 void *
48 FuncForPC(uintptr_t pc __attribute__ ((unused)))
50 return NULL;