> Single stepping the kernel in a debugger is confusing because compiler
> optimizations confuse the debugger. When I remove the -O2 option in
> the Makefile, the kernel won't build due to issues with inline
> functions. Is there a known solution for this?
Yes - get used to it.
There is no way to build a non-O2 kernel. When you do that, control is going
to jump all over the place in gdb.