- Update to fedora rawhide @ 62add57.

- Patches updated:
  * gdb-add-rpm-suggestion-script.patch

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=422
This commit is contained in:
2025-01-24 15:14:07 +00:00
committed by Git OBS Bridge
parent 7206b8cb49
commit e8574fe235
2 changed files with 27 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ diff --git a/gdb/python/lib/gdb/command/rpm-suggestions.py b/gdb/python/lib/gdb/
new file mode 100644
--- /dev/null
+++ b/gdb/python/lib/gdb/command/rpm-suggestions.py
@@ -0,0 +1,118 @@
@@ -0,0 +1,134 @@
+# Copyright 2023 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
@@ -48,10 +48,26 @@ new file mode 100644
+try:
+ import rpm
+except ModuleNotFoundError:
+ print(
+ "Unable to load 'rpm' module. Please install the python3-rpm package.",
+ file=sys.stderr
+ )
+ # The "RPM suggestions" mechanism will not work without the (python)
+ # rpm module. Inform the user of this, but wait to do so until
+ # just prior to printing the GDB prompt. If we do it right away,
+ # the message typically appears before the version and copyright
+ # info, which is easily missed by many users. Additionally, it
+ # seems that several other packages which parse GDB version info
+ # are confused by an early error message regarding a missing
+ # python3-rpm package, so waiting to print the error allows those
+ # applications to work as they used to.
+ def before_prompt():
+ print(
+ ("\nUnable to load the Python 'rpm' module. Lack of this module disables\n"
+ "the RPM suggestions mechanism which recommends shell commands for\n"
+ "installing missing debuginfo packages. To enable this functionality,\n"
+ "please install the python3-rpm package."),
+ file=sys.stderr
+ )
+ gdb.events.before_prompt.disconnect(before_prompt)
+
+ gdb.events.before_prompt.connect(before_prompt)
+else:
+ # Track all the RPMs suggested during a single debug session so we
+ # don't suggest the same RPM twice. This is only cleared when the

View File

@@ -1,4 +1,10 @@
-------------------------------------------------------------------
Fri Jan 24 15:13:30 UTC 2025 - Tom de Vries <tdevries@suse.com>
- Update to fedora rawhide @ 62add57.
- Patches updated:
* gdb-add-rpm-suggestion-script.patch
-------------------------------------------------------------------
Fri Jan 24 15:10:23 UTC 2025 - Tom de Vries <tdevries@suse.com>
- Update to fedora rawhide @ 199e8a4.