callstack

Detecting redundant function calls within call stack tree with DTrace

泄露秘密 提交于 2019-12-11 05:57:35
问题 I'm having a hard time tracking down unnecessary redundant calls within a rather complex algorithm. It looks like (some of my) my algorithm(s) is/are seriously slowed down by redundant calls (in several subroutines) of a non-cached and comparatively expensive function. To confirm this I'd like to utilize Dtrace to detect multiple calls of a single function within a given branch of the call stack tree. I'd like to be able to ask dtrace to: search the call stack tree within a given function

Stacktrace begins with 0x0

删除回忆录丶 提交于 2019-12-11 05:55:59
问题 I am currently analysing an odd callstack that starts from 0x00000000. How is it actually possible for ELF ring3 application? It has a default 0x8048000 as entry point. Thank you. 回答1: There was a missing library for GDB, so the debugger mapped its call as 0x0. 来源: https://stackoverflow.com/questions/10302630/stacktrace-begins-with-0x0

How do I determine detailed call-stack information in C++?

浪子不回头ぞ 提交于 2019-12-11 04:38:54
问题 I’d like to understand the call-stack a bit better, and in an effort to do so, I’d like to work with it some more. What will I do with this information? I have no idea! It’s fun to learn new things though, and this is my new thing for today. I don’t like the call-stack in my programs being this mystical entity that I know nothing about. How big is it? How much memory is available on my current call-stack? Where is it? I don't know! And, I would like to know. My current way to deal with the

Answering “Which method called me?” at the run-time in .NET? Or is CallStack data readable by the code?

杀马特。学长 韩版系。学妹 提交于 2019-12-11 02:14:43
问题 Presume that there are methodA() , methodB() and methodC(). And methodC() is called at the run-time. Is is possible to know methodC() is called from what method? I was thinking if CallStack can be read at the run-time for some checks? If yes, I think it should not be a big deal. Any ideas? Thanks! 回答1: Use the StackTrace and StackFrame classes. For example: StackTrace stackTrace = new StackTrace(); StackFrame[] stackFrames = stackTrace.GetFrames(); foreach (StackFrame stackFrame in

R count function calls

感情迁移 提交于 2019-12-10 20:07:49
问题 This should be easy, but can't find any straight-forward answers on google or SO. Imagine in R I run a function FOuter() , and within its body, it does some loop and calls another function FInner() . Is there a simple way of counting/recording the number of times FInner gets called? I'm trying to estimate how much time I can save if I optimize FInner . 回答1: You're looking for trace . f1 <- function() 1 f2 <- function() { for(i in 1:10) f1() } .count <- 0 trace(f1, tracer=function() .count <<-

exception in C code

落爺英雄遲暮 提交于 2019-12-10 17:45:49
问题 Wondering what this exception is about? NTUnhandledExceptionHandler@NTExceptionHandler@@CGJPAU_EXCEPTION_POINTERS@@@Z! jdenet_k.exe ? =====Call stack of thread 5612===== _LogNTCallStackDump@8! jdel.dll ?NTUnhandledExceptionHandler@NTExceptionHandler@@CGJPAU_EXCEPTION_POINTERS@@@Z! jdenet_k.exe 0x78c65b6.<nosymbols>! qstatus.dll 0x771bd29e.<nosymbols>! ntdll.dll 0x771bd45f.<nosymbols>! ntdll.dll ====> Exception C0000005 ACCESS_VIOLATION occurred in thread 5612 with call stack: _jdeStrcmp@8!

c++ stacktrace from the function an exception is thrown?

喜欢而已 提交于 2019-12-10 14:49:49
问题 I can make use of gcc's backtrace to obtain a stack trace at any given point of a program, but I would like to obtain the trace from whatever frame the stack was in at the time an exception is thrown, ie prior to the stack unwinding. For instance, the following block func() { throw std::exception(); } try { func(); } catch ( std::exception ) { std::cout << print_trace(); //do stuff } ought to still be able to retain a frame for func() somehow. This has been asked before, but it involved an

VERY strange stack overflow in C++ program

给你一囗甜甜゛ 提交于 2019-12-10 11:13:54
问题 I wrote a program some time ago (Mac OS X, C++, SDL, FMOD) and it perfomed rather good. But lately I wanted to extend its functionality and added some more code to it. And now, when I run it and try to test the new functionality, the program crashes with SIGABRT. Looking into debugger, on function stack I see: _kill kill$UNIX2003 raise __abort __stack_chk_fail odtworz <-- my function that was was modified As far as I know, "__stack_chk_fail" indicates a stack overflow. But that's not the

Simple dynamic call graphs in Java [closed]

南楼画角 提交于 2019-12-10 10:39:44
问题 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 6 years ago . I am looking for a simple dynamic call graph logger for Java that you can add in a few lines of code. I know there is an Aspect J solution. Also, I helped Zola develop Glow for C/C++ so I could rewrite a similar tool but I don't want to dig into JVM internals. Any open source solution out there right now that is

Monitoring call stack size in Visual Studio

独自空忆成欢 提交于 2019-12-10 10:28:47
问题 Is there a way to monitor the call stack size in Visual Studio ? A call stack window is provided while running but does not show the size of the stack. I am using C++ and facing stack overflow issue. I know something might be wrong about some recursive functions I am using, but before solving these issues I would like to monitor the call stack size to see what is going on. 回答1: Using a data breakpoint can be helpful here. Wherever you happen to be in the code, it doesn't matter as long as you