stack-trace

Method for runtime comparison of two programs' objects

孤街浪徒 提交于 2019-12-07 08:32:38
问题 I am working through a particular type of code testing that is rather nettlesome and could be automated, yet I'm not sure of the best practices. Before describing the problem, I want to make clear that I'm looking for the appropriate terminology and concepts, so that I can read more about how to implement it. Suggestions on best practices are welcome, certainly, but my goal is specific: what is this kind of approach called? In the simplest case, I have two programs that take in a bunch of

Stack unwinding on HP-UX and Linux

蹲街弑〆低调 提交于 2019-12-07 05:42:16
问题 I need to get the stack information of my C application in certain points. I've read the documentation and searched the Net but still cannot figure out how I can do it. Can you point to a simple process explanation? Or, even better, to an example of stack unwinding. I need it for HP-UX (Itanium) and Linux. 回答1: Check out linux/stacktrace.h Here is an API reference: http://www.cs.cmu.edu/afs/cs/Web/People/tekkotsu/dox/StackTrace_8h.html Should work on all Linux kernels Here is an alternative

Requesting a stack trace for a Java ThreadInfo?

时光总嘲笑我的痴心妄想 提交于 2019-12-07 05:25:41
问题 I have an application that calls getStackTrace() on a java.lang.management.ThreadInfo object, but the StackTraceElement array produced by the invocation is zero length. Inspecting the Javadoc shows this (emphasis mine): public StackTraceElement[] getStackTrace() Returns the stack trace of the thread associated with this ThreadInfo. If no stack trace was requested for this thread info, this method will return a zero-length array . If the returned array is of non-zero length then the first

Perl: $SIG{__DIE__}, eval { } and stack trace

不羁岁月 提交于 2019-12-06 20:27:25
问题 I have a piece of Perl code somewhat like the following (strongly simplified): There are some levels of nested subroutine calls (actually, methods), and some of the inner ones do their own exception handling: sub outer { middle() } sub middle { eval { inner() }; if ( my $x = $@ ) { # caught exception if (ref $x eq 'ARRAY') { print "we can handle this ..."; } else { die $x; # rethrow } } } sub inner { die "OH NOES!" } Now I want to change that code so that it does the following: print a full

Is it possible to track down which expression caused an NPE?

泄露秘密 提交于 2019-12-06 18:29:57
问题 When I get an NPE, I'll get a stack trace with line number. That's helpful, but if the line is very dense and/or contains nested expression, it's still impossible to figure out which reference was null. Surely, this information must've been available somewhere. Is there a way to figure this out? (If not java expression, then at least the bytecode instruction that caused NPE would be helpful as well) Edit #1: I've seen a few comments suggesting breaking up the line, etc, which, no offence, is

Android Log.X not printing stacktrace

孤街浪徒 提交于 2019-12-06 18:15:47
问题 e.printStackTrace() works fine (i.e. prints my stacktrace to stderr) but Log.X fails to print a stacktrace at all. For example: } catch (IOException e) { Log.e("Network", "Exception", e); e.printStackTrace(); } Output: 08-31 03:46:21.992: W/Network(13238): Exception 08-31 03:46:22.092: W/System.err(13238): java.net.UnknownHostException: Unable to resolve host "...": No address associated with hostname 08-31 03:46:22.204: W/System.err(13238): at java.net.InetAddress.lookupHostByName

The logcat in android shows simply shutting down the VM?

元气小坏坏 提交于 2019-12-06 13:35:55
问题 Yesterday it worked perfectly, but today shows a message "unfortunately the app has stopped", and the logcat shows "shutting down the VM". Stack Trace of this app.. 11-27 13:24:17.035: W/Trace(806): Unexpected value from nativeGetEnabledTags: 0 11-27 13:24:17.455: W/Trace(806): Unexpected value from nativeGetEnabledTags: 0 11-27 13:24:17.485: W/Trace(806): Unexpected value from nativeGetEnabledTags: 0 11-27 13:24:17.485: D/AndroidRuntime(806): Shutting down VM 11-27 12:30:51.683: D

XCode Global Breakpoints don't show stack trace

社会主义新天地 提交于 2019-12-06 11:45:58
问题 I set up global break points from locations libobjc.A.dylib and CoreFoundation. I run my iphone app and it hits the exception. XCode stops at the breakpoint but does not show any error in the log besides: Pending breakpoint 1 - "objc_exception_throw" resolved Pending breakpoint 2 - "-[NSException raise]" resolved I click the "Continue" button on the console and I get the same indistinguishable error I received before I enabled the breakpoints. How do I get the stack trace that setting up the

Why do my exception stack traces always point to the last method line?

纵饮孤独 提交于 2019-12-06 10:43:27
I have a problem with my Visual Studio installation. When I got an exception I always have incorrect line numbers in it's stack trace. There are always point to last line of each method in my codebase. At the same time it's OK when I'm tracing programs with debugger. What's happed with PDBs? No, I'm not re-throwing exception at each method. In each line of stack trace I have last row of corresponding method, while exception had thrown by statement in the middle. Sounds like you're running your app in Release mode. Release mode has difficulties with line numbers for exceptions and whatnot.

Get object call hierarchy

谁说胖子不能爱 提交于 2019-12-06 10:18:20
Lets say I have 3 classes: class A { void do_A() { //Check object call hierarchy } } class B { void do_B() { A a; a.do_A(); } } class C { void do_C() { B b; b.do_A(); } } And then I call: C c; c.do_C(); How can i get the object call hierarchy from within A's do_A() ? I mean I want to get the references of object in a.do_A() (can be easily attained by this ), the reference of object b that called a.do_A() , and the reference of object c that called b.do_B() . I think this should be possible, because I can get the call hierarchy with call stack, so I'm sure I should be able to get some more