All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] doc: sandbox: Add a note of disabling LTO when using gdb
@ 2022-05-17 16:21 Bin Meng
  2022-05-26  7:53 ` Heinrich Schuchardt
  0 siblings, 1 reply; 2+ messages in thread
From: Bin Meng @ 2022-05-17 16:21 UTC (permalink / raw)
  To: Simon Glass, U-Boot Mailing List

Image created by LTO is not friendly to debugger, let's document this.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 doc/arch/sandbox.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/doc/arch/sandbox.rst b/doc/arch/sandbox.rst
index 246ab5b380..19167d22fb 100644
--- a/doc/arch/sandbox.rst
+++ b/doc/arch/sandbox.rst
@@ -477,6 +477,8 @@ board_init_f() and board_init_r().
 
 This approach can be used on normal boards as well as sandbox.
 
+When debugging with gdb, it's better to disable Link Timer Optimizations
+(CONFIG_LTO = n).
 
 SDL_CONFIG
 ----------
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] doc: sandbox: Add a note of disabling LTO when using gdb
  2022-05-17 16:21 [PATCH] doc: sandbox: Add a note of disabling LTO when using gdb Bin Meng
@ 2022-05-26  7:53 ` Heinrich Schuchardt
  0 siblings, 0 replies; 2+ messages in thread
From: Heinrich Schuchardt @ 2022-05-26  7:53 UTC (permalink / raw)
  To: Bin Meng, Simon Glass; +Cc: U-Boot Mailing List

On 5/17/22 18:21, Bin Meng wrote:
> Image created by LTO is not friendly to debugger, let's document this.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>   doc/arch/sandbox.rst | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/doc/arch/sandbox.rst b/doc/arch/sandbox.rst
> index 246ab5b380..19167d22fb 100644
> --- a/doc/arch/sandbox.rst
> +++ b/doc/arch/sandbox.rst
> @@ -477,6 +477,8 @@ board_init_f() and board_init_r().
>
>   This approach can be used on normal boards as well as sandbox.
>
> +When debugging with gdb, it's better to disable Link Timer Optimizations
> +(CONFIG_LTO = n).

CC_OPTIMIZE_FOR_DEBUG should be mentioned here too.

I will add this when merging.

Should CC_OPTIMIZE_FOR_DEBUG disable LTO?

The usefulness of LTO=n, CC_OPTIMIZE_FOR_DEBUG=y for debugging is not
sandbox specific but applies to QEMU and JTAG debugging too.

I think the section "Debugging the init sequence" should not live on a
page that is sandbox specific. Instead we should add a new page on
debugging U-Boot.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

>
>   SDL_CONFIG
>   ----------


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-26  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17 16:21 [PATCH] doc: sandbox: Add a note of disabling LTO when using gdb Bin Meng
2022-05-26  7:53 ` Heinrich Schuchardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.