public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-swagiaal-oguz: Used PySequence_list instead of PySequence_List.
@ 2011-01-17 20:56 swagiaal
  0 siblings, 0 replies; only message in thread
From: swagiaal @ 2011-01-17 20:56 UTC (permalink / raw)
  To: archer-commits

The branch, archer-swagiaal-oguz has been updated
       via  bee9888c05a8a5a3531a9824749f6c31a7dbaba4 (commit)
       via  4c673f2254b1b596e55f104a5005c58d44f86543 (commit)
       via  095fa9084c2ce68687cd81ba83e2ee16f810098d (commit)
       via  79eed724546be607e1653694b0a058b41180de47 (commit)
       via  c941638af63b19dc0653a7de0ff5d505ba52a374 (commit)
       via  d1f3a4eafbc9f54ba79e81022e725f40b4ab84bb (commit)
       via  770b1de11611e60d608fe5027bd4a08889000b73 (commit)
       via  5138b2456688058929d7179d9e589597d7c1dbd9 (commit)
       via  1c210d956cf2efe9936c219212e3c746aff7f0de (commit)
       via  320a9a473addddb76b2688f7b2b1dfa957fbb19d (commit)
       via  c3cc95759946bdc2405f7a124384ffbf0f384b60 (commit)
       via  760b9fe750f194de17ba17db07104317392a0eda (commit)
       via  ddfa2ca7c0c9e1b867b935c581d46015b0a4811b (commit)
       via  0444b668c8a728047bd5c2ce4142127814928a64 (commit)
       via  e7a33f76b716f8f83a06fe1fc84f60a317b3c791 (commit)
       via  eb32e17c4ba718e8705fbfabc537e7d74669872c (commit)
       via  5a4ac522d55559aac473c3e852a5a6099d2ad0e9 (commit)
       via  5ea319af1f23471f7a5c9999cb44da376c3f4ca3 (commit)
      from  e6ac31d30fdf318eea0280f873a607cd98d5b146 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit bee9888c05a8a5a3531a9824749f6c31a7dbaba4
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Mon Jan 17 15:44:59 2011 -0500

    Used PySequence_list instead of PySequence_List.

commit 4c673f2254b1b596e55f104a5005c58d44f86543
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Mon Jan 17 11:46:48 2011 -0500

    Use signal enum instead of signal string.

commit 095fa9084c2ce68687cd81ba83e2ee16f810098d
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Mon Jan 17 10:52:53 2011 -0500

    Change python pointers to PyObject*

commit 79eed724546be607e1653694b0a058b41180de47
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Wed Jan 5 15:01:17 2011 -0500

    exit_code

commit c941638af63b19dc0653a7de0ff5d505ba52a374
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Wed Jan 5 12:00:16 2011 -0500

    New line after declarations.

commit d1f3a4eafbc9f54ba79e81022e725f40b4ab84bb
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Wed Jan 5 11:47:34 2011 -0500

    formatting.

commit 770b1de11611e60d608fe5027bd4a08889000b73
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Wed Jan 5 11:34:03 2011 -0500

    correct error checking in evregpy_disconnect

commit 5138b2456688058929d7179d9e589597d7c1dbd9
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Wed Jan 5 11:24:35 2011 -0500

    Fix create XDECREFs.

commit 1c210d956cf2efe9936c219212e3c746aff7f0de
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Wed Jan 5 11:06:09 2011 -0500

    evregpy_no_listeners_p

commit 320a9a473addddb76b2688f7b2b1dfa957fbb19d
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Wed Jan 5 10:38:44 2011 -0500

    Copyright 2011.

commit c3cc95759946bdc2405f7a124384ffbf0f384b60
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Wed Jan 5 10:27:05 2011 -0500

    News entry.

commit 760b9fe750f194de17ba17db07104317392a0eda
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Tue Jan 4 16:53:42 2011 -0500

    8.3 rules

commit ddfa2ca7c0c9e1b867b935c581d46015b0a4811b
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Tue Jan 4 16:01:12 2011 -0500

    Documentation

