Daniel,
On february last year I saw a message about this problem and you recommended
using a toolchain from CodeSourcery.
We currently use a toolchain for ARM processors based on gcc 4.3.2 and glibc
2.9 and I would prefer to keep it (unless you point me a reason not to :)).
Well... I took a look my glibc headers and found out that mcontext_t is an
opaque data type.
typedef struct sigcontext mcontext_t;
As I needed to run mpatrol on my board I did a quick hack on libunwind so
that I could cross-compile it.
I just cast the mcontext_t variable to struct sigcontext.
Is that a valid patch? What would you recommend?
Thanks for your attention,
Thierry
--- a/include/libunwind-arm.h
+++ b/include/libunwind-arm.h
@@ -260,7 +260,7 @@ typedef ucontext_t unw_tdep_context_t;
#define unw_tdep_getcontext(uc) (({ \
unw_tdep_context_t *unw_ctx = (uc); \
register int unw_base asm ("r0") \
- = (int) (&unw_ctx->uc_mcontext.arm_r0); \
+ = (int) (&(((struct sigcontext *)
&unw_ctx->uc_mcontext)->arm_r0)); \
__asm__ __volatile__ ( \
"stmia %[base], {r0-r15}" \
: : [base] "r" (unw_base) : "memory"); \
@@ -269,7 +269,7 @@ typedef ucontext_t unw_tdep_context_t;
#define unw_tdep_getcontext(uc) (({ \
unw_tdep_context_t *unw_ctx = (uc); \
register int unw_base asm ("r0") \
- = (int) (&unw_ctx->uc_mcontext.arm_r0); \
+ = (int) (&(((struct sigcontext *)
&unw_ctx->uc_mcontext)->arm_r0)); \
__asm__ __volatile__ ( \
".align 2\nbx pc\nnop\n.code 32\n" \
"stmia %[base],
{r0-r15}\n" \
_______________________________________________
Libunwind-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/libunwind-devel