github.com/searKing/golang/go@v1.2.117/runtime/cgosymbolizer/symbolizer.h (about) 1 // Copyright (c) 2019 The searKing authors. All Rights Reserved. 2 // 3 // Use of this source code is governed by a MIT-style license 4 // that can be found in the LICENSE file in the root of the source 5 // tree. An additional intellectual property rights grant can be found 6 // in the file PATENTS. All contributing project authors may 7 // be found in the AUTHORS file in the root of the source tree. 8 9 // +build cgo 10 11 #ifndef GO_RUNTIME_CGOSYMBOLIZER_CGO_H_ 12 #define GO_RUNTIME_CGOSYMBOLIZER_CGO_H_ 13 // We want to get a definition for uintptr_t 14 #include <cstdint> 15 16 struct cgoSymbolizerMore { 17 struct cgoSymbolizerMore* more; 18 19 const char* file; 20 uintptr_t lineno; 21 const char* func; 22 }; 23 24 // runtime/traceback.go 25 struct cgoSymbolizerArg { 26 uintptr_t pc; // program counter to fetch information for 27 const char* file; // file name (NUL terminated) 28 uintptr_t lineno; // line number 29 const char* func; // function name (NUL terminated) 30 uintptr_t entry; // function entry point 31 uintptr_t more; // set non-zero if more info for this PC 32 // uintptr_t data;// unused by runtime, available for function 33 cgoSymbolizerMore* data; // unused by runtime, available for function 34 }; 35 36 #ifdef __cplusplus 37 extern "C" { 38 #endif 39 40 void cgoSymbolizer(cgoSymbolizerArg* arg); 41 42 #ifdef __cplusplus 43 } 44 #endif 45 46 #endif // GO_RUNTIME_CGOSYMBOLIZER_CGO_H_