summaryrefslogtreecommitdiffstats
path: root/libdwfl/dwfl_frame.c
Commit message (Collapse)AuthorAgeFilesLines
* Avoid double-including config.hUlf Hermann2017-04-261-0/+4
| | | | | | | | | | | | | | | | | config.h doesn't have include guards, so including it twice is bad. We deal with this by checking for PACKAGE_NAME, but only in some places. Once we start using gnulib, we will need to include config.h before any gnulib-generated headers. This is problematic if we include it transitively through our own private headers. In order to set a clear rule about inclusion of config.h, it is now included in every .c file as first header, but not in any header. This will definitely avoid double-inclusion and satisfy the condition that it has to be included before gnulib headers. It comes at the price of adding some redundancy, but there is no clean way to avoid this. Change-Id: Ib78dd7e058ef8ac93cd379dcd14a2ffbc86c1988 Reviewed-by: Christian Kandeler <[email protected]>
* Clean up linux-specific system includesUlf Hermann2017-04-211-1/+0
| | | | | | | We only include them where we actually need them and only on linux. Change-Id: Ic3065ffab67ba1177f63204fb91a92c5f4336dbb Reviewed-by: Christian Kandeler <[email protected]>
* libdwfl: make the unwinder aware of the backend defined ra_offset.Jose E. Marchesi2016-01-031-1/+1
| | | | | | | | | Ebl backends can define an offset that must be applied to the value of the "return address register" defined in the CFI ABI information. This patch makes the unwinder to use that offset when reading the RA CFI register. Signed-off-by: Jose E. Marchesi <[email protected]>
* Remove redundant NULL tests.Chih-Hung Hsieh2015-09-141-1/+2
| | | | | | | | GCC6 and Clang give warnings on redundant NULL tests of parameters that are declared with __nonnull_attribute__. Signed-off-by: Chih-Hung Hsieh <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* libdwfl: Record dwfl_attach_state error and return it on failure.Mark Wielaard2014-06-111-10/+36
| | | | | | | | | | | When dwfl_attach_state fails functions that need the process state should return the error that caused the attach to fail. Use this in the backtrace test to signal any attach failure. This makes sure that architectures that don't provide unwinder support get properly detected (and the tests SKIPs) Also don't assert when trying to attach a non-core ELF file, but return an error to indicate failure. Signed-off-by: Mark Wielaard <[email protected]>
* libdwfl: dwfl_linux_proc_find_elf use elf_from_remote_memory for (deleted).Mark Wielaard2014-03-101-5/+11
| | | | | | | | If a module has a "(deleted)" main ELF file, then try to read it from remote memory if the Dwfl has process state attached by reusing the ptrace mechanism from linux-pid-attach. Signed-off-by: Mark Wielaard <[email protected]>
* libdwfl: Add dwfl_core_file_attach and dwfl_linux_proc_attach.Mark Wielaard2013-12-311-3/+3
| | | | | | | | | | | | | | 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]>
* libdwfl: Add dwfl_getthread_frames.Mark Wielaard2013-12-231-0/+97
| | | | | | | | | | | | | | | | dwfl_getthread_frames is a convenience function for when the user is only interested in one specific thread id of a process. It can be implemented by a simple wrapper function that removes an extra callback layer just to filter on thread id. But it also provides an optimized path to getting access to just one particular Dwfl_Thread of the Dwfl process by providing and (optional) new callback for the state provider. The pid_thread_callbacks now provide an (optional) pid_getthread that doesn't need to travers all threads anymore. Which is implemented for the linux-pid-attach provider. stack now uses this to implement a new '-1' option that shows just one specific thread of a process. Signed-off-by: Mark Wielaard <[email protected]>
* Introduce process_attach_error.Jan Kratochvil2013-11-301-2/+2
| | | | Signed-off-by: Jan Kratochvil <[email protected]>
* Fix dwfl_attach_state machine->elfJan Kratochvil2013-11-141-3/+3
| | | | Signed-off-by: Jan Kratochvil <[email protected]>
* Unwinder for x86*.Jan Kratochvil2013-11-071-0/+345
Signed-off-by: Jan Kratochvil <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>