Build clang format with Debug Symbols

2k Views Asked by At

I have built clang 3.6 from source and followed the rather straightforward instruction on the page and installed ninja, which I confirmed can build clang-format.

My question is quite simply how to pass some flags so I can get debug symbols because I do not want to do my work (modifying clang-format) using disassembly throughout.

This can be through the standard build (which uses CMake) or ninja.

1

There are 1 best solutions below

0
On

I've faced similar issue recently (I wanted to debug clang's code itself). Turned out that you need to explicitly specify -DCMAKE_BUILD_TYPE=Debug when you run CMake to generate Ninja or standard makefiles.

BTW, be careful: with this Debug option ld "ate" about 4G of my RAM to link clang binary...