Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new chapter on debuginfod (jsc#SLE-20452) #1177

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc-kit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ variant: license-gfdl

file: dc865ed00674536288a1e5a78ba07fe138aaabde .gitignore
file: c6b4745307e90c9b88905b434cbbaddc54e4541b .editorconfig
file: 52057b72aa89089dc36d5edc422a2ecb4c6ca48b xml/generic-entities.ent
file: c5e2769f73dd26e97483d32ba6edfbd08f2b9108 xml/generic-entities.ent
file: e18430714fe3af85fe62bea62b50140d8b5edf5a xml/network-entities.ent
1 change: 1 addition & 0 deletions xml/book_administration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<xi:include href="udev.xml"/>
<xi:include href="suse_linux.xml"/>
<xi:include href="nm.xml"/>
<xi:include href="debuginfod.xml"/>
</part>
<!-- ===================================================================== -->
<!-- Part: Hardware Configuration -->
Expand Down
107 changes: 107 additions & 0 deletions xml/debuginfod.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter
[
<!ENTITY % entities SYSTEM "generic-entities.ent">
%entities;
]>
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="debuginfo">
<title>Getting debugging data and sources with &debuginfod;</title>
<info>
<dm:docmanager xmlns:dm="urn:x-suse:ns:docmanager">
<dm:bugtracker></dm:bugtracker>
<dm:translation>yes</dm:translation>
</dm:docmanager>
</info>
<sect1 xml:id="debuginfo-introduction">
<title>Introduction</title>

<para>
Developers often need to solve bugs in software packages. Debugging tools,
for example GDB, use information contained in special files that are not
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please verify if debuginfod is enabled in the GDB version we ship in SLE15SP4? If not, we should emphasize that as it is a primary use case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not :-(

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to ask my colleague if we can enable the support as SLE15SP4 contains the latest release of gdb.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i got the info from Michael Matz that default support in gdb is not going to be enabled in SLE 15 product line

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, there's a high chance we can deliver the functionality in the next Toolchain module update (Autumn 2022).

available in the installed binary version of the package. It is available in
the source or <emphasis>debuginfo</emphasis> version of the package.
tbazant marked this conversation as resolved.
Show resolved Hide resolved
tbazant marked this conversation as resolved.
Show resolved Hide resolved
Installing packages with extended debugging information requires system
administrator privileges and occupies a lot of disk space.
</para>

<para>
The &debuginfod; service contains an HTTP file server that provides
debugging information for debugging tools without the need to install
debuginfo versions of packages.
</para>
</sect1>
<sect1 xml:id="debuginfo-how-it-works">
<title>How &debuginfod; works</title>

<para>
&debuginfod; periodically scans remote and local directory trees and RPM
package archives to extract the build IDs of discovered executables and
debuginfo files. It stores these IDs into a built-in database and indexes
them to the related file or package names.
</para>
</sect1>
<sect1 xml:id="debuginfo-configuration">
<title>Configuring &debuginfod;</title>

<para>
You can query external &debuginfod; servers, run local &debuginfod; server,
or a combination of both approaches.
</para>

<sect2 xml:id="debuginfo-configuration-local">
<title>Runing local &debuginfod; server</title>
<para>
To run a local &debuginfod; server, follow these steps:
</para>
<procedure>
<step>
<para>
Install the <package>elfutils-debuginfod</package> package:
</para>
<screen>&prompt.sudo;zypper install elfutils-debuginfod</screen>
</step>
<step>
<para>
Start the &debuginfod; service:
</para>
<screen>&prompt.sudo;systemctl start debuginfod.service</screen>
</step>
<step>
<para>
Add the local server's URL to the <varname>DEBUGINFOD_URLS</varname>
environment variable:
</para>
<screen>&prompt.sudo;export DEBUGINFOD_URLS="http://localhost:8002/ $DEBUGINFOD_URLS"</screen>
</step>
</procedure>
</sect2>

<sect2 xml:id="debuginfo-configuration-remote">
<title>Adding remote &debuginfod; servers</title>
<para>
To be able to query remote &debuginfod; server, add its URL to the
<varname>DEBUGINFOD_URLS</varname> environment variable. For example:
</para>
<screen>&prompt.sudo;export DEBUGINFOD_URLS="https://debuginfod.opensuse.org/ $DEBUGINFOD_URLS"</screen>
</sect2>
</sect1>
<sect1 xml:id="debuginfo-usage">
<title>Querying executables for debugging information</title>

<para>
The <command>debuginfod-find</command> command&mdash;which is part of the
<package>debuginfod-client</package> package&mdash;queries configured
&debuginfod; servers for debugging information. It uses build IDs to
identify the queried data. For example, for an executable
<filename>/bin/ls</filename>, you can find the build ID by running the
following command and the query for the debugging information:
</para>

<screen>
&prompt.user;readelf -n /bin/ls | grep 'Build ID'
Build ID: e21f1b05e314b4c54ee57ec057c4f40c1df49dd3
&prompt.user;debuginfod-find debuginfo e21f1b05e314b4c54ee57ec057c4f40c1df49dd3
/root/.cache/debuginfod_client/e21f1b05e314b4c54ee57ec057c4f40c1df49dd3/debuginfo
</screen>
</sect1>
</chapter>
3 changes: 2 additions & 1 deletion xml/generic-entities.ent
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ use &deng;! -->
<!ENTITY x86-64 "&amd64;/&intel64;">

<!ENTITY arm "Arm">
<!ENTITY armreg "&arm;*">
<!ENTITY armreg "Arm*">
<!ENTITY armv7 "Armv7">
<!ENTITY armv8 "Armv8">
<!ENTITY aarch64 "AArch64">
Expand Down Expand Up @@ -265,6 +265,7 @@ use &deng;! -->
<!ENTITY bcache "<systemitem xmlns='http://docbook.org/ns/docbook' class='resource'>bcache</systemitem>">
<!ENTITY chrony "<systemitem xmlns='http://docbook.org/ns/docbook' class='resource'>chrony</systemitem>">
<!ENTITY chronyc "<command xmlns='http://docbook.org/ns/docbook'>chronyc</command>">
<!ENTITY debuginfod "<systemitem xmlns='http://docbook.org/ns/docbook' class='daemon'>debuginfod</systemitem>">
<!ENTITY gnome "GNOME">
<!ENTITY grub "GRUB&nbsp;2">
<!ENTITY grub-efi "GRUB&nbsp;2 for EFI">
Expand Down