summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-11-12 20:45:53 +0100
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-11-12 20:45:53 +0100
commit1af9e30cf6b36880150cea3a167a8a2fab34ce4c (patch)
tree24c67f49416f5d290382a61329296b303df25d46
parente3134af1d16de1ed85a94731fafcac95ab692ee2 (diff)
downloadelfutils-1af9e30cf6b36880150cea3a167a8a2fab34ce4c.tar.gz
dwfl_end unified.
-rw-r--r--libdwfl/dwfl_end.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/libdwfl/dwfl_end.c b/libdwfl/dwfl_end.c
index ae0ce402..94c2f8d2 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);