stack-trace

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

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 met...

Print stack trace information from C#

As part of some error handling in our product, we'd like to dump some stack trace information. However, we experience that many users will simply take a screenshot of the error message dialog instead of sending us a copy of the full report available from the program, and thus I'd like to make some minimal stack trace information availabl...

How to generate a stacktrace when my gcc C++ app crashes

When my c++ app crashes I would like to generate a stacktrace. I already asked this but I guess I needed to clarify my needs. My app is being run by many different users and it also runs on Linux, Windows and Macintosh ( all versions are compiled using gcc ). I would like my program to be able to generate a stack trace when it crashes...

Java logger that automatically determines caller's class name

public static Logger getLogger() { final Throwable t = new Throwable(); final StackTraceElement methodCaller = t.getStackTrace()[1]; final Logger logger = Logger.getLogger(methodCaller.getClassName()); logger.setLevel(ResourceManager.LOGLEVEL); return logger; } This method would return a logger that knows the class it's logging fo...

How can one grab a stack trace in C?

I know there's no standard C function to do this. I was wondering what are the techniques to to this on Windows and *nix? (Windows XP is my most important OS to do this on right now.) Thanks for the help! ...

How to get a stack trace when C++ program crashes? (using msvc8/2005)

Sometimes my c++ program crashes in debug mode, and what I got is a message box saying that an assertion failed in some of the internal memory management routines (accessing unallocated memory etc.). But I don't know where that was called from, because I didn't get any stack trace. How do I get a stack trace or at least see where it fail...

How do I include a stacktrace in my Django 500.html page?

I'm running Django 1.0 and I'm close to deploying my app. As such, I'll be changing the DEBUG setting to False. With that being said, I'd still like to include the stacktrace on my 500.html page when errors occur. By doing so, users can copy-and-paste the errors and easily email them to the developers. Any thoughts on how best to app...

Getting stack trace from a running Python application

I have this Python application that gets stuck from time to time and I can't find out where. Is there any way to signal Python interpreter to show you the exact code that he's running (somekind of stacktrace on-the-fly)? ...

How do I get a stack trace in OCaml?

The Objective Caml language will only produce stack traces if you ask for them just right - what are the requirements for both bytecode and native code? ...

StackTrace in Flash / ActionScript 3.0

I want to see the stack trace in any function of my code, so i made somthing like this to call it and print the stack trace: public function PrintStackTrace() { try { throw new Error('StackTrace'); } catch (e:Error) { trace(e.getStackTrace()); } } I like to know if there are other way to do this. In some pl...

How can I find the method that called the current method?

When logging in C#, how can I learn the name of the method that called the current method? I know all about System.Reflection.MethodBase.GetCurrentMethod(), but I want to go one step beneath this in the stack trace. I've considered parsing the stack trace, but I am hoping to find a cleaner more explicit way, something like Assembly.GetCa...

No stack trace generated on client site for NullPointerException?

I've been learning Java for about a month now, and not very familiar with a client/server situation like this one. Basically I ran into a situation where our client java software (GUI) displayed a nullpointerexception popup but no stack trace on the client side. Someone had to go check the server side for the stack trace. My question i...

Attaching the .net debugger while still providing useful logging on death

I would like to have some kind of catch-all exceptions mechanism in the root of my code, so when an app terminates unexpectedly I can still provide some useful logging. Something along the lines of static void Main () { if (Debugger.IsAttached) RunApp(); else { try { RunApp(); } catch...

Should I Print the Exception Stack Trace?

How inefficient is it to get the stack trace for an exception? I know it's costly, but how costly? Should they definitely not be used in production environment? ...

Hooking a Stacktrace in Delphi 2009

The Exception class in Delphi 2009 received a number of new features. A number of them are related to getting a stacktrace: property StackTrace: string *read* GetStackTrace; property StackInfo: Pointer read FStackInfo; class var GetExceptionStackInfoProc: function (P: PExceptionRecord): Pointer; class var GetStackInfoStringProc: funct...

PHP: Callback on Entry/Exit of Class Methods?

Is there a way I can set up callbacks on (or automataically log) method parameters, entries, and exits without making explicit calls within each method? I basically want to log this information to my logger class (which is static) without having to do it manually for each method. Right now I have to call Logger::logEntry() and Logger::l...

VB.NET and ASP.NET DLL line numbers don't appear in production error logs

I can see line numbers in my error logs in our development environment, in which VB.NET 2005 and ASP.NET components are compiled in debug mode, with PDB files copied to the server on deployment. I don't see line numbers in production, where things are compiled in release mode, and presumably no PDB files are created or deployed? Can som...

How do I make a thread dump in JBoss 4.0.5 on Windows

Hi! I'm running JBoss 4.0.5 on Windows 2003 x64 and wonder if there is any way to get a dump of all threads? It's stared with FireDaemon so I don't have a console windows in which to ctrl-break. It's running under java 1.5 so jstack won't work. I tried some program someone had made called sendsignal.exe, which I think actually crashe...

Using The StackTrace To Infer The Caller Of A Method

Edit: Warning - I now realize that the following technique is generally regarded as a bad idea because it creates hidden dependencies for the sake of looking neat. I recently discovered that you can use the StackTrace to infer information about the caller of a method. This enables you to create a seemingly "cool" API whereby you simp...

What means digits in Stack Trace

Exact duplicate of this question. When You get an error in .Net application we got an a Stack Trace. For example [ADOException: cannot open connection] NHibernate.Impl.SessionFactoryImpl.OpenConnection() +153 NHibernate.AdoNet.ConnectionManager.GetConnection() +119 NHibernate.Impl.SessionImpl.get_Connection() +42 What do...