.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=188
This commit is contained in:
parent
435dad805c
commit
f18dcc0654
@ -1,68 +0,0 @@
|
||||
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||
From: Paul Koning <paul_koning@dell.com>
|
||||
Date: Fri, 8 Jun 2018 13:26:36 -0400
|
||||
Subject: gdb-fix-python37-breakage.patch
|
||||
|
||||
FileName: gdb-fix-python37-breakage.patch
|
||||
|
||||
;; Fix build breakage with Python 3.7
|
||||
;; RHBZ #1577396
|
||||
|
||||
Fix build issue with Python 3.7
|
||||
|
||||
Originally reported in
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1577396 -- gdb build fails
|
||||
with Python 3.7 due to references to a Python internal function whose
|
||||
declaration changed in 3.7.
|
||||
|
||||
gdb/ChangeLog
|
||||
2018-06-08 Paul Koning <paul_koning@dell.com>
|
||||
|
||||
PR gdb/23252
|
||||
|
||||
* python/python.c (do_start_initialization):
|
||||
Avoid call to internal Python API.
|
||||
(init__gdb_module): New function.
|
||||
|
||||
diff --git a/gdb/python/python.c b/gdb/python/python.c
|
||||
--- a/gdb/python/python.c
|
||||
+++ b/gdb/python/python.c
|
||||
@@ -1810,6 +1810,17 @@ finalize_python (void *ignore)
|
||||
restore_active_ext_lang (previous_active);
|
||||
}
|
||||
|
||||
+#ifdef IS_PY3K
|
||||
+/* This is called via the PyImport_AppendInittab mechanism called
|
||||
+ during initialization, to make the built-in _gdb module known to
|
||||
+ Python. */
|
||||
+PyMODINIT_FUNC
|
||||
+init__gdb_module (void)
|
||||
+{
|
||||
+ return PyModule_Create (&python_GdbModuleDef);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
static bool
|
||||
do_start_initialization ()
|
||||
{
|
||||
@@ -1850,6 +1861,9 @@ do_start_initialization ()
|
||||
remain alive for the duration of the program's execution, so
|
||||
it is not freed after this call. */
|
||||
Py_SetProgramName (progname_copy);
|
||||
+
|
||||
+ /* Define _gdb as a built-in module. */
|
||||
+ PyImport_AppendInittab ("_gdb", init__gdb_module);
|
||||
#else
|
||||
Py_SetProgramName (progname.release ());
|
||||
#endif
|
||||
@@ -1859,9 +1873,7 @@ do_start_initialization ()
|
||||
PyEval_InitThreads ();
|
||||
|
||||
#ifdef IS_PY3K
|
||||
- gdb_module = PyModule_Create (&python_GdbModuleDef);
|
||||
- /* Add _gdb module to the list of known built-in modules. */
|
||||
- _PyImport_FixupBuiltin (gdb_module, "_gdb");
|
||||
+ gdb_module = PyImport_ImportModule ("_gdb");
|
||||
#else
|
||||
gdb_module = Py_InitModule ("_gdb", python_GdbMethods);
|
||||
#endif
|
@ -1,36 +0,0 @@
|
||||
diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py
|
||||
index e08eaf5..56c1737 100644
|
||||
--- a/gdb/python/lib/gdb/command/pahole.py
|
||||
+++ b/gdb/python/lib/gdb/command/pahole.py
|
||||
@@ -55,19 +55,19 @@ It prints the type and displays comments showing where holes are."""
|
||||
fieldsize = 8 * ftype.sizeof
|
||||
|
||||
# TARGET_CHAR_BIT
|
||||
- print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)), end = "")
|
||||
+ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8))),
|
||||
bitpos = bitpos + fieldsize
|
||||
|
||||
if ftype.code == gdb.TYPE_CODE_STRUCT:
|
||||
self.pahole (ftype, level + 1, field.name)
|
||||
else:
|
||||
- print (' ' * (2 + 2 * level), end = "")
|
||||
+ print (' ' * (2 + 2 * level)),
|
||||
print ('%s %s' % (str (ftype), field.name))
|
||||
|
||||
if level == 0:
|
||||
self.maybe_print_hole(bitpos, 8 * type.sizeof)
|
||||
|
||||
- print (' ' * (14 + 2 * level), end = "")
|
||||
+ print (' ' * (14 + 2 * level)),
|
||||
print ('} %s' % name)
|
||||
|
||||
def invoke (self, arg, from_tty):
|
||||
@@ -75,7 +75,7 @@ It prints the type and displays comments showing where holes are."""
|
||||
type = type.strip_typedefs ()
|
||||
if type.code != gdb.TYPE_CODE_STRUCT:
|
||||
raise (TypeError, '%s is not a struct type' % arg)
|
||||
- print (' ' * 14, end = "")
|
||||
+ print (' ' * 14),
|
||||
self.pahole (type, 0, '')
|
||||
|
||||
Pahole()
|
Loading…
x
Reference in New Issue
Block a user