]> git.tdb.fi Git - builder.git/blobdiff - source/gnucompiler.cpp
Use -fno-omit-frame-pointer if debug is set with optimizations
[builder.git] / source / gnucompiler.cpp
index 064b0a0f6e1faafc86d778c778afd4e6feae3573..fe1d735db197c6acff4512fe08721ec94b2ffaf5 100644 (file)
@@ -150,7 +150,7 @@ void GnuCompiler::prepare_syspath()
                                start = newline+1;
                        }
                }
-               catch(const runtime_error &e)
+               catch(const runtime_error &)
                { }
        }
 
@@ -278,6 +278,8 @@ Task *GnuCompiler::run(const Target &target) const
                        argv.push_back("-Os");
                else
                        argv.push_back(format("-O%d", binfo.optimize));
+               if(binfo.debug)
+                       argv.push_back("-fno-omit-frame-pointer");
        }
        if(binfo.threads && architecture->get_system()!="windows" && architecture->get_system()!="darwin")
                argv.push_back("-pthread");