Bug 2148765

Summary: Debugging helpers don't work
Product: [Fedora] Fedora Reporter: NSLW <lukasz.wojnilowicz>
Component: qt-creatorAssignee: Kevin Buettner <kevinb>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 37CC: ahajkova, blarsen, fweimer, helio, jan, jreznik, kde-sig, keiths, kevinb, manisandro, mcermak, pmuldoon, rdieter, sergiodj, thomas.zimmermann
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qt-creator-8.0.1-10.fc37 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-11 19:20:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Minimal test case
none
Debugger log none

Description NSLW 2022-11-27 20:02:06 UTC
Description of problem:
Running "import gdb" in Python returns "ModuleNotFoundError: No module named 'gdb'"

QtCreator depends on Python to display its class values when the checkbox "Use debugging helpers" is checked. It fails to do it right now regardless of QtCreator source (F37, F38 or Qt's own installer).

Version-Release number of selected component (if applicable):
12.1-6

How reproducible:
Always.

Steps to Reproduce:
1. Type "python" in a terminal
2. Type "import gdb"
3.

Actual results:
ModuleNotFoundError: No module named 'gdb'

Expected results:
No error.

Additional info:
Qt's code for debugging helpers to work correctly presumably relies on the following code

import sys
sys.path.insert(1, '/usr/share/qtcreator/debugger')
from gdbbridge import *

Comment 1 NSLW 2022-11-29 18:22:49 UTC
It seems that debugging helpers don't work with lldb debugger as well. Readdressing as qt-creator bug then. Sorry.

Comment 2 NSLW 2022-11-29 20:41:12 UTC
Created attachment 1928472 [details]
Minimal test case

Steps to reproduce:
1) build attached project in QtCreator
2) make sure that you have enabled Edit->Preferences->DebuggerLocals & Expressions->Use Debugging Helpers
3) make sure that your debugger is gdb under Edit->Preferences->Kits->Kits->Manual->Desktop (default)->Debugger->System GDB at /usr/bin/gdb
4) open main.cpp in QtCreator
5) set a breakpoint at 7th line ("return 0;")
6) run debugger by pressing F5 key
7) make sure that you see locals by enabling View->Views->Locals
8) look at myString row in locals view and see what you have under Value column. If it's not "abc" then Debugging Helpers don't work

Comment 3 NSLW 2022-11-29 20:47:44 UTC
Created attachment 1928473 [details]
Debugger log

Debugger log from QtCreator from View->Views->Debugger log. It seems that there is an error

>&"importPlainDumpers on\n"
>&"Python Exception <class 'AttributeError'>: 'function' object has no attribute 'subprinters'\n"
>&"Error occurred in Python: 'function' object has no attribute 'subprinters'\n"
>167^error,msg="Error occurred in Python: 'function' object has no attribute 'subprinters'"

It seems that at 
https://sourceware.org/gdb/current/onlinedocs/gdb/Pretty-Printing-API.html#Pretty-Printing-API
there is no such thing as subprinters. Is that valid though?

Comment 5 Sandro Mani 2022-12-01 08:41:19 UTC
Pursuing further upstream, please follow [1] and provide any additional information you may find there.

[1] https://bugreports.qt.io/projects/QTCREATORBUG/issues/QTCREATORBUG-28505

Comment 6 NSLW 2022-12-01 15:42:12 UTC
(In reply to Sandro Mani from comment #4)
> Looks like
> https://bugreports.qt.io/projects/QTCREATORBUG/issues/QTCREATORBUG-28505

Thank you. That's what I needed. Should I close the bug as RESOLVED UPSTREAM then please let me know.

Comment 7 NSLW 2023-01-11 15:43:43 UTC
@manisandro 
Could you please backport the fix from bug QTCREATORBUG-28505? Then I think this bug could be closed right away.

Comment 8 Sandro Mani 2023-01-11 19:20:33 UTC
Fixed in qt-creator-9.0.1-2.fc38.

Comment 9 Sandro Mani 2023-01-11 19:21:34 UTC
Ah, I'll also apply it to F37

Comment 10 Fedora Update System 2023-01-11 21:40:38 UTC
FEDORA-2023-81d5b1890f has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-81d5b1890f

Comment 11 Fedora Update System 2023-01-12 03:06:20 UTC
FEDORA-2023-81d5b1890f has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-81d5b1890f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-81d5b1890f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2023-01-18 02:36:46 UTC
FEDORA-2023-6e28212539 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-6e28212539`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-6e28212539

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2023-01-19 06:11:01 UTC
FEDORA-2023-6e28212539 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.