stack-trace

Get run time type of stack frames

邮差的信 提交于 2019-12-19 09:56:28
问题 I was wondering if it were possible to obtain the run time type of method callers in the stack trace. Consider the following example: class Parent { public void Foo() { var stack = new StackTrace(); foreach (var frame in stack.GetFrames()) { var methodInfo = frame.GetMethod(); Console.WriteLine("{0} (ReflectedType: {1})", methodInfo.ToString(), methodInfo.DeclaringType); } } } class Child : Parent { } If I create an instance of Child and call Foo var child = new Child(); child.Foo(); Foo will

Finding Stack Trace in Eclipse with Android

自闭症网瘾萝莉.ら 提交于 2019-12-19 07:43:32
问题 Not used to using Eclipse for java, mainly used jEdit but with the Android dev along comes Eclipse. I've switched to the debug window and pressed the debug button which starts my app, It crashes however I can't find the stack trace. I can see in the 'Debug' pane that it has crashed with a '' exception however I can't see any more information. Not sure if you can get it but I'm a little used to Visual Studio with line numbers and a bit more information saying what went wrong. As I said all I'm

exception with no stack trace - how?

为君一笑 提交于 2019-12-18 18:51:52
问题 We have a service which will log unhandled exceptions at the app domain level (via Log4net). We logged: 2014-01-28 16:49:19,636 ERROR [49] FeedWrapperService - unhandled System.NullReferenceException: Object reference not set to an instance of an object. This exception has no stack trace. How is that possible without doing some crazy things to the exception object? Our handling code: AppDomain.CurrentDomain.UnhandledException += LogAnyExceptions; private void LogAnyExceptions(object sender,

How to determine main class at runtime in threaded java application?

▼魔方 西西 提交于 2019-12-18 14:14:14
问题 I want to determine the class name where my application started, the one with the main() method, at runtime, but I'm in another thread and my stacktrace doesn't go all the way back to the original class. I've searched System properties and everything that ClassLoader has to offer and come up with nothing. Is this information just not available? Thanks. 回答1: See the comments on link given by Tom Hawtin. A solution is these days is (Oracle JVM only): public static String getMainClassAndArgs() {

Fast capture stack trace on windows / 64-bit / mixed mode

落花浮王杯 提交于 2019-12-18 13:28:10
问题 Like most of you probably know there exists plenty of different mechanisms to walk stack traces, starting from windows api, and continuing further into depth of magical assembly world - let me list here some of links I've already studied. For of all let me mention that I want to have mechanism of memory leak analysis of mixed mode (managed and unmanaged) / 64-bit + AnyCPU application and from all windows api's CaptureStackBackTrace is most suitable for my needs, but as I have analyzed - it

How to I resolve GetFrameContext failed in Windbg

孤人 提交于 2019-12-18 13:01:33
问题 I'm debugging a .NET 4.0 web application using a full crash dump and Windbg. I seem able to get all the versions of everything to match up however when I try to get the managed stack trace of all the thread I get OS Thread Id: 0x7cd4 (13) Child SP IP Call Site GetFrameContext failed: 1 For all of my managed threads. Any ideas what I'm doing wrong and how I can fix it? 回答1: I was also getting this error, but I noticed that running !DumpStack does give me a trace when !ClrStack does not.

Django: manage.py does not print stack trace for errors

情到浓时终转凉″ 提交于 2019-12-18 12:51:38
问题 In Django, most of the time when I run manage.py and it encounters an error, I don't get the full stack trace for the error, just the text of the exception, making it very hard to debug. Example: python manage.py graph_models -a -g -o my_project.png AttributeError: 'str' object has no attribute '__module__' (This is for the graph_models add-on, but it also occurs for built in commands. The only exception I found is runserver , which encounters the same errors as the other commands but prints

How to get longer stack dump (tombstone) from android?

你说的曾经没有我的故事 提交于 2019-12-18 10:20:36
问题 As I have noticed, logcat returns always 34 lines of crashlog, like this: 4cf7c700 401c0000 4cf7c704 48463ff0 4cf7c708 44d11f7c 4cf7c70c afd0cd89 4cf7c710 00000000 4cf7c714 82ab29dc libmyproject.so 4cf7c718 00000000 4cf7c71c 4cf7c73c 4cf7c720 836c44f0 libmyproject.so 4cf7c724 82f3a414 libmyproject.so 4cf7c728 4cf7c768 4cf7c72c 0000008d 4cf7c730 007ea0a8 [heap] 4cf7c734 00270100 [heap] 4cf7c738 e3a07077 4cf7c73c ef900077 4cf7c740 00000000 4cf7c744 4cf7c774 4cf7c748 836c44f0 libmyproject.so

How can I invoke buffer overflow?

隐身守侯 提交于 2019-12-18 10:16:10
问题 I got a homework assignment asking me to invoke a function without explicitly calling it, using buffer overflow. The code is basically this: #include <stdio.h> #include <stdlib.h> void g() { printf("now inside g()!\n"); } void f() { printf("now inside f()!\n"); // can only modify this section // cant call g(), maybe use g (pointer to function) } int main (int argc, char *argv[]) { f(); return 0; } Though I'm not sure how to proceed. I thought about changing the return address for the program

Recording SQL Server call stack when reporting errors

我只是一个虾纸丫 提交于 2019-12-18 04:54:26
问题 This is a follow up to the question Nested stored procedures containing TRY CATCH ROLLBACK pattern? In the catch block I use a stored procedure to report (reraise) the error by reading from ERROR_MESSAGE(), ERROR_PROCEDURE(), ERROR_LINE(), etc. As described here I also have a check so that it can determine if the error has already been rethrown (this happens with nested stored procedures as the error information is passed down through each TRY CATCH block). What I would like to do, either