Skip to contentSkip to conversation

manuals: document minidebuginfo

PATCH Superseded [email protected] 2 participants 3 messages Dec 7, 2023 – Dec 11, 2023

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 manuals: document minidebuginfo

From: Etienne Cordonnier <[email protected]>

---
 documentation/dev-manual/debugging.rst | 15 +++++++++++++++
 documentation/ref-manual/features.rst  |  3 +++
 2 files changed, 18 insertions(+)
documentation/dev-manual/debugging.rst +15 -0
index fea2cb30a..12694b01b 100644
@@ -1173,6 +1173,21 @@ To support this kind of debugging, you need do the following:
    Consider that this will reduce the application's performance and is
    recommended only for debugging purposes.
 
+Enabling Minidebuginfo
+======================
+
+Enabling the DISTRO_FEATURES minidebuginfo adds a compressed ELF section ".gnu_debugdata"
+to all binary files, containing only function names, and thus increasing the size of the
+binaries only by 5 to 10%. For comparison, full debug symbols can be 10 times as big as
+a stripped binary, and it is thus not always possible to deploy full debug symbols.
+Minidebuginfo data allows, on the one side, to retrieve a call-stack using
+gdb (command backtrace) without deploying full debug-symbols to the target. It also
+allows to retrieve a symbolicated call-stack when using systemd-coredump to manage
+coredumps (commands "coredumpctl list" and "coredumpctl info").
+
+This feature was created by Fedora, see https://fedoraproject.org/wiki/Features/MiniDebugInfo for
+more details.
+
 Other Debugging Tips
 ====================
 
documentation/ref-manual/features.rst +3 -0
index dd14339bc..1320c3a58 100644
@@ -161,6 +161,9 @@ metadata, as extra layers can define their own:
 -  *keyboard:* Include keyboard support (e.g. keymaps will be loaded
    during boot).
 
+-  *minidebuginfo:* Add minimal debug symbols :ref:`(minidebuginfo)<dev-manual/debugging:enabling minidebuginfo>`
+   to binary files containing, allowing coredumpctl and gdb to show symbolicated stack traces.
+
 -  *multiarch:* Enable building applications with multiple architecture
    support.
 
Signature · 1 line
2.36.1.vfs.0.0
#1 lore raw

Hi Etienne,

Many thanks for your contribution. Happy to learn about MiniDebugInfo!

See my comments below, mostly about formatting issues. I could fix it by myself if you lack time, but this way you know this for future patches :)

Quoted 13 lines · Etienne Cordonnier via lists.yoctoproject.org

From: Etienne Cordonnier <[email protected]>

---
  documentation/dev-manual/debugging.rst | 15 +++++++++++++++
  documentation/ref-manual/features.rst  |  3 +++
  2 files changed, 18 insertions(+)
documentation/dev-manual/debugging.rst +0 -0
index fea2cb30a..12694b01b 100644

documentation/dev-manual/debugging.rst To support this kind of debugging, you need do the following: · line 1179

Quoted 7 lines
documentation/dev-manual/debugging.rst +4 -0
@@ -1173,6 +1173,21 @@ To support this kind of debugging, you need do the following:
     Consider that this will reduce the application's performance and is
     recommended only for debugging purposes.
 
+Enabling Minidebuginfo
+======================
+
+Enabling the DISTRO_FEATURES minidebuginfo adds a compressed ELF section ".gnu_debugdata"

Use :term:DISTRO_FEATURES
and ``.gnu_debugdata``

documentation/dev-manual/debugging.rst To support this kind of debugging, you need do the following: · line 1184

Quoted 5 lines
documentation/dev-manual/debugging.rst +5 -0
+to all binary files, containing only function names, and thus increasing the size of the
+binaries only by 5 to 10%. For comparison, full debug symbols can be 10 times as big as
+a stripped binary, and it is thus not always possible to deploy full debug symbols.
+Minidebuginfo data allows, on the one side, to retrieve a call-stack using
+gdb (command backtrace) without deploying full debug-symbols to the target. It also

