NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
49.06k stars 5.65k forks source link

gdb version of util.py doesn't correctly parse gdb versions with a dash in them. #6646

Closed lexknuther closed 1 week ago

lexknuther commented 1 week ago

Describe the bug Traceback (most recent call last): File "", line 1, in File ".../ghidra/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src/ghidragdb/init.py", line 16, in from . import util, commands, parameters File ".../ghidra/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src/ghidragdb/util.py", line 34, in GDB_VERSION = _compute_gdb_ver() File ".../ghidra/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src/ghidragdb/util.py", line 31, in _compute_gdb_ver return GdbVersion(full, int(major), int(minor)) ValueError: invalid literal for int() with base 10: '1-5' Error while executing Python code.

Output of show version: GNU gdb (GDB) Red Hat Enterprise Linux 12.1-5.el9

To Reproduce Steps to reproduce the behavior:

  1. Debug any binary with gcc-toolset-12/13 on any RHEL or Oracle Linux distribution

Expected behavior Version parsed correctly. Ideally, a regular expression could be used to extract the version parts and ignore the '-'.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

d-millar commented 1 week ago

@lexknuther Thanks for the heads up - don't have an easily accessible copy of RHEL 9.4. Any chance you could send us your "show version" result? (The logic still works on the copies of RHEL I have at hand.)

lexknuther commented 1 week ago

I included the output in the bug report.

d-millar commented 1 week ago

Ah, my mistake - overlooked it!!!