On Thu, 19 Apr 2018 16:58:40 +0800, sizel said:
>  How can I disable compile optimization in kernel for friendly  debugging, 
> Thanks

First off, there are parts of the kernel that *WILL* explode if you try to build
with -O0 - in particular, any code that expects static inlines to be treated as
part of the unit they are inlined into for the purposes of 
__builtin_return_address()
and similar.

Second, modern gdb is perfectly able to deal with -O2 optimization,
especially if you build with -g.  (In the kernel build, CONFIG_DEBUG_INFO=y
will do the right thing for this).

What specific problems were you hitting in debugging that made you want to
disable optimization?

Attachment: pgpFjfxO85kg2.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
[email protected]
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to