You are not logged in.

#1 2021-06-08 18:19:03

Toadfield
Member
Registered: 2021-06-08
Posts: 56

How can I get backtrace of a program?

I filed an kde bug,cause wayland doesn't work,so they said that I should get the backtrace.
I read the archwiki page,but I don't understand it.
I asked somewhere else and they said that I should find the package owner with pacman and get it through abs.
With "package owner",do they mean the executable?
And what is abs and how can I use it?
Can someone please give me an easy tutorial on how I can get the backtraces from a program?

Offline

#2 2021-06-08 18:30:41

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 29,353
Website

Re: How can I get backtrace of a program?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2021-06-08 18:34:26

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 12,994

Re: How can I get backtrace of a program?

Proper debuggable traces will require rebuilding of the libraries in question with debug symbols, in this case Qt and whatever KDE lib you are having issues with. Start by reading https://wiki.archlinux.org/title/Debugg … ing_traces in particular the Qt and KDE sections.

Last edited by V1del (2021-06-08 18:34:45)

Offline

#4 2021-06-10 00:06:12

Toadfield
Member
Registered: 2021-06-08
Posts: 56

Re: How can I get backtrace of a program?

V1del wrote:

Proper debuggable traces will require rebuilding of the libraries in question with debug symbols, in this case Qt and whatever KDE lib you are having issues with. Start by reading https://wiki.archlinux.org/title/Debugg … ing_traces in particular the Qt and KDE sections.

When I do gdb /bin/plasmashell,then I just get:
Reading symbols from /bin/plasmashell...
(No debugging symbols found in /bin/plasmashell)
(gdb)

But when I know which symbols need rebuilding,should I then just install the pkgbuild from the repos?
And then how can I change "-DCMAKE_BUILD_TYPE" to "debugfull"?

Offline

#5 2021-06-10 00:34:48

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 12,994

Re: How can I get backtrace of a program?

You pick up the PKGBUILDs of relevance and then change their respective cmake lines to build in debug mode. We might be able to help you more specifically if you disclosed which issue you actually are talking about and what exactly you intend to debug.

Offline

#6 2021-06-10 01:03:33

Toadfield
Member
Registered: 2021-06-08
Posts: 56

Re: How can I get backtrace of a program?

This is the bug I am talking about: https://bugs.kde.org/show_bug.cgi?id=437129
I want to debug plasmashell

Offline

#7 2021-06-10 01:14:16

loqs
Member
Registered: 2014-03-06
Posts: 13,448

Re: How can I get backtrace of a program?

git diff
diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 7db6961..b0726b4 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -16,6 +16,7 @@ depends=(knotifyconfig ksystemstats ktexteditor libqalculate kde-cli-tools appst
          plasma-integration kpeople kactivities-stats libkscreen kquickcharts kuserfeedback kio-extras kio-fuse)
 makedepends=(extra-cmake-modules kdoctools gpsd baloo networkmanager-qt plasma-wayland-protocols kunitconversion kinit)
 groups=(plasma)
+options=('debug' '!strip')
 source=(https://download.kde.org/stable/plasma/$pkgver/$pkgbase-$pkgver.tar.xz{,.sig} kde.pam
         https://invent.kde.org/plasma/plasma-workspace/commit/f90d4d55.patch)
 sha256sums=('1ed41a30208d87f7586734fa0ee84eb308f5da57ea614ef537171eac8bbbb77c'

Was enough to produce plasma-workspace plasma-wayland-session packages with debug symbols.  If you wanted separate debug packages you would replace '!strip' with 'strip'.
There may still be symbols without debug info supplied by other packages.  You would need to check an updated backtrace after installing the rebuilt plasma-workspace and plasma-wayland-session.

Offline

#8 2021-06-10 01:28:49

Toadfield
Member
Registered: 2021-06-08
Posts: 56

Re: How can I get backtrace of a program?

loqs wrote:
git diff
diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 7db6961..b0726b4 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -16,6 +16,7 @@ depends=(knotifyconfig ksystemstats ktexteditor libqalculate kde-cli-tools appst
          plasma-integration kpeople kactivities-stats libkscreen kquickcharts kuserfeedback kio-extras kio-fuse)
 makedepends=(extra-cmake-modules kdoctools gpsd baloo networkmanager-qt plasma-wayland-protocols kunitconversion kinit)
 groups=(plasma)
+options=('debug' '!strip')
 source=(https://download.kde.org/stable/plasma/$pkgver/$pkgbase-$pkgver.tar.xz{,.sig} kde.pam
         https://invent.kde.org/plasma/plasma-workspace/commit/f90d4d55.patch)
 sha256sums=('1ed41a30208d87f7586734fa0ee84eb308f5da57ea614ef537171eac8bbbb77c'

Was enough to produce plasma-workspace plasma-wayland-session packages with debug symbols.  If you wanted separate debug packages you would replace '!strip' with 'strip'.
There may still be symbols without debug info supplied by other packages.  You would need to check an updated backtrace after installing the rebuilt plasma-workspace and plasma-wayland-session.

Thanks,but I need the backtrace of plasmashell.
I don't know how to do that myself,I never build programs myself,I only use pacman and aur helpers..

Offline

#9 2021-06-10 01:35:17

loqs
Member
Registered: 2014-03-06
Posts: 13,448

Re: How can I get backtrace of a program?

pacman -F /usr/bin/plasmashell
usr/bin/plasmashell is owned by extra/plasma-workspace 5.22.0-2

As plasmashell is supplied by the package plasma-workspace,  that is the package you need to rebuild.

Offline

#10 2021-06-10 01:43:47

Toadfield
Member
Registered: 2021-06-08
Posts: 56

Re: How can I get backtrace of a program?

When I do "cmake -DCMAKE_BUILD_TYPE=debugfull /usr/bin/plasmashell",then I get "CMake Error: The source directory "/usr/bin/plasmashell" is a file, not a directory."

Offline

#11 2021-06-10 01:48:39

loqs
Member
Registered: 2014-03-06
Posts: 13,448

Re: How can I get backtrace of a program?

You do not call cmake directly.  Getting_traces#Building_and_installing_the_package
This would be after you had made the required changes to the PKGBUILD,  covered in the previous sections of the same wiki page.

Offline

#12 2021-06-10 01:54:58

Toadfield
Member
Registered: 2021-06-08
Posts: 56

Re: How can I get backtrace of a program?

When I do "makepkg /usr/bin/plasmashell",then I get "==> ERROR: PKGBUILD does not exist.",I don't get anything.

Offline

#13 2021-06-10 05:56:36

seth
Member
Registered: 2012-09-03
Posts: 21,102

Re: How can I get backtrace of a program?

loqs wrote:

As plasmashell is supplied by the package plasma-workspace,  that is the package you need to rebuild.

Offline

#14 2021-06-12 15:17:36

Toadfield
Member
Registered: 2021-06-08
Posts: 56

Re: How can I get backtrace of a program?

I don't need to get the backtrace anymore,the bug was fixed,but thanks.

Offline

Board footer

Powered by FluxBB