Use ``gdb`` (to refer to the command) or GDB (to refer to the program) as in other parts of the manual.

Replace "debug-symbols" by "debugging symbols"?

documentation/dev-manual/debugging.rst To support this kind of debugging, you need do the following: · line 1185

Quoted 1 line
documentation/dev-manual/debugging.rst +1 -0
+allows to retrieve a symbolicated call-stack when using systemd-coredump to manage

Use ``systemd-coredump``

documentation/dev-manual/debugging.rst To support this kind of debugging, you need do the following: · line 1186

Quoted 1 line
documentation/dev-manual/debugging.rst +1 -0
+coredumps (commands "coredumpctl list" and "coredumpctl info").

Use ``coredumpctl list`` and ``coredumpctl info``

Quoted 12 lines
documentation/dev-manual/debugging.rst +4 -0
+
+This feature was created by Fedora, see https://fedoraproject.org/wiki/Features/MiniDebugInfo for
+more details.
+
  Other Debugging Tips
  ====================
 
documentation/ref-manual/features.rst +0 -0
index dd14339bc..1320c3a58 100644

documentation/ref-manual/features.rst metadata, as extra layers can define their own: · line 164

Quoted 4 lines
documentation/ref-manual/features.rst +1 -0
@@ -161,6 +161,9 @@ metadata, as extra layers can define their own:
  -  *keyboard:* Include keyboard support (e.g. keymaps will be loaded
     during boot).
 
+-  *minidebuginfo:* Add minimal debug symbols :ref:`(minidebuginfo)<dev-manual/debugging:enabling minidebuginfo>`

Use "debugging symbols" as in the change above?

documentation/ref-manual/features.rst metadata, as extra layers can define their own: · line 165

Quoted 1 line
documentation/ref-manual/features.rst +1 -0
+   to binary files containing, allowing coredumpctl and gdb to show symbolicated stack traces.

Use ``coredumpctl`` and ``gdb``.
Thanks again
Cheers
Michael.

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

Hi / bonjour Michael,

Thanks for your feedback, indeed it is meaningful that I learn the proper formatting for future patches. I changed everything according to your feedback, except "debug symbol" (I only removed the hyphen), my reasoning being:
- even though I find both "debug symbol" and "debugging symbol" on google, the wikipedia article is called "debug symbol" (
https://en.wikipedia.org/wiki/Debug_symbol )
- yocto documentation uses both "debug symbol" and "debugging symbol", however I find 5 hits for "debugging symbol" vs 35 hits for "debug symbol"
- I asked a native English speaker and he thought "debug symbol" sounded better

Etienne

Quoted 104 lines · Michael Opdenacker

Hi Etienne,

Many thanks for your contribution. Happy to learn about MiniDebugInfo!

See my comments below, mostly about formatting issues. I could fix it by myself if you lack time, but this way you know this for future patches :)

Review

Quoted 9 lines · Etienne Cordonnier via lists.yoctoproject.org

From: Etienne Cordonnier <[email protected]>

---
  documentation/dev-manual/debugging.rst | 15 +++++++++++++++
  documentation/ref-manual/features.rst  |  3 +++
  2 files changed, 18 insertions(+)
(quoted diff) +0 -0

b/documentation/dev-manual/debugging.rst

documentation/dev-manual/debugging.rst To support this kind of debugging, you need do

Quoted 4 lines

index fea2cb30a..12694b01b 100644

documentation/dev-manual/debugging.rst +0 -0
@@ -1173,6 +1173,21 @@ To support this kind of debugging, you need do

the following:

documentation/dev-manual/debugging.rst To support this kind of debugging, you need do the following:

Quoted 7 lines
documentation/dev-manual/debugging.rst +4 -0
     Consider that this will reduce the application's performance and is
     recommended only for debugging purposes.
 
