From b56b5fec70d277471f2cf97686444ca7e4a4b3cc Mon Sep 17 00:00:00 2001 From: compudj Date: Fri, 16 Jul 2004 03:38:14 +0000 Subject: [PATCH] saved state fixes git-svn-id: http://ltt.polymtl.ca/svn@627 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/state.c | 20 +++++++++++++++++++- ltt/branches/poly/lttv/lttv/state.h | 4 ++++ ltt/branches/poly/lttv/lttv/tracecontext.c | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index d8cbe8c6..66bf39c8 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -448,7 +448,8 @@ static void state_restore(LttvTraceState *self, LttvAttribute *container) if(*(value.v_pointer) == NULL) tfcs->parent.e = NULL; else { ep = *(value.v_pointer); - lttv_process_tracefile_seek_position(tfcs->parent, ep); + g_assert(tfcs->parent.t_context != NULL); + lttv_process_tracefile_seek_position(LTTV_TRACEFILE_CONTEXT(tfcs), ep); } } } @@ -1233,6 +1234,15 @@ void lttv_state_save_add_event_hooks(LttvTracesetState *self) } } +gint lttv_state_save_hook_add_event_hooks(void *hook_data, void *call_data) +{ + LttvTracesetState *tss = (LttvTracesetState*)(call_data); + + lttv_state_save_add_event_hooks(tss); + + return 0; +} + void lttv_state_save_remove_event_hooks(LttvTracesetState *self) { @@ -1268,6 +1278,14 @@ void lttv_state_save_remove_event_hooks(LttvTracesetState *self) } } +gint lttv_state_save_hook_remove_event_hooks(void *hook_data, void *call_data) +{ + LttvTracesetState *tss = (LttvTracesetState*)(call_data); + + lttv_state_save_remove_event_hooks(tss); + + return 0; +} void lttv_state_traceset_seek_time_closest(LttvTracesetState *self, LttTime t) { diff --git a/ltt/branches/poly/lttv/lttv/state.h b/ltt/branches/poly/lttv/lttv/state.h index 06d69c04..54277f4f 100644 --- a/ltt/branches/poly/lttv/lttv/state.h +++ b/ltt/branches/poly/lttv/lttv/state.h @@ -65,8 +65,12 @@ void lttv_state_add_event_hooks(LttvTracesetState *self); void lttv_state_remove_event_hooks(LttvTracesetState *self); void lttv_state_save_add_event_hooks(LttvTracesetState *self); +// Hook wrapper. call_data is a trace context. +gint lttv_state_save_hook_add_event_hooks(void *hook_data, void *call_data); void lttv_state_save_remove_event_hooks(LttvTracesetState *self); +// Hook wrapper. call_data is a trace context. +gint lttv_state_save_hook_remove_event_hooks(void *hook_data, void *call_data); void lttv_state_traceset_seek_time_closest(LttvTracesetState *self, LttTime t); diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index dd52153f..40643126 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -1029,7 +1029,7 @@ LttTime lttv_traceset_context_position_get_time( LttvTracefileContext *lttv_traceset_context_get_current_tfc(LttvTracesetContext *self) { GTree *pqueue = self->pqueue; - LttvTracefileContext *tfc; + LttvTracefileContext *tfc = NULL; g_tree_foreach(pqueue, get_first, &tfc); -- 2.34.1