stack-trace

StackTrace class methods not working in release mode

ぃ、小莉子 提交于 2019-12-10 19:09:46
问题 below is my piece of code which i am using to log my error details. StackTrace sTrace = new StackTrace(true); string functionname = Environment.NewLine + " MethodName - " + sTrace.GetFrame(1).GetMethod().Name; string classname = Environment.NewLine + " File Path - " + sTrace.GetFrame(1).GetFileName() + Environment.NewLine + " Line No. - " + sTrace.GetFrame(1).GetFileLineNumber() + Environment.NewLine + " ClassName - " + sTrace.GetFrame(1).GetMethod().ReflectedType.Name + Environment.NewLine +

How can I tell if a function is called in a loop within python's tracer function?

时光毁灭记忆、已成空白 提交于 2019-12-10 18:54:59
问题 In the tracer callback set with python's sys.settrace() , I can get the function name, line number, etc. Now I want to know whether the current function being traced is called in a loop by its caller. Is there a way to do this? 来源: https://stackoverflow.com/questions/30770628/how-can-i-tell-if-a-function-is-called-in-a-loop-within-pythons-tracer-function

Initialize exception with stacktrace from another exception?

﹥>﹥吖頭↗ 提交于 2019-12-10 18:27:34
问题 I have client-server system. They communicate via RMI, so serialization/deserialization is involved. Server sends a response to client upon a request. If exception occurs it is set in the response. However, if some exception occurs at the server and the client does not know about it. So I need to wrap the original exception but to keep the stacktrace for debug purposes. Is there more elegant solution? //response from server to client class Response { private MyException e; public void set

How can the line numbers in my stack traces be wrong?

筅森魡賤 提交于 2019-12-10 18:08:42
问题 I have a python (version 2.7.6) program that had been running for a day or two as of last night when it reported some errors. However, the stack traces were blatantly wrong. Pretend my code is like this: def do_A(): do_some_stuff() do_B() def do_B(): do_some_IO_that_could_fail() def do_C(): if len('abc'): do_D() def do_D(): do_other_stuff() if __name__ == '__main__': do_A() The task that can fail did fail, but my stack trace was like this : Traceback (most recent call last): File "myfile.py",

Get stack trace from uncaught exception?

牧云@^-^@ 提交于 2019-12-10 17:55:35
问题 I realise this will be platform specific: is there any way to get a stack trace from an uncaught C++ exception, but from the point at which the exception is thrown? I have a Windows Structured Exception Handler to catch access violations, etc. and generate a minidump. But of course that won't get called in the event of termination due to an uncaught C++ exception, and so there is no crash dump. I'm looking for a Windows solution at the moment (no matter how dirty!), but would like to hear

React Native Stack Trace

筅森魡賤 提交于 2019-12-10 16:36:50
问题 I have React Native App linked with Firebase Crashlytics. The issue is firebase sending unreadable stack trace like the one bellow. There is any way to read this kind on errors. I just want to know when the error is thrown. This is my stack trace Fatal Exception: com.facebook.react.common.JavascriptException: Invariant Violation: Invariant Violation: Invariant Violation: inputRange must be monotonically non-decreasing 0,-1 This error is located at: in n in RCTView in t in t in Connect(t) in t

Getting generic arguments from a class in the stack

怎甘沉沦 提交于 2019-12-10 15:58:10
问题 I have a generic class called Repository. This class has a function that "calls itself" by initializing a new instance of the Repository class with a different generic argument. This "recursion" can go on - so to avoid StackOverflowException, i need to check if there is in the stack, a method called from the Repository class with the same generic argument. here is my code: StackTrace stack = new StackTrace(); StackFrame[] frames = stack.GetFrames(); foreach (StackFrame frame in frames) { Type

specs2: How to use “failtrace” option

杀马特。学长 韩版系。学妹 提交于 2019-12-10 15:04:04
问题 In my specs2 tests, I frequently use helper functions to test groups of conditions at once. Unfortunately, that makes the line number output of failed tests useless, since all failures are on the same line. Google turned up that there's a "failtrace" option that will output the stack trace of failure. However, I can't find an example of how to actually use that. Is it in build.sbt ? Is it used on the SBT command line? Is it set somehow in the constructor of the Specification class? 回答1: You

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

Why do I loose stack trace when using async-await in Node.js?

余生颓废 提交于 2019-12-10 14:35:57
问题 When I run the following program async function functionOne() { throw new Error('Error here prints the complete stack'); await new Promise((resolve) => { setTimeout(() => { resolve(); }, 1000); }); } async function functionTwo() { await functionOne(); } async function functionThree() { await functionTwo(); } functionThree() .catch((error) => { console.error(error); }); I get the following output which prints the stack through the various invoked functions Error: Error here prints the complete