public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: mark@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Revert old unused elf and ptrace libunwind changes. Date: Mon, 28 Jan 2008 12:00:00 -0000 [thread overview] Message-ID: <20080128120035.8451.qmail@sourceware.org> (raw) The branch, master has been updated via 2dba4bb8b5ef15d14c6716804b4a9c32d9632166 (commit) from 3e08aa1f3e5d75bd9745424bd5450ccd3303456e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 2dba4bb8b5ef15d14c6716804b4a9c32d9632166 Author: Mark Wielaard <mwielaard@redhat.com> Date: Sun Jan 27 21:21:59 2008 +0100 Revert old unused elf and ptrace libunwind changes. frysk-imports/libunwind/ChangeLog 2007-01-25 Mark Wielaard <mwielaard@redhat.com> Revert: 2006-09-20 Alexandre Oliva <aoliva@redhat.com> * src/os-linux.h (maps_next): Don't error out just because path is missing. * include/tdep-hppa/libunwind_i.h (tdep_get_elf_image): Add as and arg to the parameter list. * include/tdep-ia64/libunwind_i.h (tdep_get_elf_image): Ditto. * include/tdep-ppc64/libunwind_i.h (tdep_get_elf_image): Ditto. * include/tdep-x86/libunwind_i.h (tdep_get_elf_image): Ditto. * include/tdep-x86_64/libunwind_i.h (tdep_get_elf_image): Ditto. * src/elfxx.h (get_proc_name): Ditto. * src/elfxx.c (get_proc_name): Ditto. Adjust. * src/hppa/Ginit.c (get_static_proc_name): Adjust. * src/ia64/Ginit.c (get_static_proc_name): Ditto. * src/ppc64/Ginit.c (get_static_proc_name): Ditto. * src/x86/Ginit.c (get_static_proc_name): Ditto. * src/x86_64/Ginit.c (get_static_proc_name): Ditto. * src/ptrace/_UPT_find_proc_info.c (get_unwind_info): Ditto. * src/ptrace/_UPT_get_proc_name.c (_UPT_get_proc_name): Ditto. * src/os-hpux.c (tdep_get_elf_image): Ditto. * src/os-linux.c (tdep_get_elf_image): Ditto. Read in 1-page segments that start with the ELF magic. (MAX_VDSO_SIZE): New. 2007-04-25 Nurdin Premji <npremji@redhat.com> * src/elfxx.h (elf_map_image): map image using MAP_32BIT to avoid address truncation issues in cross-platform unwinding. * src/os-linux.h: (tdep_get_elf_image) Ditto for VDSO section. * src/ptrace/_UPT_find_proc_info.c (_UPTi_find_unwind_table): Added dummy local address space for cross-platform unwinding. ----------------------------------------------------------------------- Summary of changes: frysk-imports/libunwind/ChangeLog | 35 +++++++++ .../libunwind/include/tdep-hppa/libunwind_i.h | 6 +- .../libunwind/include/tdep-ia64/libunwind_i.h | 6 +- .../libunwind/include/tdep-ppc32/libunwind_i.h | 6 +- .../libunwind/include/tdep-ppc64/libunwind_i.h | 5 +- .../libunwind/include/tdep-x86/libunwind_i.h | 6 +- .../libunwind/include/tdep-x86_64/libunwind_i.h | 6 +- frysk-imports/libunwind/src/elfxx.c | 4 +- frysk-imports/libunwind/src/elfxx.h | 9 +-- frysk-imports/libunwind/src/hppa/Ginit.c | 2 +- frysk-imports/libunwind/src/ia64/Ginit.c | 2 +- frysk-imports/libunwind/src/os-hpux.c | 6 +- frysk-imports/libunwind/src/os-linux.c | 77 +------------------- frysk-imports/libunwind/src/os-linux.h | 6 +-- frysk-imports/libunwind/src/ppc32/Ginit.c | 2 +- frysk-imports/libunwind/src/ppc64/Ginit.c | 2 +- .../libunwind/src/ptrace/_UPT_find_proc_info.c | 34 ++------- .../libunwind/src/ptrace/_UPT_get_proc_name.c | 4 +- frysk-imports/libunwind/src/x86/Ginit.c | 2 +- frysk-imports/libunwind/src/x86_64/Ginit.c | 2 +- 20 files changed, 71 insertions(+), 151 deletions(-) First 500 lines of diff: diff --git a/frysk-imports/libunwind/ChangeLog b/frysk-imports/libunwind/ChangeLog index bac96eb..36d38de 100644 --- a/frysk-imports/libunwind/ChangeLog +++ b/frysk-imports/libunwind/ChangeLog @@ -1,3 +1,38 @@ +2007-01-25 Mark Wielaard <mwielaard@redhat.com> + + Revert: + 2006-09-20 Alexandre Oliva <aoliva@redhat.com> + + * src/os-linux.h (maps_next): Don't error out just because + path is missing. + * include/tdep-hppa/libunwind_i.h (tdep_get_elf_image): Add as + and arg to the parameter list. + * include/tdep-ia64/libunwind_i.h (tdep_get_elf_image): Ditto. + * include/tdep-ppc64/libunwind_i.h (tdep_get_elf_image): Ditto. + * include/tdep-x86/libunwind_i.h (tdep_get_elf_image): Ditto. + * include/tdep-x86_64/libunwind_i.h (tdep_get_elf_image): Ditto. + * src/elfxx.h (get_proc_name): Ditto. + * src/elfxx.c (get_proc_name): Ditto. Adjust. + * src/hppa/Ginit.c (get_static_proc_name): Adjust. + * src/ia64/Ginit.c (get_static_proc_name): Ditto. + * src/ppc64/Ginit.c (get_static_proc_name): Ditto. + * src/x86/Ginit.c (get_static_proc_name): Ditto. + * src/x86_64/Ginit.c (get_static_proc_name): Ditto. + * src/ptrace/_UPT_find_proc_info.c (get_unwind_info): Ditto. + * src/ptrace/_UPT_get_proc_name.c (_UPT_get_proc_name): Ditto. + * src/os-hpux.c (tdep_get_elf_image): Ditto. + * src/os-linux.c (tdep_get_elf_image): Ditto. Read in 1-page + segments that start with the ELF magic. + (MAX_VDSO_SIZE): New. + + 2007-04-25 Nurdin Premji <npremji@redhat.com> + + * src/elfxx.h (elf_map_image): map image using MAP_32BIT to + avoid address truncation issues in cross-platform unwinding. + * src/os-linux.h: (tdep_get_elf_image) Ditto for VDSO section. + * src/ptrace/_UPT_find_proc_info.c (_UPTi_find_unwind_table): + Added dummy local address space for cross-platform unwinding. + 2008-01-18 Mark Wielaard <mwielaard@redhat.com> * include/dwarf.h (dwarf_cie_info): Add as and as_arg members. diff --git a/frysk-imports/libunwind/include/tdep-hppa/libunwind_i.h b/frysk-imports/libunwind/include/tdep-hppa/libunwind_i.h index b7b67d4..74bd9c0 100644 --- a/frysk-imports/libunwind/include/tdep-hppa/libunwind_i.h +++ b/frysk-imports/libunwind/include/tdep-hppa/libunwind_i.h @@ -252,10 +252,8 @@ extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_dyn_info_t *di, unw_proc_info_t *pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (ucontext_t *uc, int reg); -extern int tdep_get_elf_image (unw_addr_space_t as, struct elf_image *ei, - pid_t pid, unw_word_t ip, - unsigned long *segbase, unsigned long *mapoff, - void *arg); +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, int write); extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, diff --git a/frysk-imports/libunwind/include/tdep-ia64/libunwind_i.h b/frysk-imports/libunwind/include/tdep-ia64/libunwind_i.h index edf3f9f..b851a03 100644 --- a/frysk-imports/libunwind/include/tdep-ia64/libunwind_i.h +++ b/frysk-imports/libunwind/include/tdep-ia64/libunwind_i.h @@ -244,10 +244,8 @@ extern void tdep_put_unwind_info (unw_addr_space_t as, unw_proc_info_t *pi, void *arg); extern void *tdep_uc_addr (ucontext_t *uc, unw_regnum_t regnum, uint8_t *nat_bitnr); -extern int tdep_get_elf_image (unw_addr_space_t as, struct elf_image *ei, - pid_t pid, unw_word_t ip, - unsigned long *segbase, unsigned long *mapoff, - void *arg); +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, int write); extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, diff --git a/frysk-imports/libunwind/include/tdep-ppc32/libunwind_i.h b/frysk-imports/libunwind/include/tdep-ppc32/libunwind_i.h index 9011538..d88ab4c 100644 --- a/frysk-imports/libunwind/include/tdep-ppc32/libunwind_i.h +++ b/frysk-imports/libunwind/include/tdep-ppc32/libunwind_i.h @@ -288,10 +288,8 @@ extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t * pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (ucontext_t * uc, int reg); -extern int tdep_get_elf_image (unw_addr_space_t as, struct elf_image *ei, - pid_t pid, unw_word_t ip, - unsigned long *segbase, unsigned long *mapoff, - void *arg); +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t * valp, int write); extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, diff --git a/frysk-imports/libunwind/include/tdep-ppc64/libunwind_i.h b/frysk-imports/libunwind/include/tdep-ppc64/libunwind_i.h index 74dfe2b..710fdd6 100644 --- a/frysk-imports/libunwind/include/tdep-ppc64/libunwind_i.h +++ b/frysk-imports/libunwind/include/tdep-ppc64/libunwind_i.h @@ -288,9 +288,8 @@ extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t * pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (ucontext_t * uc, int reg); -extern int tdep_get_elf_image (unw_addr_space_t as, struct elf_image *ei, pid_t pid, - unw_word_t ip, unsigned long *segbase, - unsigned long *mapoff, void *arg); +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t * valp, int write); extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, diff --git a/frysk-imports/libunwind/include/tdep-x86/libunwind_i.h b/frysk-imports/libunwind/include/tdep-x86/libunwind_i.h index 55ccb27..ac6df2f 100644 --- a/frysk-imports/libunwind/include/tdep-x86/libunwind_i.h +++ b/frysk-imports/libunwind/include/tdep-x86/libunwind_i.h @@ -256,10 +256,8 @@ extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_dyn_info_t *di, unw_proc_info_t *pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (ucontext_t *uc, int reg); -extern int tdep_get_elf_image (unw_addr_space_t as, struct elf_image *ei, - pid_t pid, unw_word_t ip, - unsigned long *segbase, unsigned long *mapoff, - void *arg); +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, int write); extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, diff --git a/frysk-imports/libunwind/include/tdep-x86_64/libunwind_i.h b/frysk-imports/libunwind/include/tdep-x86_64/libunwind_i.h index 4ba8915..9aeb425 100644 --- a/frysk-imports/libunwind/include/tdep-x86_64/libunwind_i.h +++ b/frysk-imports/libunwind/include/tdep-x86_64/libunwind_i.h @@ -182,10 +182,8 @@ extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, unw_dyn_info_t *di, unw_proc_info_t *pi, int need_unwind_info, void *arg); extern void *tdep_uc_addr (ucontext_t *uc, int reg); -extern int tdep_get_elf_image (unw_addr_space_t as, struct elf_image *ei, - pid_t pid, unw_word_t ip, - unsigned long *segbase, unsigned long *mapoff, - void *arg); +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff); extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, int write); extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, diff --git a/frysk-imports/libunwind/src/elfxx.c b/frysk-imports/libunwind/src/elfxx.c index 6b32305..05b9943 100644 --- a/frysk-imports/libunwind/src/elfxx.c +++ b/frysk-imports/libunwind/src/elfxx.c @@ -138,7 +138,7 @@ elf_w (lookup_symbol) (unw_addr_space_t as, HIDDEN int elf_w (get_proc_name) (unw_addr_space_t as, pid_t pid, unw_word_t ip, - char *buf, size_t buf_len, unw_word_t *offp, void *arg) + char *buf, size_t buf_len, unw_word_t *offp) { unsigned long segbase, mapoff; Elf_W (Addr) load_offset = 0; @@ -147,7 +147,7 @@ elf_w (get_proc_name) (unw_addr_space_t as, pid_t pid, unw_word_t ip, Elf_W (Phdr) *phdr; int i, ret; - ret = tdep_get_elf_image (as, &ei, pid, ip, &segbase, &mapoff, arg); + ret = tdep_get_elf_image (&ei, pid, ip, &segbase, &mapoff); if (ret < 0) return ret; diff --git a/frysk-imports/libunwind/src/elfxx.h b/frysk-imports/libunwind/src/elfxx.h index 205b49f..7742806 100644 --- a/frysk-imports/libunwind/src/elfxx.h +++ b/frysk-imports/libunwind/src/elfxx.h @@ -2,7 +2,6 @@ Copyright (C) 2003, 2005 Hewlett-Packard Co Copyright (C) 2007 David Mosberger-Tang Contributed by David Mosberger-Tang <dmosberger@gmail.com> - Copyright Red Hat 2007 This file is part of libunwind. @@ -44,10 +43,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ # define elf_w(x) _Uelf64_##x #endif -#ifndef MAP_32BIT -# define MAP_32BIT 0 -#endif - static inline int elf_map_image (struct elf_image *ei, const char *path) { @@ -65,7 +60,7 @@ elf_map_image (struct elf_image *ei, const char *path) } ei->size = stat.st_size; - ei->image = mmap (NULL, ei->size, PROT_READ, MAP_PRIVATE | MAP_32BIT, fd, 0); + ei->image = mmap (NULL, ei->size, PROT_READ, MAP_PRIVATE, fd, 0); close (fd); if (ei->image == MAP_FAILED) return -1; @@ -77,4 +72,4 @@ extern int elf_w (valid_object) (struct elf_image *ei); extern int elf_w (get_proc_name) (unw_addr_space_t as, pid_t pid, unw_word_t ip, char *buf, size_t len, - unw_word_t *offp, void *arg); + unw_word_t *offp); diff --git a/frysk-imports/libunwind/src/hppa/Ginit.c b/frysk-imports/libunwind/src/hppa/Ginit.c index 39f1d1a..5326b82 100644 --- a/frysk-imports/libunwind/src/hppa/Ginit.c +++ b/frysk-imports/libunwind/src/hppa/Ginit.c @@ -172,7 +172,7 @@ get_static_proc_name (unw_addr_space_t as, unw_word_t ip, char *buf, size_t buf_len, unw_word_t *offp, void *arg) { - return _Uelf32_get_proc_name (as, getpid (), ip, buf, buf_len, offp, arg); + return _Uelf32_get_proc_name (as, getpid (), ip, buf, buf_len, offp); } HIDDEN void diff --git a/frysk-imports/libunwind/src/ia64/Ginit.c b/frysk-imports/libunwind/src/ia64/Ginit.c index 3c5f7ad..5afa9ab 100644 --- a/frysk-imports/libunwind/src/ia64/Ginit.c +++ b/frysk-imports/libunwind/src/ia64/Ginit.c @@ -348,7 +348,7 @@ get_static_proc_name (unw_addr_space_t as, unw_word_t ip, char *buf, size_t buf_len, unw_word_t *offp, void *arg) { - return _Uelf64_get_proc_name (as, getpid (), ip, buf, buf_len, offp, arg); + return _Uelf64_get_proc_name (as, getpid (), ip, buf, buf_len, offp); } HIDDEN void diff --git a/frysk-imports/libunwind/src/os-hpux.c b/frysk-imports/libunwind/src/os-hpux.c index b34851a..586ace2 100644 --- a/frysk-imports/libunwind/src/os-hpux.c +++ b/frysk-imports/libunwind/src/os-hpux.c @@ -33,10 +33,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "elf64.h" HIDDEN int -tdep_get_elf_image (unw_addr_space_t as, struct elf_image *ei, - pid_t pid, unw_word_t ip, - unsigned long *segbase, unsigned long *mapoff, - void *arg) +tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff) { struct load_module_desc lmd; const char *path; diff --git a/frysk-imports/libunwind/src/os-linux.c b/frysk-imports/libunwind/src/os-linux.c index f0b4142..ae37d8f 100644 --- a/frysk-imports/libunwind/src/os-linux.c +++ b/frysk-imports/libunwind/src/os-linux.c @@ -1,7 +1,6 @@ /* libunwind - a platform-independent unwind library Copyright (C) 2003-2005 Hewlett-Packard Co Contributed by David Mosberger-Tang <davidm@hpl.hp.com> - Copyright Red Hat 2007 This file is part of libunwind. @@ -32,26 +31,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "libunwind_i.h" #include "os-linux.h" -#ifndef MAX_VDSO_SIZE -# define MAX_VDSO_SIZE ((size_t) sysconf (_SC_PAGESIZE)) -#endif - -#ifndef MAP_32BIT -# define MAP_32BIT 0 -#endif - PROTECTED int -tdep_get_elf_image (unw_addr_space_t as, struct elf_image *ei, - pid_t pid, unw_word_t ip, - unsigned long *segbase, unsigned long *mapoff, - void *arg) +tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff) { struct map_iterator mi; char path[PATH_MAX]; int found = 0; unsigned long hi; - unw_accessors_t *a; - unw_word_t magic; maps_init (&mi, pid); while (maps_next (&mi, segbase, &hi, mapoff, path, sizeof (path))) @@ -65,65 +52,7 @@ tdep_get_elf_image (unw_addr_space_t as, struct elf_image *ei, if (!found) return -1; - found = elf_map_image (ei, path); - if (found != -1) - return found; - - /* If the above failed, try to bring in page-sized segments directly - from process memory. This enables us to locate VDSO unwind - tables. */ - ei->size = hi - *segbase; - if (ei->size > MAX_VDSO_SIZE) - return found; - - a = unw_get_accessors (as); - if (! a->access_mem) - return found; - - /* Try to decide whether it's an ELF image before bringing it all - in. */ - if (ei->size <= EI_CLASS || ei->size <= sizeof (magic)) - return found; - - if (sizeof (magic) >= SELFMAG) - { - int ret = (*a->access_mem) (as, *segbase, &magic, 0, arg); - if (ret < 0) - return ret; - - if (memcmp (&magic, ELFMAG, SELFMAG) != 0) - return found; - } - - ei->image = mmap (0, ei->size, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS | MAP_32BIT, -1, 0); - if (ei->image == MAP_FAILED) - return found; - - if (sizeof (magic) >= SELFMAG) - { - *(unw_word_t *)ei->image = magic; - hi = sizeof (magic); - } - else - hi = 0; - - for (; hi < ei->size; hi += sizeof (unw_word_t)) - { - found = (*a->access_mem) (as, *segbase + hi, ei->image + hi, - 0, arg); - if (found < 0) - { - munmap (ei->image, ei->size); - return found; - } - } - - if (*segbase == *mapoff - && (*path == 0 || strcmp (path, "[vdso]") == 0)) - *mapoff = 0; - - return 0; + return elf_map_image (ei, path); } #endif /* UNW_REMOTE_ONLY */ diff --git a/frysk-imports/libunwind/src/os-linux.h b/frysk-imports/libunwind/src/os-linux.h index dba788e..b2c9a8b 100644 --- a/frysk-imports/libunwind/src/os-linux.h +++ b/frysk-imports/libunwind/src/os-linux.h @@ -294,12 +294,8 @@ maps_next (struct map_iterator *mi, cp = scan_char (cp, &colon); cp = scan_hex (cp, &minor); cp = scan_dec (cp, &inum); - if (!cp) - continue; cp = scan_string (cp, path, path_size); - if (!cp) - *path = 0; - if (dash != '-' || colon != ':') + if (!cp || dash != '-' || colon != ':') continue; /* skip line with unknown or bad format */ return 1; } diff --git a/frysk-imports/libunwind/src/ppc32/Ginit.c b/frysk-imports/libunwind/src/ppc32/Ginit.c index 98034ab..47c66f1 100644 --- a/frysk-imports/libunwind/src/ppc32/Ginit.c +++ b/frysk-imports/libunwind/src/ppc32/Ginit.c @@ -199,7 +199,7 @@ get_static_proc_name (unw_addr_space_t as, unw_word_t ip, char *buf, size_t buf_len, unw_word_t *offp, void *arg) { - return _Uelf32_get_proc_name (as, getpid (), ip, buf, buf_len, offp, arg); + return _Uelf32_get_proc_name (as, getpid (), ip, buf, buf_len, offp); } HIDDEN void diff --git a/frysk-imports/libunwind/src/ppc64/Ginit.c b/frysk-imports/libunwind/src/ppc64/Ginit.c index e53a343..97c9d78 100644 --- a/frysk-imports/libunwind/src/ppc64/Ginit.c +++ b/frysk-imports/libunwind/src/ppc64/Ginit.c @@ -208,7 +208,7 @@ get_static_proc_name (unw_addr_space_t as, unw_word_t ip, char *buf, size_t buf_len, unw_word_t *offp, void *arg) { - return _Uelf64_get_proc_name (as, getpid (), ip, buf, buf_len, offp, arg); + return _Uelf64_get_proc_name (as, getpid (), ip, buf, buf_len, offp); } HIDDEN void diff --git a/frysk-imports/libunwind/src/ptrace/_UPT_find_proc_info.c b/frysk-imports/libunwind/src/ptrace/_UPT_find_proc_info.c index c06e456..9f4ed38 100644 --- a/frysk-imports/libunwind/src/ptrace/_UPT_find_proc_info.c +++ b/frysk-imports/libunwind/src/ptrace/_UPT_find_proc_info.c @@ -1,7 +1,6 @@ /* libunwind - a platform-independent unwind library Copyright (C) 2003-2004 Hewlett-Packard Co Contributed by David Mosberger-Tang <davidm@hpl.hp.com> - Copyright Red Hat 2007 This file is part of libunwind. @@ -171,6 +170,7 @@ _UPTi_find_unwind_table (struct UPT_info *ui, unw_addr_space_t as, unw_word_t addr, eh_frame_start, fde_count, load_base; struct dwarf_eh_frame_hdr *hdr; unw_proc_info_t pi; + unw_accessors_t *a; Elf_W(Ehdr) *ehdr; int i, ret; @@ -236,7 +236,8 @@ _UPTi_find_unwind_table (struct UPT_info *ui, unw_addr_space_t as, path, hdr->version); return 0; } - + + a = unw_get_accessors (unw_local_addr_space); addr = (unw_word_t) (hdr + 1); /* Fill in a dummy proc_info structure. We just need to fill in @@ -246,37 +247,14 @@ _UPTi_find_unwind_table (struct UPT_info *ui, unw_addr_space_t as, memset (&pi, 0, sizeof (pi)); pi.gp = ui->di_cache.gp; -//The following is a dummy local address space used by dwarf_read_encoded_pointer. - int - local_access_mem (unw_addr_space_t as, unw_word_t addr, - unw_word_t *val, int write, void *arg) - { - if (write) - { - Debug (16, "mem[%x] <- %x\n", addr, *val); - *(unw_word_t *) addr = *val; - } - else - { - *val = *(unw_word_t *) addr; - Debug (16, "mem[%x] -> %x\n", addr, *val); - } - return 0; - } - - unw_accessors_t temp_local_accessors = {NULL, NULL, NULL, local_access_mem, - NULL, NULL, NULL, NULL, NULL}; - unw_addr_space_t temp_local_addr_space - = unw_create_addr_space(&temp_local_accessors, 0); - /* (Optionally) read eh_frame_ptr: */ - if ((ret = dwarf_read_encoded_pointer (temp_local_addr_space, &temp_local_accessors, + if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a, &addr, hdr->eh_frame_ptr_enc, &pi, &eh_frame_start, NULL)) < 0) return NULL; /* (Optionally) read fde_count: */ - if ((ret = dwarf_read_encoded_pointer (temp_local_addr_space, &temp_local_accessors, + if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a, &addr, hdr->fde_count_enc, &pi, &fde_count, NULL)) < 0) return NULL; @@ -359,7 +337,7 @@ get_unwind_info (struct UPT_info *ui, unw_addr_space_t as, unw_word_t ip) ui->di_cache.start_ip = ui->di_cache.end_ip = 0; } - if (tdep_get_elf_image (as, &ui->ei, ui->pid, ip, &segbase, &mapoff, ui) < 0) + if (tdep_get_elf_image (&ui->ei, ui->pid, ip, &segbase, &mapoff) < 0) return NULL; /* Here, SEGBASE is the starting-address of the (mmap'ped) segment diff --git a/frysk-imports/libunwind/src/ptrace/_UPT_get_proc_name.c b/frysk-imports/libunwind/src/ptrace/_UPT_get_proc_name.c index 2d718fc..6ac85a0 100644 --- a/frysk-imports/libunwind/src/ptrace/_UPT_get_proc_name.c +++ b/frysk-imports/libunwind/src/ptrace/_UPT_get_proc_name.c @@ -33,9 +33,9 @@ _UPT_get_proc_name (unw_addr_space_t as, unw_word_t ip, struct UPT_info *ui = arg; #if ELF_CLASS == ELFCLASS64 - return _Uelf64_get_proc_name (as, ui->pid, ip, buf, buf_len, offp, arg); + return _Uelf64_get_proc_name (as, ui->pid, ip, buf, buf_len, offp); #elif ELF_CLASS == ELFCLASS32 - return _Uelf32_get_proc_name (as, ui->pid, ip, buf, buf_len, offp, arg); + return _Uelf32_get_proc_name (as, ui->pid, ip, buf, buf_len, offp); #else return -UNW_ENOINFO; #endif diff --git a/frysk-imports/libunwind/src/x86/Ginit.c b/frysk-imports/libunwind/src/x86/Ginit.c index 21453a4..abc9e61 100644 --- a/frysk-imports/libunwind/src/x86/Ginit.c +++ b/frysk-imports/libunwind/src/x86/Ginit.c @@ -187,7 +187,7 @@ get_static_proc_name (unw_addr_space_t as, unw_word_t ip, char *buf, size_t buf_len, unw_word_t *offp, hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-01-28 12:00 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20080128120035.8451.qmail@sourceware.org \ --to=mark@sourceware.org \ --cc=frysk-cvs@sourceware.org \ --cc=frysk@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).