Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2011-11-09 18:12:49 +0000
committerEugene Tarassov2011-11-09 18:12:49 +0000
commit07c7a005cded9e4b4ec842d756d0e4d79dade149 (patch)
tree6a988b761d2c44c66bc49df7ce2066dd39ea5404
parentef54fd81a56b7e39d0dd7d1c21b9b9dd95259795 (diff)
downloadorg.eclipse.tcf.agent-07c7a005cded9e4b4ec842d756d0e4d79dade149.tar.gz
org.eclipse.tcf.agent-07c7a005cded9e4b4ec842d756d0e4d79dade149.tar.xz
org.eclipse.tcf.agent-07c7a005cded9e4b4ec842d756d0e4d79dade149.zip
TCF Agent: new function in Breakpoints service API: iterate_context_breakpoint_links()
-rw-r--r--services/breakpoints.c9
-rw-r--r--services/breakpoints.h11
2 files changed, 20 insertions, 0 deletions
diff --git a/services/breakpoints.c b/services/breakpoints.c
index e763ac6f..28cde4fd 100644
--- a/services/breakpoints.c
+++ b/services/breakpoints.c
@@ -2183,6 +2183,15 @@ void delete_breakpoint(BreakpointInfo * bp) {
remove_ref(NULL, br);
}
+void iterate_context_breakpoint_links(Context * ctx, ContextBreakpoint * cb, IterateCBLinksCallBack * callback, void * args) {
+ int i;
+ Context * grp = context_get_group(ctx, CONTEXT_GROUP_BREAKPOINT);
+ BreakInstruction * bi = (BreakInstruction *)((char *)cb - offsetof(BreakInstruction, cb));
+ for (i = 0; i < bi->ref_cnt; i++) {
+ if (bi->refs[i].ctx == grp) callback(bi->refs[i].bp, args);
+ }
+}
+
int is_breakpoint_address(Context * ctx, ContextAddress address) {
Context * mem = NULL;
ContextAddress mem_addr = 0;
diff --git a/services/breakpoints.h b/services/breakpoints.h
index b6c1fb32..4635d2dc 100644
--- a/services/breakpoints.h
+++ b/services/breakpoints.h
@@ -122,6 +122,17 @@ extern void change_breakpoint_attributes(BreakpointInfo * bp, BreakpointAttribut
extern void delete_breakpoint(BreakpointInfo * bp);
/*
+ * Iterate all breakpoints that are linked to context breakpoint 'cb' in the breakpoint address space
+ * associated with executable context 'ctx'. Breakpoint address space is the context returned by
+ * context_get_group(ctx, CONTEXT_GROUP_BREAKPOINT).
+ * Single 'cb' can be linked to multiple breakpoints if those breakpoint locations are evaluated
+ * to same address in same address space. Single breakpoint can be linked to multiple CBs if the
+ * breakpoint scope spawns multiple address spaces.
+ */
+typedef void IterateCBLinksCallBack(BreakpointInfo *, void *);
+extern void iterate_context_breakpoint_links(Context * ctx, ContextBreakpoint * cb, IterateCBLinksCallBack * callback, void * args);
+
+/*
* The function is called from context.c every time a context is stopped by a breakpoint.
* The function evaluates breakpoint condition and calls suspend_debug_context() if the condition is true.
*/

Back to the top