mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-02 02:35:00 +08:00
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.
This commit is contained in:
@ -513,7 +513,7 @@ objfpy_repr (PyObject *self_)
|
||||
return PyString_FromString ("<gdb.Objfile (invalid)>");
|
||||
|
||||
return PyString_FromFormat ("<gdb.Objfile filename=%s>",
|
||||
objfile_filename (obj));
|
||||
objfile_name (obj));
|
||||
}
|
||||
|
||||
/* Subroutine of gdbpy_lookup_objfile_by_build_id to simplify it.
|
||||
|
Reference in New Issue
Block a user