diff --git a/include/libunwind-ptrace.h b/include/libunwind-ptrace.h index 801325c4..3c76040f 100644 --- a/include/libunwind-ptrace.h +++ b/include/libunwind-ptrace.h @@ -53,6 +53,7 @@ extern int _UPT_access_fpreg (unw_addr_space_t, unw_regnum_t, unw_fpreg_t *, extern int _UPT_get_proc_name (unw_addr_space_t, unw_word_t, char *, size_t, unw_word_t *, void *); extern int _UPT_resume (unw_addr_space_t, unw_cursor_t *, void *); +extern int _UPT_get_pid (void *); extern unw_accessors_t _UPT_accessors; diff --git a/src/Makefile.am b/src/Makefile.am index 7de4c425..dd29456b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -48,7 +48,8 @@ libunwind_ptrace_la_SOURCES = \ ptrace/_UPT_create.c ptrace/_UPT_destroy.c \ ptrace/_UPT_find_proc_info.c ptrace/_UPT_get_dyn_info_list_addr.c \ ptrace/_UPT_put_unwind_info.c ptrace/_UPT_get_proc_name.c \ - ptrace/_UPT_reg_offset.c ptrace/_UPT_resume.c + ptrace/_UPT_reg_offset.c ptrace/_UPT_resume.c \ + ptrace/_UPT_get_pid.c noinst_HEADERS += ptrace/_UPT_internal.h ### libunwind-coredump: @@ -186,6 +187,16 @@ libunwind_elfxx_la_LIBADD = $(LIBLZMA) noinst_LTLIBRARIES += $(LIBUNWIND_ELF) libunwind_la_LIBADD += $(LIBUNWIND_ELF) +libunwind_eh_elf_la_SOURCES = \ + eh_elf/eh_elf.c \ + eh_elf/memory_map.c + +libunwind_eh_elf_la_LIBADD = $(DLLIB) + +noinst_LTLIBRARIES += libunwind-eh-elf.la +libunwind_la_LIBADD += libunwind-eh-elf.la + + # The list of files that go into libunwind and libunwind-aarch64: noinst_HEADERS += aarch64/init.h aarch64/offsets.h aarch64/unwind_i.h libunwind_la_SOURCES_aarch64_common = $(libunwind_la_SOURCES_common) \ diff --git a/src/eh_elf/eh_elf.c b/src/eh_elf/eh_elf.c index ee4d9b02..b4129f9a 100644 --- a/src/eh_elf/eh_elf.c +++ b/src/eh_elf/eh_elf.c @@ -12,5 +12,21 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ************************************************/ -#include "eh_elf_i.h" +#include "eh_elf.h" +int eh_elf_init_local() { + return mmap_init_local(); +} + +int eh_elf_init_pid(pid_t pid) { + return mmap_init_pid(pid); +} + +void eh_elf_clear() { + mmap_clear(); +} + +int eh_elf_step_cursor(struct cursor *cursor) { + // TODO implement + return 0; +} diff --git a/src/eh_elf/eh_elf.h b/src/eh_elf/eh_elf.h index 90a5247a..fa01398e 100644 --- a/src/eh_elf/eh_elf.h +++ b/src/eh_elf/eh_elf.h @@ -33,10 +33,10 @@ int eh_elf_init_local(); int eh_elf_init_pid(pid_t pid); /// Cleanup everything that was allocated by eh_elf_init_* -void eh_elf_clean(); +void eh_elf_clear(); /** Step the cursor using eh_elf mechanisms. * - * Return 0 if everything went file, otherwise, return a negative value. + * Return 0 if everything went fine, otherwise, return a negative value. **/ int eh_elf_step_cursor(struct cursor *cursor); diff --git a/src/x86_64/Ginit_remote.c b/src/x86_64/Ginit_remote.c index ffb00fc6..f9886322 100644 --- a/src/x86_64/Ginit_remote.c +++ b/src/x86_64/Ginit_remote.c @@ -42,7 +42,7 @@ unw_init_remote (unw_cursor_t *cursor, unw_addr_space_t as, void *as_arg) Debug (1, "(cursor=%p)\n", c); - eh_elf_init_pid(as.acc.get_pid(as_arg)); + eh_elf_init_pid(as->acc.get_pid(as_arg)); c->dwarf.as = as; if (as == unw_local_addr_space)