2025-01-23 14:31:06 +00:00
|
|
|
diff --git a/gdb/python/lib/gdb/command/rpm-suggestions.py b/gdb/python/lib/gdb/command/rpm-suggestions.py
|
|
|
|
index 293b1638617..463684c1462 100644
|
|
|
|
--- a/gdb/python/lib/gdb/command/rpm-suggestions.py
|
|
|
|
+++ b/gdb/python/lib/gdb/command/rpm-suggestions.py
|
|
|
|
@@ -28,6 +28,8 @@ __missing_rpms = {}
|
|
|
|
# the prompt is shown.
|
|
|
|
__suggest_rpms = {}
|
2025-01-23 08:24:47 +00:00
|
|
|
|
2025-01-23 14:31:06 +00:00
|
|
|
+__package_to_debug_package = {}
|
|
|
|
+
|
2025-01-23 08:24:47 +00:00
|
|
|
|
2025-01-23 14:31:06 +00:00
|
|
|
# Lookup RPMs that might provide the debug information for FILENAME,
|
|
|
|
# which is a string containing the path to an object file GDB could
|
|
|
|
@@ -43,6 +45,7 @@ def find_suggestions(filename):
|
|
|
|
for h in mi:
|
|
|
|
# Build the debuginfo package name.
|
|
|
|
obj = h.format("%{name}-debuginfo-%{version}-%{release}.%{arch}")
|
|
|
|
+ debug_rpm_name = str(obj)
|
2025-01-23 08:24:47 +00:00
|
|
|
|
2025-01-23 14:31:06 +00:00
|
|
|
# Check to see if the package is installed.
|
|
|
|
mi2 = ts.dbMatch(rpm.RPMDBI_LABEL, str(obj))
|
|
|
|
@@ -52,6 +55,7 @@ def find_suggestions(filename):
|
|
|
|
# Now build the name of the package FILENAME came from.
|
|
|
|
obj = h.format("%{name}-%{version}-%{release}.%{arch}")
|
|
|
|
rpm_name = str(obj)
|
|
|
|
+ __package_to_debug_package[rpm_name] = debug_rpm_name
|
|
|
|
if not rpm_name in __missing_rpms:
|
|
|
|
__suggest_rpms[rpm_name] = True
|
|
|
|
__missing_rpms[rpm_name] = True
|
|
|
|
@@ -83,10 +87,12 @@ class RPMSuggestionHandler(gdb.missing_debug.MissingDebugHandler):
|
|
|
|
# suggests this to the user.
|
|
|
|
def before_prompt():
|
|
|
|
global __suggest_rpms
|
|
|
|
+ global __package_to_debug_package
|
2025-01-23 08:24:47 +00:00
|
|
|
|
2025-01-23 14:31:06 +00:00
|
|
|
if len(__suggest_rpms) > 0:
|
|
|
|
for p in __suggest_rpms.keys():
|
|
|
|
- print("Missing debuginfo, try: dnf debuginfo-install " + p)
|
|
|
|
+ dp = __package_to_debug_package[p]
|
|
|
|
+ print("Missing separate debuginfos, use: zypper install " + dp)
|
|
|
|
__suggest_rpms = {}
|
2025-01-23 08:24:47 +00:00
|
|
|
|
|
|
|
|