Add more debug flags for GCC based compilers

We can use `#define`-ed macros in GDB with `-g3` flag.

We can run code step by step in GDB with `-O0` flag.
This commit is contained in:
Kouhei Sutou
2015-02-10 18:56:40 +09:00
parent 789177c8fe
commit a88cda8ac6
+6 -1
View File
@@ -94,7 +94,12 @@ module MRuby
end
def enable_debug
compilers.each { |c| c.defines += %w(MRB_DEBUG) }
compilers.each do |c|
c.defines += %w(MRB_DEBUG)
if toolchains.any? { |toolchain| toolchain == "gcc" }
c.flags += %w(-g3 -O0)
end
end
@mrbc.compile_options += ' -g'
end