diff options
author | Pedro Alves <palves@redhat.com> | 2010-11-25 13:10:07 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2010-11-25 13:10:07 +0000 |
commit | 5038964414cb7f8350b1b89bd95ef78125effb33 (patch) | |
tree | fd1248d281ccd6ef531e25372644e79eba1ab678 /gdb | |
parent | d9a88323fe1c249d1b2338ad58fbe9ebcbe80fd3 (diff) | |
download | gdb-5038964414cb7f8350b1b89bd95ef78125effb33.zip gdb-5038964414cb7f8350b1b89bd95ef78125effb33.tar.gz gdb-5038964414cb7f8350b1b89bd95ef78125effb33.tar.bz2 |
* breakpoint.h: No longer include python.h or python-internal.h.
(struct breakpoint_object): Forward declare.
* defs.h (PyObject) [!HAVE_PYTHON]: Don't define.
* varobj.c (PyObject) [!HAVE_PYTHON]: Define.
* python/py-breakpoint.c (build_bp_list): Cast py_bp_object to
PyObject pointer.
(gdbpy_breakpoint_created): Remove casts around py_bp_object
accesses.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/breakpoint.h | 8 | ||||
-rw-r--r-- | gdb/defs.h | 4 | ||||
-rw-r--r-- | gdb/python/py-breakpoint.c | 6 | ||||
-rw-r--r-- | gdb/varobj.c | 2 |
5 files changed, 18 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 869b8d7..aa79939 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2010-11-25 Pedro Alves <pedro@codesourcery.com> + + * breakpoint.h: No longer include python.h or python-internal.h. + (struct breakpoint_object): Forward declare. + * defs.h (PyObject) [!HAVE_PYTHON]: Don't define. + * varobj.c (PyObject) [!HAVE_PYTHON]: Define. + * python/py-breakpoint.c (build_bp_list): Cast py_bp_object to + PyObject pointer. + (gdbpy_breakpoint_created): Remove casts around py_bp_object + accesses. + 2010-11-24 Joel Brobecker <brobecker@adacore.com> * rs6000-tdep.c (bfd_uses_spe_extensions): Use bfd_elf_get_obj_attr_int diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index e34c2d3..0fb6830 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -24,13 +24,9 @@ #include "value.h" #include "vec.h" -#if HAVE_PYTHON -#include "python/python.h" -#include "python/python-internal.h" -#endif - struct value; struct block; +struct breakpoint_object; /* This is the maximum number of bytes a breakpoint instruction can take. Feel free to increase it. It's just used in a few places to size @@ -568,7 +564,7 @@ struct breakpoint This is always NULL for a GDB that is not script enabled. It can sometimes be NULL for enabled GDBs as not all breakpoint types are tracked by the Python scripting API. */ - PyObject *py_bp_object; + struct breakpoint_object *py_bp_object; }; typedef struct breakpoint *breakpoint_p; @@ -1240,8 +1240,4 @@ void dummy_obstack_deallocate (void *object, void *data); extern void initialize_progspace (void); extern void initialize_inferiors (void); -#ifndef HAVE_PYTHON -typedef int PyObject; -#endif - #endif /* #ifndef DEFS_H */ diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c index 8afa414..64e30ef 100644 --- a/gdb/python/py-breakpoint.c +++ b/gdb/python/py-breakpoint.c @@ -636,7 +636,7 @@ static int build_bp_list (struct breakpoint *b, void *arg) { PyObject *list = arg; - PyObject *bp = b->py_bp_object; + PyObject *bp = (PyObject *) b->py_bp_object; int iserr = 0; /* Not all breakpoints will have a companion Python object. @@ -718,7 +718,7 @@ gdbpy_breakpoint_created (int num) { newbp->number = num; newbp->bp = bp; - newbp->bp->py_bp_object = (PyObject *) newbp; + newbp->bp->py_bp_object = newbp; Py_INCREF (newbp); ++bppy_live; } @@ -746,7 +746,7 @@ gdbpy_breakpoint_deleted (int num) if (! bp) return; - bp_obj = ((breakpoint_object *) bp->py_bp_object); + bp_obj = bp->py_bp_object; if (bp_obj) { bp_obj->bp = NULL; diff --git a/gdb/varobj.c b/gdb/varobj.c index 25518d4..e87d399 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -39,6 +39,8 @@ #if HAVE_PYTHON #include "python/python.h" #include "python/python-internal.h" +#else +typedef int PyObject; #endif /* Non-zero if we want to see trace of varobj level stuff. */ |