1 /* go-traceback.c -- stack backtrace for Go.
3 Copyright 2012 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. */
11 /* Print a stack trace for the current goroutine. */
19 c
= runtime_callers (1, locbuf
, nelem (locbuf
), false);
20 runtime_printtrace (locbuf
, c
, true);
24 runtime_printtrace (Location
*locbuf
, int32 c
, bool current
)
28 for (i
= 0; i
< c
; ++i
)
30 if (runtime_showframe (locbuf
[i
].function
, current
))
32 runtime_printf ("%S\n", locbuf
[i
].function
);
33 runtime_printf ("\t%S:%D\n", locbuf
[i
].filename
,
34 (int64
) locbuf
[i
].lineno
);