https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83161
--- Comment #1 from Constantine Kharlamov <Hi-Angel at yandex dot ru> --- Just another data point I forgot to mention: https://stackoverflow.com/questions/3311182/linux-c-easy-pretty-dump-printout-of-structs-like-in-gdb-from-source-co 7k views. Author of this one went as far as implementing a hack with firing up gdb from the code, getting the representation of a struct from there to a buffer, then printing the buffer. It didn't help very much to the OP though, because they wanted the like for kernel module.