commit 0444b668c8a728047bd5c2ce4142127814928a64
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Thu Dec 23 11:47:21 2010 -0500

    correct error checking in gdbpy_initialize_py_events

commit e7a33f76b716f8f83a06fe1fc84f60a317b3c791
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Thu Dec 23 11:14:12 2010 -0500

    Check number of listeners before creating an event.

commit eb32e17c4ba718e8705fbfabc537e7d74669872c
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Wed Dec 22 16:31:54 2010 -0500

    Move event registry to py-events.h

commit 5a4ac522d55559aac473c3e852a5a6099d2ad0e9
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Wed Dec 22 16:06:58 2010 -0500

    Changelog.

commit 5ea319af1f23471f7a5c9999cb44da376c3f4ca3
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Wed Dec 22 16:02:28 2010 -0500

    Minor fixes.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog                                      |   28 +++++++
 gdb/Makefile.in                                    |   28 +++---
 gdb/NEWS                                           |    9 ++
 gdb/doc/gdb.texinfo                                |   86 ++++++++++++++++++++
 gdb/python/{py-breakpointevent.c => py-bpevent.c}  |   10 +-
 gdb/python/py-breakpoint.c                         |    4 +-
 gdb/python/py-continueevent.c                      |   14 ++-
 gdb/python/py-event.c                              |    5 +-
 gdb/python/py-event.h                              |    4 +-
 gdb/python/py-events.c                             |   80 ------------------
 gdb/python/py-events.h                             |   18 ++++-
 .../{py-eventregistry.c => py-evtregistry.c}       |   30 ++++++-
 gdb/python/py-evts.c                               |   77 +++++++++++++++++
 gdb/python/py-exitedevent.c                        |   23 +++---
 gdb/python/py-inferior.c                           |    7 +-
 gdb/python/py-infthread.c                          |    3 +
 gdb/python/py-signalevent.c                        |   18 ++--
 gdb/python/py-stopevent.c                          |   75 +++++++++++++-----
 gdb/python/py-stopevent.h                          |   18 ++--
 gdb/python/python-internal.h                       |   15 +---
 gdb/python/python.c                                |   22 -----
 gdb/testsuite/ChangeLog                            |    8 ++
 gdb/testsuite/gdb.python/py-events.c               |    2 +-
 gdb/testsuite/gdb.python/py-events.exp             |    2 +-
 gdb/testsuite/gdb.python/py-events.py              |    2 +-
 .../{py-events-threads.c => py-evthreads.c}        |    2 +-
 .../{py-events-threads.exp => py-evthreads.exp}    |    4 +-
 27 files changed, 380 insertions(+), 214 deletions(-)
 rename gdb/python/{py-breakpointevent.c => py-bpevent.c} (84%)
 delete mode 100644 gdb/python/py-events.c
 rename gdb/python/{py-eventregistry.c => py-evtregistry.c} (88%)
 create mode 100644 gdb/python/py-evts.c
 rename gdb/testsuite/gdb.python/{py-events-threads.c => py-evthreads.c} (95%)
 rename gdb/testsuite/gdb.python/{py-events-threads.exp => py-evthreads.exp} (96%)

