From 219c04fc3b3f7e7e19fc5f8d47e5036c7a80377f Mon Sep 17 00:00:00 2001 From: Jan Vrany Date: Tue, 1 Feb 2022 14:49:30 +0000 Subject: gdb/python: fix gdb.Objfile.__repr__ () for dynamically compiled code While experimenting with JIT reader API I realized that calling repr () on objfile created by JIT reader crashes GDB. The problem was that objfpy_repr () called objfile_filename () which returned NULL, causing PyString_FromFormat () to crash. This commit fixes this problem by using objfile_name () instead of objfile_filename (). This also makes consistent with the value of gdb.Objfile.filename variable. --- gdb/python/py-objfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/python') diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c index 6055a42..48d2eb3 100644 --- a/gdb/python/py-objfile.c +++ b/gdb/python/py-objfile.c @@ -513,7 +513,7 @@ objfpy_repr (PyObject *self_) return PyString_FromString (""); return PyString_FromFormat ("", - objfile_filename (obj)); + objfile_name (obj)); } /* Subroutine of gdbpy_lookup_objfile_by_build_id to simplify it. -- cgit v1.1