PR python/13598 - add before_prompt event
[deliverable/binutils-gdb.git] / gdb / python / python.c
index f878f9a313344b9971ff3e1fe739d4087c8aca65..73fb3d029516f341e5aa71d1cd218aac43f617b2 100644 (file)
@@ -100,6 +100,7 @@ const struct extension_language_defn extension_language_python =
 #include "interps.h"
 #include "event-top.h"
 #include "py-ref.h"
+#include "py-event.h"
 
 /* True if Python has been successfully initialized, false
    otherwise.  */
@@ -969,6 +970,10 @@ gdbpy_before_prompt_hook (const struct extension_language_defn *extlang,
 
   gdbpy_enter enter_py (get_current_arch (), current_language);
 
+  if (!evregpy_no_listeners_p (gdb_py_events.before_prompt)
+      && evpy_emit_event (NULL, gdb_py_events.before_prompt) < 0)
+    return EXT_LANG_RC_ERROR;
+
   if (gdb_python_module
       && PyObject_HasAttrString (gdb_python_module, "prompt_hook"))
     {
This page took 0.025885 seconds and 4 git commands to generate.