First 500 lines of diff:
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 002f3d2..7e80dd4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,31 @@
+2010-12-22  Sami Wagiaalla  <swagiaal@redhat.com>
+                Oguz Kayral <oguzkayral@gmail.com>
+
+	* python/py-inferior.c (python_on_normal_stop): New function.
+	(python_on_resume): New function.
+	(python_inferior_exit): New function.
+	(gdbpy_initialize_inferior): Add normal_stop, target_resumed, and
+	inferior_exit observers.
+	* python/py-eventregistry.c: New file.
+	* python/py-event.c: New file.
+	* python/py-events.c: New file.
+	* python/py-continueevent.c: New file.
+	* python/py-breakpointevent.c : New file.
+	* python/py-signalevent.c : New file.
+	* python/py-exetiedevent.c : New file.
+	* python/py-breakpoint.c (gdbpy_breakpoint_from_bpstats): New function.
+	Move struct breakpoint_object from here...
+	* python/python-internal.h: ... to here.
+	* python/py-event.h: New file.
+	* python/py-events.h: New file.
+	* Makefile.in (SUBDIR_PYTHON_OBS): Add py-breakpointstopevent.o,
+	py-continueevent.o, py-event.o, py-eventregistry.o, py-events.o,
+	py-exitedevent.o, py-signalstopevent.o, and py-stopevent.o.
+	(SUBDIR_PYTHON_SRCS): Add py-breakpointstopevent.c,
+	py-continueevent.c, py-event.c, py-eventregistry.c, py-events.c,
+	py-exitedevent.c, py-signalstopevent.c, and py-stopevent.c.
+	Add build rules for all the above.
+
 2010-12-14  Ken Werner  <ken.werner@de.ibm.com>
 
 	* valops.c (value_one): Use get_array_bounds to compute the number
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index c291ee2..ec309ff 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -272,13 +272,13 @@ SUBDIR_PYTHON_OBS = \
 	python.o \
 	py-auto-load.o \
 	py-block.o \
+	py-bpevent.o \
 	py-breakpoint.o \
-	py-breakpointevent.o \
 	py-cmd.o \
 	py-continueevent.o \
 	py-event.o \
-	py-eventregistry.o \
-	py-events.o \
+	py-evtregistry.o \
+	py-evts.o \
 	py-exitedevent.o \
 	py-frame.o \
 	py-function.o \
@@ -301,13 +301,13 @@ SUBDIR_PYTHON_SRCS = \
 	python/python.c \
 	python/py-auto-load.c \
 	python/py-block.c \
+	python/py-bpevent.c \
 	python/py-breakpoint.c \
-	python/py-breakpointevent.c \
 	python/py-cmd.c \
 	python/py-continueevent.c \
 	python/py-event.c \
-	python/py-eventregistry.c \
-	python/py-events.c \
+	python/py-evtregistry.c \
+	python/py-evts.c \
 	python/py-exitedevent.c \
 	python/py-frame.c \
 	python/py-function.c \
