From b2d1c720ece67b110ab4ade6b8c9f3b640216c8a Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Sat, 26 Aug 2023 09:59:45 +1200 Subject: [PATCH] Add documentation regarding how to build Ruby for debugging. (#8290) Co-authored-by: Nobuyoshi Nakada --- doc/contributing/building_ruby.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/contributing/building_ruby.md b/doc/contributing/building_ruby.md index 02efb2384f..b96fa4bc0b 100644 --- a/doc/contributing/building_ruby.md +++ b/doc/contributing/building_ruby.md @@ -157,6 +157,14 @@ with the Ruby script you'd like to run. You can use the following make targets: * `make lldb-ruby`: Runs `test.rb` using Ruby in lldb * `make gdb-ruby`: Runs `test.rb` using Ruby in gdb +### Compiling for Debugging + +You should configure Ruby without optimization and other flags that may interfere with debugging: + +``` shell +./configure --enable-debug-env optflags="-O0 -fno-omit-frame-pointer" +``` + ### Building with Address Sanitizer Using the address sanitizer is a great way to detect memory issues.