Reputation: 1857
Edit:
Alright I will edit my question, this time I know now what I really need. My original questions stems for the lack of information that I need to solve my problem. Of course! It has something to do with my code, my bad. But just an airplane crashing into the land, I need what info on the plane is doing before the crash and what the pilot is doing before the crash.
Similar to what I need, if I have a main which calls function1 and function1 calls function2 and on function2 causes crash, so on stack function2, function1, main. Of course there is a crash so I need to see like, function1, main. I do know for the fact that function1 work so well and commented out function2 call from function1. Great! It works like a charm and by GOD I know there is something wrong with function2! My problem is solved! There must be some kind of feature in c::b which allows me to see the list of functions being called in order. That very crucial information I need in squashing this runtime error. Is there some kind of black box or I am just delusional? Well I could always go back to my backup and just use my smelly code and just finish the project regardless. Damn this just suppose to be a simple re-factoring that went so wrong this time.
I am using Windows 7, g++ 4.7.0 and Code::Blocks version 12.
Also note, it is also a project with many files and dependent on library along with its modules. I could use the console thingy and third party apps but I do not understand it and if I do I do not know how to do that for windows. At least I need to see which line was executed last before it crashes, even that small information could give me an insight onto something I overlooked when I re-factored this code.
EDIT: Also if it helps: here is what my stack trace looks like
#0 0040C638 ?? () (??:??)
#1 ABABABAB ?? () (??:??)
#2 FEEEFEEE ?? () (??:??)
#3 ?? ?? () (??:??)
Where is the previous call? Where is main()? Where are those functions called during routine? All I see this, I cannot solve the error if it is like this.
Any help will be great.
Upvotes: 0
Views: 1334
Reputation: 11
If you want to see that, keep the trace window on and go step by step with the "step in" debugger command. That will reveal the function details, and in the "watches" debugger window you can see the variables' values.
Upvotes: 1
Reputation: 613
In the top Debug menu in Code::Blocks, run the GDB/CDB debugger, then return to that debug menu and choose Debugging Windows -> Call Stack. That (should) open up a window that shows you the current stack as you run through the program.
Upvotes: 5