backtrace

Why does PHPUnit hide my xdebug backtrace?

雨燕双飞 提交于 2020-01-19 13:09:05
问题 I have PHPUnit and xdebug installed, and in my php.ini files for CLI I've got: display_errors = On xdebug.default_enable = 1 I've verified that an xdebug backtrace is printed when I create an error using the interactive console, but when an error occurs while running phpunit, there is no backtrace? What is happening to the backtrace? Is phpunit hiding it from me? Is there some setting I'm missing? Thanks! 回答1: What is happening to the backtrace? Is phpunit hiding it from me? Yes, PHPUnit

GDB cannot show the stack and shows “#1 0x0000000000000000 in ?? ()”

此生再无相见时 提交于 2020-01-01 14:06:48
问题 I have a multi-threaded C++ program that deadlocks in some rare cases. The problem is hard to reproduce and I can only reproduce it in a remote machine. The method I want to use for solving this problem is run the program wait for deadlock send abort signal to it for generating core dump copy the dump back to my local machine use gdb to debug it I do not have gdb on the remote machine and cannot install anything on it. The problem is when I am debugging the core dump (obtained from either a

Is there a cheaper way to find the depth of the call stack than using backtrace()?

会有一股神秘感。 提交于 2019-12-30 05:30:10
问题 My logging code uses the return value of backtrace() to determine the current stack depth (for pretty printing purposes), but I can see from profiling that this is a pretty expensive call. I don't suppose there's a cheaper way of doing this? Note that I don't care about the frame addresses, just how many of them there are. edit: These logging functions are used all over a large code-base, so manually tracking the stack depth isn't really an option. 回答1: Walking the stack yourself is pretty

Is there a library call to addr2line? [closed]

那年仲夏 提交于 2019-12-30 01:54:13
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I need to get the information provided by addr2line (file and line from backtracing a function call) from within a C++ program. Is there a library call similar to addr2line? edit: I am working in a Linux environment. I know I can call addr2line directly and I know that I can use the source code of addr2line in

Is there a way to dump stack trace with line number from a Linux release binary?

浪子不回头ぞ 提交于 2019-12-30 01:11:09
问题 I have a requirement of dumping stack traces when my c++ Linux application crashes. I was successfully able to do this using backtrace() and backtrace_symbols() . Now, additionally I would like to get the line numbers of the crash. How do it do it? 回答1: I took help from http://www.linuxjournal.com/files/linuxjournal.com/linuxjournal/articles/063/6391/6391l2.html and http://www.linuxjournal.com/article/6391?page=0,0 to come up with sample code which shows how you can achieve this. Basically it

Recover frame pointer for broken back trace?

牧云@^-^@ 提交于 2019-12-25 04:26:00
问题 I'm having trouble getting a back trace for a crash on a Raspberry Pi 3 dev-board (RPI3). The RPI3 is a low-end ARMv8 with a Broadcom SoC, with CRC32 extensions, but without Crypto extensions. The program is the test suite for the Botan Crypto and TLS C++ library. The program was built with the following flags. The --debug-mode means the program was built with symbols ( -g ) and without optimizations (no -O ). ./configure.py --cc=gcc --debug-mode --cpu=armv8-a --cc-abi-flags="-march=armv8-a

Is there a gcc macro for determining that frame pointers are not eliminated?

与世无争的帅哥 提交于 2019-12-24 04:55:09
问题 When -fomit-frame-pointer is used (automatic for various -O settings), performing a backtrace is problematic. I am wondering if there is a way of determining at compile time that the code is compiled with this switch? In that case, I could put in an #ifndef to guard against backtracing when ill-advised. Is any macro set when this -fomit-frame-pointer switch is on? Thanks, SetJmp 回答1: I just tried this: gcc -E -fomit-frame-pointer -Wp,-dM foo.c > fpo.out gcc -E -Wp,-dM foo.c > no-fpo.out diff

Debuggable replacement for make_shared()

﹥>﹥吖頭↗ 提交于 2019-12-23 18:05:36
问题 Using gcc 4.6.2, make_shared() gives a useless backtrace (apparently due to some rethrow) if a constructor throws an exception. I'm using make_shared() to save a bit of typing, but this is show stopper. I've created a substitute make_shrd() that allows a normal backtrace. I'm using gdb 7.3.1. I'm worried that: The bad backtrace under make_shared() is somehow my own fault My substitute make_shrd() will cause me subtle problems. Here's a demo: #include <memory> #include <stdexcept> using

Uncaught TypeError: Cannot read property 'length' of undefined

我们两清 提交于 2019-12-23 08:02:15
问题 I have a plugin that access the length property on many elements. However, the javascript console points to line 12 of jquery.min.js. How can I backtrace to find the offending line in my plugin? 回答1: How can I backtrace to find the offending line in my plugin? firebug is great way to debug those errors. (source: getfirebug.com) 回答2: If you use minified scripts any debugger (like totally the best firebug) will show you the same problematic line and this information is useless (minified scripts

OS X kernel panic diagnostics. How to translate backtrace addresses

跟風遠走 提交于 2019-12-21 20:33:34
问题 I'm debugging a driver that cause kernel dump on my mac. It shows long backtrace composed out of series of addresses: panic(cpu 6 caller 0xffffff8004dc9986): trying to interlock destroyed mutex (0xffffff8049deedb0) Backtrace (CPU 6), Frame : Return Address 0xffffff93b1c8bb50 : 0xffffff8004ce5307 0xffffff93b1c8bbd0 : 0xffffff8004dc9986 0xffffff93b1c8bbe0 : 0xffffff8004d099eb 0xffffff93b1c8bc20 : 0xffffff7f85604899 0xffffff93b1c8bc50 : 0xffffff800519776b 0xffffff93b1c8bc90 : 0xffffff80051f336c