Re: [PATCH v2 3/3] Kconfig.debug: split debug-level and DWARF-version into separate choices

From: Masahiro Yamada
Date: Wed Oct 12 2022 - 13:01:49 EST


On Wed, Oct 5, 2022 at 1:30 AM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
>
> Commit f9b3cd245784 ("Kconfig.debug: make DEBUG_INFO selectable from
> a choice") added CONFIG_DEBUG_INFO_NONE into the DWARF version choice,
> but it should rather belong to the debug level choice.
>
> This commit consolidates CONFIG options into two choices:
>
> - Debug info level (NONE / REDUCED / DEFAULT)
>
> - DWARF format (DWARF_TOOLCHAIN_DEFAULT / DWARF4 / DWARF5)
>
> This is more consistent with compilers' policy because the -g0 compiler
> flag means "no debug info".
>
> GCC manual:
>
> -g<level>
>
> Request debugging information and also use level to specify how
> much information. The default level is 2.
>
> Level 0 produces no debug information at all. Thus, -g0 negates -g.
>
> Level 1 produces minimal information, enough for making backtraces
> in parts of the program that you don’t plan to debug. ...
>
> Level 3 includes extra information, such as all the macro
> definitions present in the program. ...
>
> Rustc Codegen manual:
>
> debuginfo
>
> This flag controls the generation of debug information. It takes
> one of the following values:
>
> 0: no debug info at all (the default).
> 1: line tables only.
> 2: full debug info.
>
> I moved CONFIG_DEBUG_INFO_REDUCED into the debug level choice.
>
> This change will make it easier to add another debug info level if
> necessary.



The intent of this patch was a ground-work for adding
CONFIG_DEBUG_LEVEL_FULL or something, but
Dmitrii retracted the patch for macro debugging. [1]

I will not apply this for now.
If we get into a situation that needs more debug info,
let's revisit it.


[1] https://lore.kernel.org/linux-kbuild/CANXV_XwgZMCGXijfoUyZ9+KyM6Rgeqiq-sCfubyj_16d-2CN=A@xxxxxxxxxxxxxx/T/#m9309ac112b5b449da7401838841e619e06d1566c




>
> Update defconfig files accordingly. This includes the fixes for commit
> f9b3cd245784 ("Kconfig.debug: make DEBUG_INFO selectable from a choice").
>
> Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>
> Reviewed-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
> Acked-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
> Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx>
> ---


--
Best Regards
Masahiro Yamada