backtrace

How to make backtrace()/backtrace_symbols() print the function names?

☆樱花仙子☆ 提交于 2019-11-26 10:12:53
问题 The Linux specific backtrace() and backtrace_symbols() allows you to produce a call trace of the program. However, it only prints function addresses, not their names for my program. How can I make them print the function names as well ? I\'ve tried compiling the program with -g as well as -ggdb . The test case below just prints this: BACKTRACE ------------ ./a.out() [0x8048616] ./a.out() [0x8048623] /lib/libc.so.6(__libc_start_main+0xf3) [0x4a937413] ./a.out() [0x8048421] --------------------

How can I get PHP to produce a backtrace upon errors?

元气小坏坏 提交于 2019-11-26 09:20:50
问题 Trying to debug PHP using its default current-line-only error messages is horrible. How can I get PHP to produce a backtrace (stack trace) when errors are produced? 回答1: Xdebug prints a backtrace table on errors, and you don't have to write any PHP code to implement it. Downside is you have to install it as a PHP extension. 回答2: My script for installing an error handler that produces a backtrace: <?php function process_error_backtrace($errno, $errstr, $errfile, $errline, $errcontext) { if(!

Win32 - Backtrace from C code

泪湿孤枕 提交于 2019-11-26 09:17:06
问题 I\'m currently looking for a way to get backtrace information under Windows, from C code (no C++). I\'m building a cross-platform C library, with reference-counting memory management. It also have an integrated memory debugger that provides informations about memory mistakes (XEOS C Foundation Library). When a fault occurs, the debugger is launched, providing information about the fault, and the memory record involved. On Linux or Mac OS X, I can look for execinfo.h in order to use the