public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] archer-pmuldoon-python-breakpoints: Clean up some old variables, rename some variables and general cleanup for FSF submission.
@ 2010-10-12 15:05 pmuldoon
0 siblings, 0 replies; only message in thread
From: pmuldoon @ 2010-10-12 15:05 UTC (permalink / raw)
To: archer-commits
The branch, archer-pmuldoon-python-breakpoints has been updated
via ebc57bfe1060c5fc0c490b198803248f73871328 (commit)
from 630f7e43bd68928e5a1a0cfa7962f5c36069a002 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit ebc57bfe1060c5fc0c490b198803248f73871328
Author: Phil Muldoon <pmuldoon@redhat.com>
Date: Tue Oct 12 16:04:51 2010 +0100
Clean up some old variables, rename some variables and general cleanup for FSF submission.
-----------------------------------------------------------------------
Summary of changes:
gdb/breakpoint.c | 4 ++--
gdb/breakpoint.h | 10 ++++++----
gdb/python/py-breakpoint.c | 30 ++++++++++++++----------------
3 files changed, 22 insertions(+), 22 deletions(-)
First 500 lines of diff:
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index b5a677e..47d5bf2 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -5452,7 +5452,7 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch,
b->syscalls_to_be_caught = NULL;
b->ops = NULL;
b->condition_not_parsed = 0;
- b->bp_object = NULL;
+ b->py_bp_object = NULL;
/* Add this breakpoint to the end of the chain
so that a list of breakpoints will come out in order
@@ -7715,7 +7715,7 @@ create_new_breakpoint (struct gdbarch *gdbarch,
b->ops = ops;
b->enable_state = enabled ? bp_enabled : bp_disabled;
b->pspace = current_program_space;
- b->bp_object = NULL;
+ b->py_bp_object = NULL;
if (enabled && b->pspace->executing_startup
&& (b->type == bp_breakpoint
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 4eb2fe0..da4461a 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -570,10 +570,12 @@ struct breakpoint
marker again. */
int static_trace_marker_id_idx;
- /* If this is a Python enabled GDB, store a reference to the
- Python object that has been associated with this breakpoint
- struct. */
- PyObject *bp_object;
+ /* With a Python scripting enabled GDB, store a reference to the
+ Python object that has been associated with this 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;
};
typedef struct breakpoint *breakpoint_p;
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index 5984d5f..a9a02f7 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -571,7 +571,7 @@ bppy_new (PyTypeObject *subtype, PyObject *args, PyObject *kwargs)
return NULL;
if (internal && PyObject_IsTrue (internal))
- internal_bp = 1;
+ internal_bp = 1;
result = subtype->tp_alloc (subtype, 0);
if (! result)
@@ -642,18 +642,18 @@ gdbpy_breakpoints (PyObject *self, PyObject *args)
int i = 0;
ALL_BREAKPOINTS (b)
{
- /* Not all breakpoints will have the Python object created
- alongside it. Only breakpoints that were created in
- Python, or breakpoints that were created in Python that
- triggered an observer->observable event to occur. */
- if (b->bp_object)
+ /* Not all breakpoints will have a companion Python object.
+ Only breakpoints that were created via bppy_new, or
+ breakpoints that were created externally and are tracked by
+ the Python Scripting API. */
+ if (b->py_bp_object)
{
- if (PyTuple_SetItem (result, i, (PyObject *) b->bp_object) != 0)
+ if (PyTuple_SetItem (result, i, (PyObject *) b->py_bp_object) != 0)
{
Py_DECREF (result);
return NULL;
}
- Py_INCREF (b->bp_object);
+ Py_INCREF (b->py_bp_object);
++i;
}
}
@@ -695,12 +695,11 @@ gdbpy_breakpoint_created (int num)
}
else
newbp = PyObject_New (breakpoint_object, &breakpoint_object_type);
-
if (newbp)
{
newbp->number = num;
newbp->bp = bp;
- newbp->bp->bp_object = (PyObject *)newbp;
+ newbp->bp->py_bp_object = (PyObject *)newbp;
Py_INCREF (newbp);
}
else
@@ -727,21 +726,20 @@ gdbpy_breakpoint_deleted (int num)
{
PyGILState_STATE state;
struct breakpoint *b = NULL;
- breakpoint_object *prev = NULL;
state = PyGILState_Ensure ();
ALL_BREAKPOINTS (b)
{
if (b->number == num)
{
- breakpoint_object *bp_object =
- ((breakpoint_object *)b->bp_object);
+ breakpoint_object *bp_obj =
+ ((breakpoint_object *)b->py_bp_object);
- if (bp_object)
+ if (bp_obj)
{
- bp_object->bp = NULL;
+ bp_obj->bp = NULL;
--bppy_live;
- Py_DECREF (bp_object);
+ Py_DECREF (bp_obj);
}
break;
}
hooks/post-receive
--
Repository for Project Archer.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-10-12 15:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-12 15:05 [SCM] archer-pmuldoon-python-breakpoints: Clean up some old variables, rename some variables and general cleanup for FSF submission pmuldoon
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).