diff options
author | Didier Brachet | 2012-08-24 17:51:11 +0000 |
---|---|---|
committer | Eugene Tarassov | 2012-08-29 16:46:46 +0000 |
commit | 9039be8551abb4e96c04a8e898209f164f8f4fdd (patch) | |
tree | 9698afee2dd885ff7825b6d25767b7b4fdd15be5 /agent/tcf/services/stacktrace.c | |
parent | 87e16430ddf152b25c868e2c81b71fcfd7f6c7e9 (diff) | |
download | org.eclipse.tcf.agent-9039be8551abb4e96c04a8e898209f164f8f4fdd.tar.gz org.eclipse.tcf.agent-9039be8551abb4e96c04a8e898209f164f8f4fdd.tar.xz org.eclipse.tcf.agent-9039be8551abb4e96c04a8e898209f164f8f4fdd.zip |
Bug 388018 - Flush context stack trace if its memory map has changed
Diffstat (limited to 'agent/tcf/services/stacktrace.c')
-rw-r--r-- | agent/tcf/services/stacktrace.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/agent/tcf/services/stacktrace.c b/agent/tcf/services/stacktrace.c index 3eae56d2..77a4264e 100644 --- a/agent/tcf/services/stacktrace.c +++ b/agent/tcf/services/stacktrace.c @@ -36,6 +36,7 @@ #include <tcf/services/registers.h> #include <tcf/services/stacktrace.h> #include <tcf/services/symbols.h> +#include <tcf/services/memorymap.h> #define MAX_FRAMES 1000 @@ -474,6 +475,21 @@ static void delete_stack_trace(Context * ctx, void * args) { memset(EXT(ctx), 0, sizeof(StackTrace)); } +static void event_map_changed(Context * ctx, void * client_data) { + if (ctx->mem_access && context_get_group(ctx, CONTEXT_GROUP_PROCESS) == ctx) { + /* If the context is a memory space, we need to update + * breakpoints on all members of the group */ + LINK * l = context_root.next; + while (l != &context_root) { + Context * x = ctxl2ctxp(l); + l = l->next; + if (x->exited) continue; + if (context_get_group(x, CONTEXT_GROUP_PROCESS) != ctx) continue; + flush_stack_trace(x, NULL); + } + } +} + void ini_stack_trace_service(Protocol * proto, TCFBroadcastGroup * bcg) { static ContextEventListener context_listener = { NULL, @@ -486,8 +502,19 @@ void ini_stack_trace_service(Protocol * proto, TCFBroadcastGroup * bcg) { static RegistersEventListener registers_listener = { flush_on_register_change, }; +#if SERVICE_MemoryMap + static MemoryMapEventListener map_listener = { + NULL, + NULL, + NULL, + event_map_changed, + }; +#endif add_context_event_listener(&context_listener, bcg); add_registers_event_listener(®isters_listener, bcg); +#if SERVICE_MemoryMap + add_memory_map_event_listener(&map_listener, NULL); +#endif add_command_handler(proto, STACKTRACE, "getContext", command_get_context); add_command_handler(proto, STACKTRACE, "getChildren", command_get_children); context_extension_offset = context_extension(sizeof(StackTrace)); |