libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] [PATCHv3 1/4] Add core dump unwinding support to l


From: Denys Vlasenko
Subject: Re: [Libunwind-devel] [PATCHv3 1/4] Add core dump unwinding support to libunwind
Date: Thu, 29 Mar 2012 18:36:07 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120316 Thunderbird/11.0

On 03/24/2012 11:31 PM, Arun Sharma wrote:
On Fri, Mar 16, 2012 at 5:53 AM, Denys Vlasenko<address@hidden>  wrote:

I want this code to end up in libunwind.so instead,
so we can use it equally from both libs.

Our predicament seems to be that we have no good
place to put its source in the source tree, right?

drwxr-xr-x. 2 root root  4096 Feb 13 18:43 arm
drwxr-xr-x. 2 root root  4096 Feb 13 18:43 hppa
drwxr-xr-x. 2 root root  4096 Feb 13 18:43 ia64
drwxr-xr-x. 2 root root  4096 Feb 13 18:43 mi
drwxr-xr-x. 2 root root  4096 Feb 13 18:43 mips
drwxr-xr-x. 2 root root  4096 Feb 13 18:43 ppc
drwxr-xr-x. 2 root root  4096 Feb 13 18:43 ppc32
drwxr-xr-x. 2 root root  4096 Feb 13 18:43 ppc64
drwxr-xr-x. 2 root root  4096 Feb 13 18:43 x86
drwxr-xr-x. 2 root root  4096 Feb 13 18:43 x86_64

The above dirs are arch specific - not suitable.

The code is also ia64 specific. I don't have any objections to putting
it under ia64.

It isn't.

Please take a look at src/ptrace/_UPT_find_proc_info.c
(before patching. Current git, for example).

It has the following structure:


#if UNW_TARGET_IA64

static unw_word_t
find_gp (struct UPT_info *ui, Elf64_Phdr *pdyn, Elf64_Addr load_base) ...
HIDDEN int
_UPTi_find_unwind_table (struct UPT_info *ui, unw_addr_space_t as,
                         char *path, unw_word_t segbase, unw_word_t mapoff,
                         unw_word_t ip) ...

#elif UNW_TARGET_X86 || UNW_TARGET_X86_64 || UNW_TARGET_HPPA \
|| UNW_TARGET_PPC32 || UNW_TARGET_PPC64 || UNW_TARGET_ARM

int
dwarf_read_encoded_pointer (unw_addr_space_t as, unw_accessors_t *a,
                            unw_word_t *addr, unsigned char encoding,
                            const unw_proc_info_t *pi,
                            unw_word_t *valp, void *arg) ...
HIDDEN int
_UPTi_find_unwind_table (struct UPT_info *ui, unw_addr_space_t as,
                         char *path, unw_word_t segbase, unw_word_t mapoff,
                         unw_word_t ip) ...

#endif /* UNW_TARGET_X86 || UNW_TARGET_X86_64 || UNW_TARGET_HPPA*/

static int
get_unwind_info (struct UPT_info *ui, unw_addr_space_t as, unw_word_t ip) ...
int
_UPT_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
                     int need_unwind_info, void *arg) ...

Thus, find_unwind_table exists for all architectures, not only for IA64.
It just has two different implementations: one for IA64, and another for e


Re: common

There is also a dir called "mi" (machine independent). But this is
arch specific code, so we shouldn't move it there.

Actually it might be a good place...

Please find attached patch which moves find_proc_info() to mi/*.

--
vda

Attachment: z1.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]