diff options
author | Eugene Tarassov | 2016-10-19 22:39:09 +0000 |
---|---|---|
committer | Eugene Tarassov | 2016-10-19 22:39:09 +0000 |
commit | 1fcf7ebda310f3866cb8916e6b2b4dedcbc50b62 (patch) | |
tree | cda6db42b924ee088a0eb07ea371387d9defc9d4 /agent/tcf | |
parent | 3f5205436bcebca963e2d6bfbf0d2f16be2ba5bd (diff) | |
download | org.eclipse.tcf.agent-1fcf7ebda310f3866cb8916e6b2b4dedcbc50b62.tar.gz org.eclipse.tcf.agent-1fcf7ebda310f3866cb8916e6b2b4dedcbc50b62.tar.xz org.eclipse.tcf.agent-1fcf7ebda310f3866cb8916e6b2b4dedcbc50b62.zip |
TCF Agent: when debugging over exec() call on Linux, and address of main() does not change, breakpoints are not properly replanted
Diffstat (limited to 'agent/tcf')
-rw-r--r-- | agent/tcf/services/breakpoints.c | 14 | ||||
-rw-r--r-- | agent/tcf/services/breakpoints.h | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/agent/tcf/services/breakpoints.c b/agent/tcf/services/breakpoints.c index 2a0a4524..2efe57af 100644 --- a/agent/tcf/services/breakpoints.c +++ b/agent/tcf/services/breakpoints.c @@ -815,6 +815,20 @@ void clone_breakpoints_on_process_fork(Context * parent, Context * child) { } } +void invalidate_breakpoints_on_process_exec(Context * ctx) { + Context * mem = context_get_group(ctx, CONTEXT_GROUP_PROCESS); + LINK * l = instructions.next; + while (l != &instructions) { + BreakInstruction * bi = link_all2bi(l); + l = l->next; + if (!bi->planted) continue; + if (!bi->saved_size) continue; + if (bi->cb.ctx != mem) continue; + if (!bi->virtual_addr) planted_sw_bp_cnt--; + bi->planted = 0; + } +} + int unplant_breakpoints(Context * ctx) { int error = 0; LINK * l = instructions.next; diff --git a/agent/tcf/services/breakpoints.h b/agent/tcf/services/breakpoints.h index e03afcb8..da878031 100644 --- a/agent/tcf/services/breakpoints.h +++ b/agent/tcf/services/breakpoints.h @@ -172,6 +172,9 @@ extern int is_breakpoint_address(Context * ctx, ContextAddress address); /* Clone all planted breakpoints when a process forks */ extern void clone_breakpoints_on_process_fork(Context * parent, Context * child); +/* Invalidate all planted breakpoints when a process calls exec() */ +extern void invalidate_breakpoints_on_process_exec(Context * prs); + /* * Unplant all breakpoints in a process (e.g. before detaching). * Return -1 and set errno if cannot remove some of the breakpoints. |