File gdb-setupcore.spec of Package gdb-setupcore
#
# spec file for package gdb-setupcore
#
# Copyright (c) 2022 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: gdb-setupcore
Version: 1.0
Release: 0
Summary: Script for preparing env for gdb core file debugging using debuginfod
License: MIT
Group: Development/Tools/Debuggers
Url: https://github.com/malyzelenyhnus/gdb-setupcore
Source: https://github.com/malyzelenyhnus/gdb-setupcore/archive/refs/tags/v1.0.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: bash
Requires: gdb > 10
Requires: elfutils >= 0.183
Requires: debuginfod-client >= 0.183
%description
Script for preparing binaries required by gdb for core file debugging using debuginfod (before merging PR gdb/27570)
Debuginfod (https://sourceware.org/elfutils/Debuginfod.html) project introduces dedicated server that provides all required resources for debugging on demand over HTTP without need of root privileges and without limitation to your current system and architecture you are working on. This would allow to debug cores from crashed applications on developer's desktop regardless whether the cores are from OpenSUSE on s390x, Debian on arm64 or any other source as long as the debuginfod server will have required debug information.
However current GDB integration (gdb-11.1-7.1 on Tumbleweed) of debuginfod is not yet perfect and gdb is unable to get binaries and libraries required for core debugging from debuginfod server.
So before running gdb this script has to prepare sysroot directory where are all these objects downloaded and symlinked under various SONAMES. Then gdb will be able to find them here by paths as it did before debuginfod was used.
Script also prepares init file with configuration to instruct gdb to search for resouces in that directory instead of system root.
%prep
%setup -q %{name}-%{version}
%build
%install
mkdir -p %{buildroot}/%{_bindir}
install -m0755 gdb-setupcore.sh %{buildroot}/%{_bindir}
%post
%postun
%files
%defattr(-,root,root)
%doc README.md
%{_bindir}/gdb-setupcore.sh
%changelog