+2016-05-23 Tom Tromey <tom@tromey.com>
+
+ PR python/19438, PR python/18393:
+ * python/py-objfile.c (objfpy_initialize): Initialize self->dict.
+ * python/py-progspace.c (pspy_initialize): Initialize self->dict.
+
2016-05-23 Gary Benson <gbenson@redhat.com>
* nat/gdb_thread_db.h (td_thr_validate_ftype): Remove typedef.
objfpy_initialize (objfile_object *self)
{
self->objfile = NULL;
- self->dict = NULL;
+
+ self->dict = PyDict_New ();
+ if (self->dict == NULL)
+ return 0;
self->printers = PyList_New (0);
if (self->printers == NULL)
pspy_initialize (pspace_object *self)
{
self->pspace = NULL;
- self->dict = NULL;
+
+ self->dict = PyDict_New ();
+ if (self->dict == NULL)
+ return 0;
self->printers = PyList_New (0);
if (self->printers == NULL)
+2016-05-23 Tom Tromey <tom@tromey.com>
+
+ PR python/19438, PR python/18393:
+ * gdb.python/py-progspace.exp: Add "dir" test.
+ * gdb.python/py-objfile.exp: Add "dir" test.
+
2016-05-23 Yao Qi <yao.qi@linaro.org>
* gdb.arch/thumb-prologue.exp: Use standard_testfile.
gdb_test "python print (objfile.username)" "${testfile}" \
"Get objfile user name"
+gdb_test_no_output "python dir(objfile)"
+
gdb_test "python print (gdb.lookup_objfile (\"${testfile}\").filename)" \
"${testfile}" "print lookup_objfile filename"
gdb_test "python print (gdb.lookup_objfile (\"junk\"))" \
"current progspace filename (None)"
gdb_test "python print (gdb.progspaces())" "\\\[<gdb.Progspace object at $hex>\\\]"
+gdb_test_no_output "python dir(gdb.current_progspace())"
+
gdb_load ${binfile}
gdb_py_test_silent_cmd "python progspace = gdb.current_progspace()" \