我的编程常用

BSD Library Functions Manual

SYNOPSIS

#include <execinfo.h>

     int

     backtrace(void** array, int size);

     char**

     backtrace_symbols(void* const* array, int size);

     void

     backtrace_symbols_fd(void* const* array, int size, int fd);

     void

     backtrace_image_offsets(void* const* array, struct image_offset *image_offsets, int size);

     int

     backtrace_from_fp(void* startfp, void** array, int size);

DESCRIPTION

     These routines provide a mechanism to examine the current thread's call stack.

     backtrace() writes the function return addresses of the current call stack to the array of pointers referenced by array.  At most, size pointers are writ-

     ten.  The number of pointers actually written to array is returned.

     backtrace_symbols() attempts to transform a call stack obtained by backtrace() into an array of human-readable strings using dladdr().  The array of strings

     returned has size elements.  It is allocated using malloc() and should be released using free().  There is no need to free the individual strings in the

     array.

     backtrace_symbols_fd() performs the same operation as backtrace_symbols(), but the resulting strings are immediately written to the file descriptor fd, and

     are not returned.

     backtrace_image_offsets() attempts to transform a call stack obtained by backtrace() into an array of image offsets, for deferred symbolication.  Each entry

     in the array has an offset relative to the __TEXT section of the image with the given UUID.  The results are written to image_offsets which should be an

     array of size length.

     backtrace_from_fp() takes a backtrace of frames starting from the given frame pointer.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值