From: Jan Kratochvil Date: Mon, 12 Nov 2012 19:45:53 +0000 (+0100) Subject: dwfl_end unified. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1af9e30cf6b36880150cea3a167a8a2fab34ce4c;p=thirdparty%2Felfutils.git dwfl_end unified. --- diff --git a/libdwfl/dwfl_end.c b/libdwfl/dwfl_end.c index ae0ce4028..94c2f8d25 100644 --- a/libdwfl/dwfl_end.c +++ b/libdwfl/dwfl_end.c @@ -36,35 +36,8 @@ dwfl_end (Dwfl *dwfl) if (dwfl == NULL) return; - /* FIXME: Unify with dwfl_frame_state.c. */ - Dwfl_Frame_State_Process *process = dwfl->framestatelist; - while (process != NULL) - { - Dwfl_Frame_State_Thread *thread = process->thread; - while (thread != NULL) - { - if (thread->tid_attached) - ptrace (PTRACE_DETACH, thread->tid, NULL, NULL); - Dwfl_Frame_State *state = thread->unwound; - while (state != NULL) - { - Dwfl_Frame_State *dead = state; - state = state->unwound; - free (dead); - } - Dwfl_Frame_State_Thread *dead = thread; - thread = thread->next; - free (dead); - } - if (process->ebl_close) - ebl_closebackend (process->ebl); - elf_end (process->core); - if (process->core_fd != -1) - close (process->core_fd); - Dwfl_Frame_State_Process *dead = process; - process = process->next; - free (dead); - } + while (dwfl->framestatelist) + __libdwfl_process_free (dwfl->framestatelist); free (dwfl->lookup_addr); free (dwfl->lookup_module);