From a88cda8ac63e0ed38cc97d579210bdec84886cda Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Tue, 10 Feb 2015 18:56:40 +0900 Subject: 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. --- tasks/mruby_build.rake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tasks/mruby_build.rake') diff --git a/tasks/mruby_build.rake b/tasks/mruby_build.rake index 35fca428e..8438b6ca4 100644 --- a/tasks/mruby_build.rake +++ b/tasks/mruby_build.rake @@ -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 -- cgit v1.2.3