+Enabling Minidebuginfo
+======================
+
+Enabling the DISTRO_FEATURES minidebuginfo adds a compressed ELF

section ".gnu_debugdata"

Use :term:DISTRO_FEATURES
and ``.gnu_debugdata``

documentation/dev-manual/debugging.rst To support this kind of debugging, you need do · line 1180

Quoted 1 line
documentation/dev-manual/debugging.rst +1 -0
+to all binary files, containing only function names, and thus

increasing the size of the

documentation/dev-manual/debugging.rst To support this kind of debugging, you need do · line 1181

Quoted 1 line
documentation/dev-manual/debugging.rst +1 -0
+binaries only by 5 to 10%. For comparison, full debug symbols can be 10

times as big as

documentation/dev-manual/debugging.rst To support this kind of debugging, you need do · line 1182

Quoted 1 line
documentation/dev-manual/debugging.rst +1 -0
+a stripped binary, and it is thus not always possible to deploy full

debug symbols.

documentation/dev-manual/debugging.rst To support this kind of debugging, you need do · line 1183

Quoted 1 line
documentation/dev-manual/debugging.rst +1 -0
+Minidebuginfo data allows, on the one side, to retrieve a call-stack

using

documentation/dev-manual/debugging.rst To support this kind of debugging, you need do · line 1184

Quoted 1 line
documentation/dev-manual/debugging.rst +1 -0
+gdb (command backtrace) without deploying full debug-symbols to the

target. It also

Use ``gdb`` (to refer to the command) or GDB (to refer to the program) as in other parts of the manual.

Replace "debug-symbols" by "debugging symbols"?

documentation/dev-manual/debugging.rst To support this kind of debugging, you need do · line 1185

Quoted 1 line
documentation/dev-manual/debugging.rst +1 -0
+allows to retrieve a symbolicated call-stack when using

systemd-coredump to manage

Use ``systemd-coredump``

documentation/dev-manual/debugging.rst To support this kind of debugging, you need do the following: · line 1186

Quoted 1 line
documentation/dev-manual/debugging.rst +1 -0
+coredumps (commands "coredumpctl list" and "coredumpctl info").

Use ``coredumpctl list`` and ``coredumpctl info``

Review

Quoted 6 lines
documentation/dev-manual/debugging.rst +2 -0
+more details.
+
  Other Debugging Tips
  ====================
 
(quoted diff) +0 -0

b/documentation/ref-manual/features.rst

documentation/ref-manual/features.rst metadata, as extra layers can define their own: · line 164

Quoted 8 lines

index dd14339bc..1320c3a58 100644

documentation/ref-manual/features.rst +1 -0
@@ -161,6 +161,9 @@ metadata, as extra layers can define their own:
  -  *keyboard:* Include keyboard support (e.g. keymaps will be loaded
     during boot).
 
+-  *minidebuginfo:* Add minimal debug symbols

:ref:(minidebuginfo)<dev-manual/debugging:enabling minidebuginfo>

Use "debugging symbols" as in the change above?

documentation/ref-manual/features.rst metadata, as extra layers can define their own: · line 165

Quoted 1 line
documentation/ref-manual/features.rst +1 -0
+   to binary files containing, allowing coredumpctl and gdb to show

symbolicated stack traces.

Use ``coredumpctl`` and ``gdb``.
Thanks again
Cheers
Michael.

--

Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering

https://urldefense.proofpoint.com/v2/url?u=https-3A__bootlin.com&d=DwICaQ&c=ncDTmphkJTvjIDPh0hpF_4vCHvabgGkICC2epckfdiw&r=AhkbNonVuMIGRfPx_Qj9TsRih1DULJTKUkSGa66m67E&m=hQV-UWkUsNIhb4Pyow0-VyHqmNd6krcB7umcC1z9AOQiDkBhJM3XT-1O8-fB_Gik&s=rbqxBdiyaYg0d0YO9htyEO3uk_oMr48vN-X-L0UPwPE&e=