Bug 454063

Summary: debuginfod symbols not retrieved with gdb 12
Product: [Applications] drkonqi Reporter: Antonio Rojas <arojas>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: bugseforuns, jkhsjdhjs, miaumiui, nate, putr4.s, sitter
Priority: NOR    
Version: 5.24.90   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.26.1

Description Antonio Rojas 2022-05-19 22:55:21 UTC
In version 12, gdb prompts to download debug symbols from debuginfod servers instead of doing it automatically. drkonqi doesn't show this prompt or reacts to it, so debug symbols are never retrieved.
Comment 1 Harald Sitter 2022-05-20 19:11:07 UTC
Please also file an upstream bug, it definitely shouldn't prompt in --batch mode I would think
Comment 2 Harald Sitter 2022-05-20 19:15:34 UTC
In point of fact I think the prompt gets in the way of actually operating in batch mode, the way I see it the entire preamble file is failing to execute :|
Comment 3 jkhsjdhjs 2022-06-29 19:38:11 UTC
(In reply to Harald Sitter from comment #1)
> Please also file an upstream bug, it definitely shouldn't prompt in --batch
> mode I would think

I'm not sure if that's true, because the man page doesn't state that gdb doesn't prompt in --batch mode. I filed this as a bug upstream anyways, let's see what they say: https://sourceware.org/bugzilla/show_bug.cgi?id=29301

As a "workaround", `-iex 'set debuginfod enabled on'` can be passed as a parameter to gdb.
Comment 4 jkhsjdhjs 2022-07-08 15:31:43 UTC
Ah, there may have been a misunderstanding here: While gdb does prompt, it answers its own prompt automatically with N. gdb doesn't hang, it just doesn't download debug symbols via debuginfod.
Comment 5 jkhsjdhjs 2022-07-08 15:43:49 UTC
In the gdb issue Aaron Merey also confirmed that prompts (which are automatically answered with Y or N) are expected in --batch mode. So gdb seems to do everything correctly. At least I didn't experience any hangs with gdb.
If none of your did either, I think the correct way to solve this would be to edit https://invent.kde.org/plasma/drkonqi/-/blob/7a514e37c19c93f63aee007f42bdff99c8437834/src/data/debuggers/internal/gdbrc such that gdb is ran with -iex 'set debuginfod enabled on'.

(sorry for the double-post)
Comment 6 Harald Sitter 2022-07-13 09:04:43 UTC
Thanks.
Comment 7 Bug Janitor Service 2022-07-13 09:11:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/drkonqi/-/merge_requests/67
Comment 8 Patrick Silva 2022-10-05 01:19:04 UTC
On Arch Linix running Plasma 5.26 beta gdb 12.1 crashes when drkonqi tries to generate the backtrace.
Comment 9 Harald Sitter 2022-10-18 22:21:37 UTC
Git commit 2d1f801ea4e164fa109269426311103f1af5ae13 by Harald Sitter.
Committed on 18/10/2022 at 22:19.
Pushed by sitter into branch 'master'.

allow using debuginfod for symbol resolution with gdb12

gdb defaults to it being off.

this adds a new cmake option WITH_GDB12 to be set by distros. when this
is set (and the gdb debugger is used by drkonqi at runtime) then the
install debug symbols button gets slightly refined behavior where
instead of going to a separate tool to install symbols it will instead
run gdb with a suitable cmdline to enable debuginfod.

we still prefer the separate installer when also available.

in particular the workflow here looks like this:

- crash & user opens drkonqi
- trace happens without debuginfod
- if the trace is poor the install debug info button gets enabled
- user clicks button
- re-tracing with debuginfod enabled
- trace is now amazing and can be reported

M  +1    -0    CMakeLists.txt
M  +2    -1    src/backtracegenerator.cpp
M  +5    -0    src/backtracegenerator.h
M  +2    -0    src/config-drkonqi.h.cmake
M  +3    -0    src/data/debuggers/internal/gdbrc
M  +17   -1    src/debugger.cpp
M  +7    -1    src/debugger.h
M  +13   -3    src/qml/DeveloperPage.qml

https://invent.kde.org/plasma/drkonqi/commit/2d1f801ea4e164fa109269426311103f1af5ae13
Comment 10 Harald Sitter 2022-10-18 22:23:21 UTC
Git commit 40f8c11579362755c5242f46ab2e257480d3d06e by Harald Sitter.
Committed on 18/10/2022 at 22:23.
Pushed by sitter into branch 'Plasma/5.26'.

allow using debuginfod for symbol resolution with gdb12

gdb defaults to it being off.

this adds a new cmake option WITH_GDB12 to be set by distros. when this
is set (and the gdb debugger is used by drkonqi at runtime) then the
install debug symbols button gets slightly refined behavior where
instead of going to a separate tool to install symbols it will instead
run gdb with a suitable cmdline to enable debuginfod.

we still prefer the separate installer when also available.

in particular the workflow here looks like this:

- crash & user opens drkonqi
- trace happens without debuginfod
- if the trace is poor the install debug info button gets enabled
- user clicks button
- re-tracing with debuginfod enabled
- trace is now amazing and can be reported


(cherry picked from commit 2d1f801ea4e164fa109269426311103f1af5ae13)

M  +1    -0    CMakeLists.txt
M  +2    -1    src/backtracegenerator.cpp
M  +5    -0    src/backtracegenerator.h
M  +2    -0    src/config-drkonqi.h.cmake
M  +3    -0    src/data/debuggers/internal/gdbrc
M  +17   -1    src/debugger.cpp
M  +7    -1    src/debugger.h
M  +13   -3    src/qml/DeveloperPage.qml

https://invent.kde.org/plasma/drkonqi/commit/40f8c11579362755c5242f46ab2e257480d3d06e