On Mon, Apr 5, 2010 at 7:03 AM, Konstantin Belousov <[email protected]>wrote:

>
> It shall not appear in config.h. What I did is created a macro that
> accept a list of PTRACE_* or PT_* identifiers and generates proper
> AC_CHECK_DECLS() calls. The individual HAVE_DECL_PTRACE_something or
> HAVE_DECL_PT_something defines are still there.
>

Compilation fails on Linux as follows:

ptrace/_UPT_access_fpreg.c:104:2: error: #error Fix me
make[2]: *** [ptrace/_UPT_access_fpreg.o] Error 1

i.e. HAVE_DECL_PTRACE_* doesn't seem to be defined anywhere.


> After I saw your reorganisation for sigframe handling code, I think
> that the similar approach may work well there too.
>
>
There may be some opportunities for code sharing between OSes with common
roots. So I'd like to defer code reorganization for now.

Could you move the get_scratch_loc() code to OS specific files as well? I
can help test on Linux once you're done.

Some more thoughts about the freebsd port:

* dl_iterate_phdr() is not async signal safe on linux (it takes some libdl
internal locks). So it's unsafe to call from libunwind. But we still do,
because there is no better alternative. Is this the case for FreeBSD as
well?

* cursor->validate implementation

libunwind uses msync() which is not bulletproof i.e. it's not directly
equivalent to access_ok(VERIFY_READ,...) in the kernel. Does FreeBSD have a
better alternative?

If there are libc interfaces to enumerate valid stack addresses, the
validation can be implemented as an address range check.

 -Arun
_______________________________________________
Libunwind-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to