Click here to Skip to main content
15,867,771 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm new to programming language and when I share my problem on any website where people type comment to solution the problem, they were say that please share your stack trace and we can tell anything about your problem. I wonder how to read stack trace which is related to my problem?

What I have tried:

I have tried to spend much times but I couldn't understand about stack trace.
Posted
Updated 15-Oct-22 9:30am
Comments
Richard MacCutchan 15-Oct-22 15:08pm    
Since we have no idea what code you are using, or even what language, there is not much we can suggest. If you have a real problem then please show the code and explain exactly what the problem is.
vor_zakon_developer 15-Oct-22 15:21pm    
I am using Java so what?
Richard Deeming 17-Oct-22 6:39am    
NB: A stack trace is almost always insufficient to tell you what the problem is. You also need to provide the full error message, and the relevant part(s) of your code.

1 solution

A stack trace records what is currently on a thread's stack. The raw version of this just a hex dump. But if the required symbol information is available in the executable, the hex dump can be decrypted to show the function calls that lead from main to the function that recorded the stack. This reveals how the code got to the point that it did, so a stack trace is often recorded to help with debugging when an exception occurs.

If the value of the CPU's registers is also recorded with the trace, it may also be possible to look at each function's local variables. This is more difficult, however, because where a variable is currently located (on the stack or in a register) is up to the compiler. If the compiler has performed optimizations, it can be very difficult indeed to determine where a variable is currently located.

If you run your program in Visual Studio and stop at a breakpoint, you can see the chain of function calls in the "Call Stack" window, and you can see the local variables for each function in the "Locals" window.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900