backtrace

Android _Unwind_Backtrace inside sigaction

安稳与你 提交于 2019-12-21 12:11:02
问题 I am trying to catch signals such as SIGSEGV in my Android NDK app for debugging purpose. For that, I have set up a sigaction that is called. I am now trying to get the stack of the call. The problem is that _Unwind_Backtrace only works on current stack and sigaction runs inside its own stack. So, is there a way to get the stack of the execution pointer that received the signal? (Basically tell _Unwind_Backtrace to unwind another stack than the current?) I should point out that : Using

PHP - I want to know how to get function trace

给你一囗甜甜゛ 提交于 2019-12-20 07:22:09
问题 Is there any way to know all previous functions were called before a point in my code? For example: I set a point in abc.php in my project, and I want to get all functions that were called before that point was reached. debug_backtrace() does not help here. Thanks so much :) 回答1: xdebug can generate function traces for you. See: http://xdebug.org/docs/execution_trace 回答2: use xdebug it will show trace and much more useful info 回答3: Use xdebug for trace and webgrind for vizualization this one.

Is there a simple DWARF CFI represenation for functions that set up a conventional frame pointer?

99封情书 提交于 2019-12-19 18:48:40
问题 I'm programming in a mix of C, C++ and assembly and I'd like to get reliable backtraces from any part of the code. This mostly works fine for the C and C++ code since I can generate debugging info with -g , which for modern x86 compilers and platforms generates DWARF debugging information which means the final binary includes CFI (Call Frame Information). This information allows walking backwards though the functions in the current call stack. It can support complex scenarios such as

How can iterate the stack frames manually in C?

╄→尐↘猪︶ㄣ 提交于 2019-12-19 04:43:09
问题 While handling signals in applications I can correctly see the backtrace in the debugger.But the backtrace system call is not showing the stack frames correctly.Is there a difference in how gdb stores stack frames and how the backtrace system call dumps them? 回答1: You cannot portably iterate through the stack frames in C99 or C11. First because there is no guarantee of any call stack in the C standard. (one could imagine some C compiler doing whole program analysis and avoiding the stack if

What is the meaning of question marks '?' in Linux kernel panic call traces?

送分小仙女□ 提交于 2019-12-18 10:35:32
问题 The Call Trace contains entries like that: [<deadbeef>] FunctionName+0xAB/0xCD [module_name] [<f00fface>] ? AnotherFunctionName+0x12/0x40 [module_name] [<deaffeed>] ClearFunctionName+0x88/0x88 [module_name] What is the meaning of the '?' mark before AnotherFunctionName? 回答1: '?' means that the information about this stack entry is probably not reliable. The stack output mechanism (see the implementation of dump_trace() function) was unable to prove that the address it has found is a valid

How to unwind the stack to get backtrace for the specified stack pointer (SP)?

。_饼干妹妹 提交于 2019-12-17 18:13:06
问题 I'm writing this for Android (ARM only), but I believe the principle is the same for generic Linux as well. I'm trying to capture the stack trace from within the signal handler, so that I can log it when my app crashes. This is what I've come up with using <unwind.h> . Initialization: struct sigaction signalhandlerDescriptor; memset(&signalhandlerDescriptor, 0, sizeof(signalhandlerDescriptor)); signalhandlerDescriptor.sa_flags = SA_SIGINFO; signalhandlerDescriptor._u._sa_sigaction =

StackWalk64 on Windows - Get symbol name

爱⌒轻易说出口 提交于 2019-12-17 16:28:51
问题 Alright, second question on SO in one day. Looks like Windows programming makes me happy... : S I'm currently trying to get the function call stack on a Win32 executable. This morning, I've also asked a question about this: Win32 - Backtrace from C code Now, I'm pretty sure that the StackWalk64 function is the key for this. I've read some articles on how to use it, as well as the MS documentation. It actually displays frames on my test program, so it kinda work... The problem is that I'm not

Getting a backtrace of other thread

岁酱吖の 提交于 2019-12-17 07:31:17
问题 In Linux, to get a backtrace you can use backtrace() library call, but it only returns backtrace of current thread. Is there any way to get a backtrace of some other thread, assuming I know it's TID (or pthread_t) and I can guarantee it sleeps? It seems that libunwind (http://www.nongnu.org/libunwind/) project can help. The problem is that it is not supported by CentOS, so I prefer not to use it. Any other ideas? Thanks. 回答1: Signal Handling with the help of backtrace can solve your purpose.

Backtracing on Linux 64 bit from Signal Handler with malloc/free on callstack

我与影子孤独终老i 提交于 2019-12-12 12:15:01
问题 Below is an example of source I want to use on a machine running "Red Hat Enterprise Linux 5.5 (Tikanga) Kernel 2.6.18-194.el5xen x86_64" OS. The general idea is that I want to have backtrace of some thread, so I am raising a SIGUSR1 signal for that thread and a handler does a backtrace() call. In my scenario as below, FrameTwo function calls malloc and free in a loop. Whenever the signal is raised for this particular thread and free or malloc is on the callstack, the progream crashes when

Problems tracing file and line for debug logging (PHP)

匆匆过客 提交于 2019-12-12 04:43:55
问题 So I am trying to make a method that allows for logging debug messages on the fly, and I would like to include the file name and line number where the message occured. My first inclination was to give debug_backtrace() as one of the arguments for the logging method, which returns an array which contains the current file name and line number. The problem is, this only gives the file and line of the very first file called (index.php). index.php is only a five line file that calls a method from