- Patches dropped: * fixup-gdb-6.3-gstack-20050411.patch * fixup-skip-tests.patch * gdb-6.6-buildid-locate-rpm-librpm-workaround.patch * gdb-6.6-buildid-locate-rpm.patch - Patches added: * gdb-add-missing-debug-ext-lang-hook.patch * gdb-add-missing-debug-info-python-hook.patch * gdb-add-rpm-suggestion-script.patch * gdb-do-not-import-py-curses-ascii-module.patch * gdb-handle-no-python-gdb-module.patch * gdb-merge-debug-symbol-lookup.patch * gdb-python-avoid-depending-on-the-curses-library.patch * gdb-refactor-find-and-add-separate-symbol-file.patch * gdb-reformat-missing-debug-py-file.patch * gdb-remove-path-in-test-name.patch * gdb-remove-use-of-py-isascii * gdb-sync-coffread-with-elfread.patch - Patches updated: * fixup-gdb-bz634108-solib_address.patch * gdb-6.3-gstack-20050411.patch * gdb-6.6-buildid-locate-rpm-suse.patch * gdb-6.6-buildid-locate-solib-missing-ids.patch * gdb-6.6-buildid-locate.patch * gdb-archer-next-over-throw-cxx-exec.patch * gdb-bz634108-solib_address.patch * gdb-fedora-libncursesw.patch * gdb-glibc-strstr-workaround.patch * gdb-rhbz1007614-memleak-infpy_read_memory-test.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=409
31 lines
1.1 KiB
Diff
31 lines
1.1 KiB
Diff
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
|
From: Tom Tromey <tromey@adacore.com>
|
|
Date: Wed, 15 Nov 2023 06:48:55 -0700
|
|
Subject: gdb-handle-no-python-gdb-module.patch
|
|
|
|
;; Backport upstream commit 7d21600b31fe.
|
|
|
|
Check gdb_python_module in gdbpy_handle_missing_debuginfo
|
|
|
|
If you run gdb in the build tree without --data-directory, on a
|
|
program that does not have debug info, it will crash, because
|
|
gdbpy_handle_missing_debuginfo unconditionally uses gdb_python_module.
|
|
|
|
Other code in gdb using gdb_python_module checks it first and it
|
|
seemes harmless to do the same thing here. (gdb_python_initialized
|
|
does not cover this case so that python can be partially initialized
|
|
and still somewhat work.)
|
|
|
|
diff --git a/gdb/python/python.c b/gdb/python/python.c
|
|
--- a/gdb/python/python.c
|
|
+++ b/gdb/python/python.c
|
|
@@ -1676,7 +1676,7 @@ gdbpy_handle_missing_debuginfo (const struct extension_language_defn *extlang,
|
|
struct objfile *objfile)
|
|
{
|
|
/* Early exit if Python is not initialised. */
|
|
- if (!gdb_python_initialized)
|
|
+ if (!gdb_python_initialized || gdb_python_module == nullptr)
|
|
return {};
|
|
|
|
struct gdbarch *gdbarch = objfile->arch ();
|