Bug 2179554 - Fedora's GDB sets a less expected gdb.VERSION format
Summary: Fedora's GDB sets a less expected gdb.VERSION format
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kevin Buettner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-18 15:33 UTC by Dominik 'Disconnect3d' Czarnota
Modified: 2023-08-07 13:40 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-08-07 13:40:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dominik 'Disconnect3d' Czarnota 2023-03-18 15:33:34 UTC
Hi,

GDB installed on Fedora Linux 13.1-1.fc37 has the gdb.VERSION attribute set to a "Fedora Linux 13.1-1.fc37" string. This can be seen with this command:

$ gdb --quiet --nx --batch --ex 'pi print(repr(gdb.VERSION))'
'Fedora Linux 13.1-1.fc37'

The problem is that this format is incompatible with what a non-patched GDB uses for this field. Let's see how it works on other systems:
1) Ubuntu
$ gdb --quiet --nx --batch --ex 'pi print(repr(gdb.VERSION))'
'10.2'

2) MacOS
$ gdb --quiet --nx --batch --ex 'pi print(repr(gdb.VERSION))'
'12.1'

3) Manjaro (and so Arch Linux)
$ gdb --quiet --nx --batch --ex 'pi print(repr(gdb.VERSION))'
'12.1'

Since normal GDB uses such format, a lot of GDB scripts/plugins like Pwndbg [0] also assume such format and this field is often used to do something based on the GDB version (e.g., use new features or apply workaround for old bugs). You can also see how some GDB scripts parse the gdb.VERSION field here [1].

Please, consider changing this the value of gdb.VERSION to "13.1" or "13.1-1.fc37" so it may be easier to parse.

[0] https://github.com/pwndbg/pwndbg
[1] https://grep.app/search?q=gdb.VERSION&filter[lang][0]=Python

Comment 1 Andrew Burgess 2023-03-30 09:08:21 UTC
A patch to address this issue has been merged into Fedora rawhide (https://src.fedoraproject.org/rpms/gdb/pull-request/69) and should be included in the next update.

Comment 2 Andrew Burgess 2023-08-07 13:40:16 UTC
Hopefully, this issue should be resolved with the latest rawhide version of GDB.


Note You need to log in before you can comment on or make changes to this bug.