diff options
author | Mark Wielaard <[email protected]> | 2013-12-30 22:00:57 +0100 |
---|---|---|
committer | Mark Wielaard <[email protected]> | 2013-12-31 13:59:51 +0100 |
commit | 19108019192ab273c53ae324be448d29dac806ca (patch) | |
tree | 6605f8c9e3e15ea50c77ccd9fe1d2b69f68959b5 /libdwfl/dwfl_frame.c | |
parent | ac65261cc5f4b313d4f852e0a7f2b1b91918550b (diff) |
libdwfl: Add dwfl_core_file_attach and dwfl_linux_proc_attach.
Rewrite __libdwfl_attach_state_for_pid and __libdwfl_attach_state_for_core
as public functions and don't call them from dwfl_linux_proc_report and
dwfl_core_file_report anymore. This lets the user attach state explicitly
independ from how the dwfl modules have been reported. Since attaching
state is an explicit action now the error can be returned directly and we
don't need to keep track of process_attach_error. dwfl_linux_proc_attach
lets the user can tell libdwfl whether caller takes care of ptrace
attaching and stopping the threads under inspection, or whether the
callback needs to take care of that and detaching again.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdwfl/dwfl_frame.c')
-rw-r--r-- | libdwfl/dwfl_frame.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libdwfl/dwfl_frame.c b/libdwfl/dwfl_frame.c index 28008e90..e45cf14c 100644 --- a/libdwfl/dwfl_frame.c +++ b/libdwfl/dwfl_frame.c @@ -200,7 +200,7 @@ dwfl_pid (Dwfl *dwfl) { if (dwfl->process == NULL) { - __libdwfl_seterrno (dwfl->process_attach_error); + __libdwfl_seterrno (DWFL_E_NO_ATTACH_STATE); return -1; } return dwfl->process->pid; @@ -235,7 +235,7 @@ dwfl_getthreads (Dwfl *dwfl, int (*callback) (Dwfl_Thread *thread, void *arg), Dwfl_Process *process = dwfl->process; if (process == NULL) { - __libdwfl_seterrno (dwfl->process_attach_error); + __libdwfl_seterrno (DWFL_E_NO_ATTACH_STATE); return -1; } @@ -306,7 +306,7 @@ getthread (Dwfl *dwfl, pid_t tid, Dwfl_Process *process = dwfl->process; if (process == NULL) { - __libdwfl_seterrno (dwfl->process_attach_error); + __libdwfl_seterrno (DWFL_E_NO_ATTACH_STATE); return -1; } |