diff options
Diffstat (limited to 'gdb/python/py-symtab.c')
-rw-r--r-- | gdb/python/py-symtab.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/gdb/python/py-symtab.c b/gdb/python/py-symtab.c index f0bf4ef..e901373 100644 --- a/gdb/python/py-symtab.c +++ b/gdb/python/py-symtab.c @@ -511,6 +511,20 @@ del_objfile_sal (struct objfile *objfile, void *datum) } } +void _initialize_py_symtab (); +void +_initialize_py_symtab () +{ + /* Register an objfile "free" callback so we can properly + invalidate symbol tables, and symbol table and line data + structures when an object file that is about to be + deleted. */ + stpy_objfile_data_key + = register_objfile_data_with_cleanup (NULL, del_objfile_symtab); + salpy_objfile_data_key + = register_objfile_data_with_cleanup (NULL, del_objfile_sal); +} + int gdbpy_initialize_symtabs (void) { @@ -522,15 +536,6 @@ gdbpy_initialize_symtabs (void) if (PyType_Ready (&sal_object_type) < 0) return -1; - /* Register an objfile "free" callback so we can properly - invalidate symbol tables, and symbol table and line data - structures when an object file that is about to be - deleted. */ - stpy_objfile_data_key - = register_objfile_data_with_cleanup (NULL, del_objfile_symtab); - salpy_objfile_data_key - = register_objfile_data_with_cleanup (NULL, del_objfile_sal); - if (gdb_pymodule_addobject (gdb_module, "Symtab", (PyObject *) &symtab_object_type) < 0) return -1; |