Fix issue 1468: Better management of debugging #defines #61

Closed
wants to merge 1 commit into
from

2 participants

@msabramo

Collect debugging #defines into a new single header file called config.h and wrap them with #ifndef's so that they can be set on the rake command-line -- e.g.:

CFLAGS="-DROXOR_VM_DEBUG -DROXOR_VM_DEBUG_CONST -DROXOR_COMPILER_DEBUG" rake

Here it is in action:

[last: 0] marca@SCML-MarcA:~/dev/git-repos/MacRuby$ touch vm.cpp compiler.cpp dispatcher.cpp 
[last: 0] marca@SCML-MarcA:~/dev/git-repos/MacRuby$ CFLAGS="-DROXOR_VM_DEBUG -DROXOR_VM_DEBUG_CONST -DROXOR_COMPILER_DEBUG" rake
(in /Users/marca/dev/git-repos/MacRuby)
/usr/bin/g++ -I. -I./include -fblocks -g -Wall -Wno-deprecated-declarations -Werror -arch x86_64 -DROXOR_VM_DEBUG -DROXOR_VM_DEBUG_CONST -DROXOR_COMPILER_DEBUG -I/usr/local/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3   -fno-rtti -fno-common -Woverloaded-virtual -I./icu-1060 -c compiler.cpp -o .objs/compiler.o
/usr/bin/g++ -I. -I./include -fblocks -g -Wall -Wno-deprecated-declarations -Werror -arch x86_64 -DROXOR_VM_DEBUG -DROXOR_VM_DEBUG_CONST -DROXOR_COMPILER_DEBUG -I/usr/local/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3   -fno-rtti -fno-common -Woverloaded-virtual -I./icu-1060 -x objective-c++ -c dispatcher.cpp -o .objs/dispatcher.o
/usr/bin/g++ -I. -I./include -fblocks -g -Wall -Wno-deprecated-declarations -Werror -arch x86_64 -DROXOR_VM_DEBUG -DROXOR_VM_DEBUG_CONST -DROXOR_COMPILER_DEBUG -I/usr/local/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3   -fno-rtti -fno-common -Woverloaded-virtual -I./icu-1060 -c vm.cpp -o .objs/vm.o
./markgc .objs/dispatcher.o
patched .objs/dispatcher.o at offset 0xed45c
/usr/bin/g++ -std=c99 -I. -I./include -pipe -fno-common -fexceptions -fblocks -fwrapv -g -O3 -Wall -Wno-deprecated-declarations -Werror -arch x86_64 -DROXOR_VM_DEBUG -DROXOR_VM_DEBUG_CONST -DROXOR_COMPILER_DEBUG -I./icu-1060 .objs/array.o .objs/bignum.o .objs/class.o .objs/compar.o .objs/complex.o .objs/enum.o .objs/enumerator.o .objs/error.o .objs/eval.o .objs/file.o .objs/load.o .objs/proc.o .objs/gc.o .objs/hash.o .objs/env.o .objs/inits.o .objs/io.o .objs/math.o .objs/numeric.o .objs/object.o .objs/pack.o .objs/parse.o .objs/prec.o .objs/dir.o .objs/process.o .objs/random.o .objs/range.o .objs/rational.o .objs/re.o .objs/ruby.o .objs/signal.o .objs/sprintf.o .objs/st.o .objs/string.o .objs/struct.o .objs/time.o .objs/util.o .objs/variable.o .objs/version.o .objs/thread.o .objs/id.o .objs/objc.o .objs/bs.o .objs/ucnv.o .objs/encoding.o .objs/main.o .objs/dln.o .objs/dmyext.o .objs/marshal.o .objs/gcd.o .objs/vm_eval.o .objs/gc-stub.o .objs/bridgesupport.o .objs/compiler.o .objs/dispatcher.o .objs/vm.o .objs/symbol.o .objs/debugger.o .objs/interpreter.o .objs/MacRuby.o .objs/MacRubyDebuggerConnector.o .objs/NSArray.o .objs/NSDictionary.o .objs/NSString.o .objs/transcode.o .objs/sandbox.o -lpthread -ldl -lxml2 -lobjc -licucore -framework Foundation -lauto -L/usr/local/lib  -lpthread -lm -lLLVMipo -lLLVMBitReader -lLLVMBitWriter -lLLVMX86CodeGen -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMJIT -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport -o miniruby
...

Fixes https://www.macruby.org/trac/ticket/1468

@msabramo

ping

@lrz
MacRuby member

Looks good to me but could you rename config.h to something else? (debug_config.h seems better).

@msabramo msabramo Collect debugging #defines into a new single header file called debug…
…_config.h

and wrap them with #ifndef's so that they can be set on the rake
command-line -- e.g.:

CFLAGS="-DROXOR_VM_DEBUG -DROXOR_VM_DEBUG_CONST -DROXOR_COMPILER_DEBUG" rake

Fixes https://www.macruby.org/trac/ticket/1468
20fcc1f
@msabramo

Done. See 20fcc1f.

@msabramo msabramo closed this Feb 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment