summaryrefslogtreecommitdiffhomepage
path: root/tasks/mruby_build.rake
diff options
context:
space:
mode:
authorKouhei Sutou <[email protected]>2015-02-10 18:56:40 +0900
committerKouhei Sutou <[email protected]>2015-02-10 19:00:30 +0900
commita88cda8ac63e0ed38cc97d579210bdec84886cda (patch)
treea7209bfbdeb7d831c1fc9765ef378abc321dd5a8 /tasks/mruby_build.rake
parent789177c8fe6c3bcb3833e76f95ecbd41b43b83fd (diff)
downloadmruby-a88cda8ac63e0ed38cc97d579210bdec84886cda.tar.gz
mruby-a88cda8ac63e0ed38cc97d579210bdec84886cda.zip
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.
Diffstat (limited to 'tasks/mruby_build.rake')
-rw-r--r--tasks/mruby_build.rake7
1 files changed, 6 insertions, 1 deletions
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