Linux kernel defines many macros in its code, these macros have multi-levels which is hard to expand manually. So, is there any tool can help to expand these macros?
I know gcc -E can expand macros, but It is impossible to expand the big kernel codebase (I think).
I want to find a tool or a method to expand a macro when i need.
I also tried the gdb (with qemu emulator runs linux) to expand a macro.
But a problem occured during adding KCFLAGS=”-gdwarf-2 -g3″ (gdb need the extra debug infos) to the kernel building.
It can compile all kernel c files but can not link the *.a file to a vmlinux.o so that the vmlinux.
I.E., the kernel building sequence failed at link stage.
I have no idea on this failure.
So, any tool or method there to expand the macros in linux?
Thanks for your ideas.