https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97989
--- Comment #22 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Stas Sergeev from comment #21) > (In reply to Jakub Jelinek from comment #19) > > It is just that clang doesn't support -g3 at all, as can be seen by clang > > not producing any .debug_macinfo nor .debug_macro sections. > > So with -fdebug-macro it actually produces > .debug_macinfo, but still no .debug_macro. > Yet gdb is quite happy with that and can see > the macros. > > So... > Why "clang -g3 -fdebug-macro -E -Wp,-P - </dev/null" > doesn't produce anything on screen?? > So it works perfectly! > But I don't know how. :) Because it doesn't bother trying to preserve the macros across separate preprocessing. So while clang -g3 -fdebug-macro -S can work, doing clang -g3 -fdebug-macro -E -o test.i test.c; clang -g3 -fdebug-macro -S -fpreprocessed test.i will not work (something e.g. ccache usually does).