Need help : -O2 flag and GDB

R

rinku24

Hi,
For product version, I have to compile c++ code using -O2 flag for
optimization. But the problem is when I have to debug the core file,
GDB doesn't display any data.

I use g++ 3.0.40 and gdb 5.2 on Radhat linux. I was able to debug the
core with g++ 2.95 compiler event though -O2 flag was on.

What compiler and GDB version do you suggest?
 
V

Victor Bazarov

For product version, I have to compile c++ code using -O2 flag for
optimization. But the problem is when I have to debug the core file,
GDB doesn't display any data.

I use g++ 3.0.40 and gdb 5.2 on Radhat linux. I was able to debug the
core with g++ 2.95 compiler event though -O2 flag was on.

What compiler and GDB version do you suggest?

I suggest asking in gnu.g++.help or in comp.os.linux.development.apps.
But you're free to ignore my suggestion.
 
M

MSR

Victor Bazarov said:
I suggest asking in gnu.g++.help or in comp.os.linux.development.apps.
But you're free to ignore my suggestion.

Not a C++ question. Anyway you can use '-g' flag along with -O2. Not sure if
your version of gcc can take both flags but newer version certainly do.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top