extern int emit_new_objfile_event (struct objfile *objfile);
extern int emit_free_objfile_event (struct objfile *objfile);
-extern int emit_clear_objfiles_event (void);
+extern int emit_clear_objfiles_event (program_space *pspace);
extern void evpy_dealloc (PyObject *self);
extern int evpy_add_attribute (PyObject *event,
/* Subroutine of emit_clear_objfiles_event to simplify it. */
static gdbpy_ref<>
-create_clear_objfiles_event_object (void)
+create_clear_objfiles_event_object (program_space *pspace)
{
gdbpy_ref<> objfile_event
= create_event_object (&clear_objfiles_event_object_type);
if (objfile_event == NULL)
return NULL;
- gdbpy_ref<> py_progspace = pspace_to_pspace_object (current_program_space);
+ gdbpy_ref<> py_progspace = pspace_to_pspace_object (pspace);
if (py_progspace == NULL || evpy_add_attribute (objfile_event.get (),
"progspace",
py_progspace.get ()) < 0)
Return -1 if emit fails. */
int
-emit_clear_objfiles_event (void)
+emit_clear_objfiles_event (program_space *pspace)
{
if (evregpy_no_listeners_p (gdb_py_events.clear_objfiles))
return 0;
- gdbpy_ref<> event = create_clear_objfiles_event_object ();
+ gdbpy_ref<> event = create_clear_objfiles_event_object (pspace);
if (event != NULL)
return evpy_emit_event (event.get (), gdb_py_events.clear_objfiles);
return -1;