Today, I made a very stupid mistake.
I tried to use GDB to debug PBRT.
I always failed to set breakpoints at any place.
I checked the help document again and again.
But I could not solve such problem.
To make life easier, I wrote a small program to help learning GDB.
I can use most of the functions smoothly.
It is really puzzling!
I went to lunch.
I couldn't enjoy the lucnch, because the problem oppcupied my mind totally.
I finished the lunch in hurry and rushed back to the lab.
The problem is still there. I continue the stupid procedure.
First, try to read more documents online.
Second, try all the possible commands.
Then, I go back to the document.
This is a dead loop!
I was very sad!
God helps me unexpectedly!
I opened the Makefile and find the OPT=-o2.
My god!
I check the old version and found OPT=-g.
Sure!
It is the bug!
I should use OPT=-g for debug version.
I'm so stupid!
I changed the setting and tried GDB again.
It's cool. I can make anything.
The lesson is valuable!
In this process, I also learn a lot of GDB commands and tricks.
Thanks God!
I like to use vim. It is very simple, fast and easy to use.
It is also powerful enough for ordinary editing tasks.
Subscribe to:
Post Comments (Atom)
1 comment:
Yes, in order to make gdb work properly, -g must be there. It should be a good habit to always leave -g in a Makefile while developing. Turn optimization options on only when you release your binary.
Post a Comment