From: lace <> Date: Wed, 16 May 2007 17:17:32 +0000 (+0000) Subject: Fixup the dwfl_end () cleanup. X-Git-Url: http://git.jankratochvil.net/?p=debugger.git;a=commitdiff_plain;h=6c007b31c9c5a02df3fd8be72747fc87f4134c98 Fixup the dwfl_end () cleanup. --- diff --git a/Makefile b/Makefile index 8065c65..09d6610 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,8 @@ testsuite: testsuite.c debugger.c debugger.h threadtest: threadtest.c $(CC) -o $@ $< $(LIBS) + ./$@ single + ./$@ multi .PHONY: check check: testsuite @@ -30,5 +32,5 @@ still: .PHONY: clean clean: - $(RM) debugger testsuite + $(RM) debugger testsuite threadtest diff --git a/debugger.c b/debugger.c index add07f9..ec5b60c 100644 --- a/debugger.c +++ b/debugger.c @@ -335,8 +335,6 @@ static Dwfl *get_dwfl (struct ps_prochandle *proc_handle) || dwfl_report_end (proc_handle->dwfl, NULL, NULL) != 0) { fprintf (stderr, "dwfl reporting: %m\n"); - dwfl_end (proc_handle->dwfl); - proc_handle->dwfl = NULL; abort (); } } diff --git a/threadtest.c b/threadtest.c index 63ea31c..971e940 100644 --- a/threadtest.c +++ b/threadtest.c @@ -300,14 +300,16 @@ static void attach (pid_t pid) err = td_ta_new (&proc_handle_local, &thread_agent); assert (err == TD_OK || err == TD_NOLIBTHREAD); if (err == TD_NOLIBTHREAD) + puts ("singlethreaded"); + else { - puts ("singlethreaded"); - return; + puts ("multithreaded"); + thread_test (thread_agent); + err = td_ta_delete (thread_agent); + assert (err == TD_OK); } - puts ("multithreaded"); - thread_test (thread_agent); - err = td_ta_delete (thread_agent); - assert (err == TD_OK); + if (proc_handle_local.dwfl != NULL); + dwfl_end (proc_handle_local.dwfl); } static void *start (void *arg)