Need help : -O2 flag and GDB

Discussion in 'C++' started by rinku24@yahoo.com, Mar 10, 2005.

  1. Guest

    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?
    , Mar 10, 2005
    #1
    1. Advertising

  2. wrote:
    > 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.
    Victor Bazarov, Mar 10, 2005
    #2
    1. Advertising

  3. MSR Guest

    "Victor Bazarov" <> wrote in message
    news:Or%Xd.51951$01.us.to.verio.net...
    > wrote:
    >> 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.


    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.
    MSR, Mar 11, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Surendra
    Replies:
    0
    Views:
    499
    Surendra
    Mar 23, 2006
  2. O.R.Senthil Kumaran

    Need help in understanding gdb messages

    O.R.Senthil Kumaran, Sep 23, 2005, in forum: C Programming
    Replies:
    2
    Views:
    1,701
    Ravi Uday
    Sep 23, 2005
  3. seba
    Replies:
    1
    Views:
    1,429
    mlimber
    Mar 22, 2007
  4. Timothy Madden
    Replies:
    1
    Views:
    1,603
    Timothy Madden
    Sep 17, 2009
  5. Replies:
    1
    Views:
    78
    A. Sinan Unur
    Aug 30, 2005
Loading...

Share This Page