@@ -2009,12 +2009,12 @@ py-block.o: $(srcdir)/python/py-block.c
 	$(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-block.c
 	$(POSTCOMPILE)
 
-py-breakpoint.o: $(srcdir)/python/py-breakpoint.c
-	$(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-breakpoint.c
+py-bpevent.o: $(srcdir)/python/py-bpevent.c
+	$(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-bpevent.c
 	$(POSTCOMPILE)
 
-py-breakpointevent.o: $(srcdir)/python/py-breakpointevent.c
-	$(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-breakpointevent.c
+py-breakpoint.o: $(srcdir)/python/py-breakpoint.c
+	$(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-breakpoint.c
 	$(POSTCOMPILE)
 
 py-cmd.o: $(srcdir)/python/py-cmd.c
@@ -2029,12 +2029,12 @@ py-event.o: $(srcdir)/python/py-event.c
 	$(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-event.c
 	$(POSTCOMPILE)
 
-py-eventregistry.o: $(srcdir)/python/py-eventregistry.c
-	$(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-eventregistry.c
+py-evtregistry.o: $(srcdir)/python/py-evtregistry.c
+	$(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-evtregistry.c
 	$(POSTCOMPILE)
 
-py-events.o: $(srcdir)/python/py-events.c
-	$(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-events.c
+py-evts.o: $(srcdir)/python/py-evts.c
+	$(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-evts.c
 	$(POSTCOMPILE)
 
 py-exitedevent.o: $(srcdir)/python/py-exitedevent.c
diff --git a/gdb/NEWS b/gdb/NEWS
index 559609b..a51740e 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,15 @@
 
 *** Changes since GDB 7.2
 
+* Python Support for Inferior events.
+  Python scripts can add observers to be notified of events
+  occurring the in process being debugged.
+  The following events are currently supported:
+  - gdb.events.breakpoint Breakpoint hit event.
+  - gdb.events.cont Continue event.
+  - gdb.events.signal Signal received event.
+  - gdb.events.exited Inferior exited event.
+
 * New command line options
 
 -data-directory DIR	Specify DIR as the "data-directory".
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index dc9630a..31dea4c 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -20700,6 +20700,7 @@ situation, a Python @code{KeyboardInterrupt} exception is thrown.
 * Selecting Pretty-Printers::   How GDB chooses a pretty-printer.
 * Writing a Pretty-Printer::    Writing a Pretty-Printer.
 * Inferiors In Python::         Python representation of inferiors (processes)
+* Inferior Events In Python::   Listening for events from the process being debugged.
 * Threads In Python::           Accessing inferior threads from Python.
 * Commands In Python::          Implementing new commands in Python.
 * Parameters In Python::        Adding new @value{GDBN} parameters.
@@ -21863,6 +21864,70 @@ the pattern could not be found.
 @end defmethod
 @end table
 
+@node Inferior Events In Python
+@subsubsection Inferior Events In Python
+@cindex inferior events in python
+
+The Python API allows scripts to listen for events coming from the inferior process
+and its threads. In order to listen for events the script must register an observer
+by connecting it to the appropriate event registry. Event registries can be accessed
+through the @code{gdb.events} module.
+
+Here is an example:
+
+@smallexample
+def exit_handler (event):
+    if (isinstance (event, gdb.ExitedEvent)):
+        print "event type: exit"
+        print "exit code: %d" % (event.exit_code)
+
+gdb.events.exited.connect (exit_handler)
+@end smallexample
+
+The following is a listing of the event registries that are available and details
+of the events they emit:
+
+@table @code
+@item events.breakpoint
+@item events.cont
+@item events.exited
+@item events.signal
+@end table
+
+These registries emit the following events in respective order:
+
+@table @code
+@item events.BreakpointEvent
+Indicates that a breakpoint was hit and has the following attributes
+@defivar BreakpointEvent breakpoint
+Reference to the breakpoint of type @code{gdb.Breakpoint} that was hit.
+@xref{Breakpoints In Python}, for details of the @code{gdb.Breakpoint}
+object.
+@end defivar
+@defivar BreakpointEvent inferior_thread
+In non-stop mode breakpoints only stop the thread that has hit them. If
+@value{GDBN} is running in non-stop mode this attribute will hold a reference
+to the thread that has stopped. This object will be of type @code{gdb.InferiorThread}
+@xref{Threads In Python}, for details of the @code{gdb.Breakpoint} object.
+If all threads are stopped the value of this attribute will be @code{None}.
+@end defivar
+@item events.ContinueEvent
+Indicates that the inferior has been continued.
+@item events.ExitedEvent
+Indicates that the inferior has exited.
+@defivar ExitedEvent exit_code
+The exit code that the inferior has returned.
+@end defivar
+@item events.SignalEvent
+@defivar SignalEvent inferior_thread
+In non-stop mode this attribute will be set to the specific thread that received the signal
+and @code{None} otherwise.
+@end defivar
+@defivar SignalEvent stop_signal
+The signal received by the inferior
+@end defivar
+@end table
+
 @node Threads In Python
 @subsubsection Threads In Python
 @cindex threads in python
@@ -23256,10 +23321,31 @@ top of the source tree to the source search path.
 @value{GDBN} comes with a module to assist writing Python code.
 
 @menu
+* gdb.events::         Registering observers to listen to inferior events.
 * gdb.printing::       Building and registering pretty-printers.
 * gdb.types::          Utilities for working with types.
 @end menu
 
+@node gdb.events
+@subsubsection gdb.events
+@cindex gdb.events
+
+This module provides access to inferior event registries. Add observers
+to these registries to receive notification about inferior events.
+
+The available registries are:
+
+@table @code
+@item events.breakpoint
+Notifies listeners of breakpoints being hit.
+@item events.cont
+Notifies listeners whenever the inferior, or one of its threads, is continued.
+@item events.exited
+Notifies listeners when the inferior exits.
+@item events.signal
+Notifies listeners of the inferior, or one of its threads,receiving a signal.
+@end table
+
 @node gdb.printing
 @subsubsection gdb.printing
 @cindex gdb.printing
diff --git a/gdb/python/py-breakpointevent.c b/gdb/python/py-bpevent.c
similarity index 84%
rename from gdb/python/py-breakpointevent.c
rename to gdb/python/py-bpevent.c
index 5e68ec0..7dbef53 100644
--- a/gdb/python/py-breakpointevent.c
+++ b/gdb/python/py-bpevent.c
@@ -1,6 +1,6 @@
 /* Python interface to inferior breakpoint stop events.
 
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -24,14 +24,15 @@ static PyTypeObject breakpoint_event_object_type;
 static void
 breakpoint_evpy_dealloc (PyObject *self)
 {
-  Py_DECREF (((breakpoint_event_object *) self)->breakpoint);
+  Py_XDECREF (((breakpoint_event_object *) self)->breakpoint);
   stop_evpy_dealloc (self);
 }
 
 /* Create and initialize a BreakpointEvent object.  */
 
 breakpoint_event_object *
-create_breakpoint_event_object (struct bpstats *bs, thread_object *stopped_thread)
+create_breakpoint_event_object (struct bpstats *bs,
+                                PyObject *stopped_thread)
 {
   breakpoint_event_object *breakpoint_event_obj =
       (breakpoint_event_object *)
@@ -46,14 +47,13 @@ create_breakpoint_event_object (struct bpstats *bs, thread_object *stopped_threa
 
   if (evpy_add_attribute ((event_object *) breakpoint_event_obj,
                           "breakpoint",
-                          (PyObject *) breakpoint_event_obj->breakpoint) < 0)
+                          breakpoint_event_obj->breakpoint) < 0)
     goto fail;
 
   return breakpoint_event_obj;
 
  fail:
   Py_XDECREF (breakpoint_event_obj);
-  Py_XDECREF (breakpoint_event_obj->breakpoint);
   return NULL;
 }
 
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index f85a99b..35203e4 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -283,10 +283,10 @@ bppy_set_task (PyObject *self, PyObject *newvalue, void *closure)
 /* Function to get the corresponding breakpoint object for the given
    bpstats.  */
 
-breakpoint_object *
+PyObject *
 gdbpy_breakpoint_from_bpstats (struct bpstats *bs)
 {
-  return (breakpoint_object *) bs->breakpoint_at->py_bp_object;
+  return (PyObject *) bs->breakpoint_at->py_bp_object;
 }
 
 /* Python function which deletes the underlying GDB breakpoint.  This
diff --git a/gdb/python/py-continueevent.c b/gdb/python/py-continueevent.c
index f4d0e78..320c969 100644
--- a/gdb/python/py-continueevent.c
+++ b/gdb/python/py-continueevent.c
@@ -1,6 +1,6 @@
 /* Python interface to inferior continue events.
 
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -33,7 +33,7 @@ continue_evpy_dealloc (PyObject *self)
 }
 
 continue_event_object *
-create_continue_event_object ()
+create_continue_event_object (void)
 {
   return (continue_event_object *)
       create_event_object (&continue_event_object_type);
@@ -46,10 +46,14 @@ create_continue_event_object ()
 int
 emit_continue_event (ptid_t ptid)
 {
-  event_object *event = (event_object *) create_continue_event_object ();
+  event_object *event;
+
+  if (evregpy_no_listeners_p (gdb_py_events.cont))
+    return 0;
+
+  event = (event_object *) create_continue_event_object ();
   if (event)
-    return evpy_emit_event (event,
-                            gdb_py_events.cont);
+    return evpy_emit_event (event, gdb_py_events.cont);
   return -1;
 }
 
diff --git a/gdb/python/py-event.c b/gdb/python/py-event.c
index cd9af34..99dd7bc 100644
--- a/gdb/python/py-event.c
+++ b/gdb/python/py-event.c
@@ -1,6 +1,6 @@
 /* Python interface to inferior events.
 
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -43,7 +43,6 @@ create_event_object (PyTypeObject *py_type)
 
  fail:
   Py_XDECREF (event_obj);
-  Py_XDECREF (event_obj->dict);
   return NULL;
 }
 
@@ -106,7 +105,7 @@ evpy_emit_event (event_object *event,
      notifying listeners to avoid skipping callbacks
      in the case of a callback being disconnected during
      a notification.  */
-  callback_list_copy = copy_py_list (callback_list);
+  callback_list_copy = PySequence_List (callback_list);
   if (!callback_list_copy)
     goto fail;
 
diff --git a/gdb/python/py-event.h b/gdb/python/py-event.h
index e46f1fe..8d7af2a 100644
--- a/gdb/python/py-event.h
+++ b/gdb/python/py-event.h
@@ -1,6 +1,6 @@
 /* Python interface to inferior events.
 
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -103,7 +103,7 @@ typedef struct
   PyObject *dict;
 } event_object;
 
-extern int emit_stop_event (struct bpstats *bs, const char *stop_signal);
+extern int emit_stop_event (struct bpstats *bs, enum target_signal stop_signal);
 extern int emit_continue_event (ptid_t ptid);
 extern int emit_exited_event (LONGEST *exit_code);
 
diff --git a/gdb/python/py-events.c b/gdb/python/py-events.c
deleted file mode 100644
index 59eed57..0000000
--- a/gdb/python/py-events.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Python interface to inferior events.
-
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#include "py-events.h"
-
-/* Initialize python events.  */
-
-void
-gdbpy_initialize_py_events ()
-{
-
-  gdb_py_events.stop = create_eventregistry_object ();
-  gdb_py_events.breakpoint = create_eventregistry_object ();
-  gdb_py_events.signal = create_eventregistry_object ();
-  gdb_py_events.cont = create_eventregistry_object ();
-  gdb_py_events.exited = create_eventregistry_object ();
-
-  gdb_py_events.module = Py_InitModule ("events", NULL);
-  if (!gdb_py_events.module)
-    goto fail;
-
-  if (gdb_py_events.stop == NULL
-      || PyModule_AddObject (gdb_py_events.module,
-                             "stop",
-                             (PyObject *) gdb_py_events.stop) < 0)
-    goto fail;
-
-  if (gdb_py_events.breakpoint == NULL
-      || PyModule_AddObject (gdb_py_events.module,
-                          "breakpoint",
-                          (PyObject *) gdb_py_events.breakpoint) < 0)
-    goto fail;
-  if (gdb_py_events.cont == NULL
-      || PyModule_AddObject (gdb_py_events.module,
-                          "cont",
-                          (PyObject *) gdb_py_events.cont) < 0)
-    goto fail;
-  if (gdb_py_events.exited == NULL
-      || PyModule_AddObject (gdb_py_events.module,
-                          "exited",
-                          (PyObject *) gdb_py_events.exited) < 0)
-    goto fail;
-  if (gdb_py_events.signal == NULL
-      || PyModule_AddObject (gdb_py_events.module,
-                          "signal",
-                          (PyObject *) gdb_py_events.signal) < 0)
-    goto fail;
-
-  Py_INCREF (gdb_py_events.module);
-  if(PyModule_AddObject (gdb_module,
-                         "events",
-                         (PyObject *) gdb_py_events.module) < 0)
-    goto fail;
-
-  return;
-
-  fail:
-   gdbpy_print_stack ();
-   Py_XDECREF (gdb_py_events.stop);
-   Py_XDECREF (gdb_py_events.breakpoint);
-   Py_XDECREF (gdb_py_events.signal);
-   Py_XDECREF (gdb_py_events.cont);
-   Py_XDECREF (gdb_py_events.exited);
-}
diff --git a/gdb/python/py-events.h b/gdb/python/py-events.h
index abed1e7..31e5604 100644
--- a/gdb/python/py-events.h
+++ b/gdb/python/py-events.h
@@ -1,6 +1,6 @@
 /* Python interface to inferior events.
 
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -25,13 +25,22 @@
 #include "python-internal.h"
 #include "inferior.h"
 


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-17 20:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-17 20:56 [SCM] archer-swagiaal-oguz: Used PySequence_list instead of PySequence_List swagiaal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).