c - How to debug a preprocessor macro -


i came across this project. code largely written in c , api consists of few c functions. unfortunately project seems contain bugs, in particular keep getting "double free or corruption" errors. trying use valgrind , gdb find out wrong. problem seems in memory allocator. unfortunately first valgrind error occurs in ~400 line long preprocessor macro defined in header. unfortunately gdb can't break on generated code. stack trace not useful either. there technique can used deal these kind of errors?

the online compiler wandbox.org has "cpp" mode useful experiment c preprocessor.

see example here: https://wandbox.org/permlink/tfuskmixaqj8hhte

you can same thing offline, gcc -p or cl.exe /e


Comments

Popular posts from this blog

testing - Detect whether test has failed within fixture -

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

android - Create single AAR file from multiple modules using Gradle -