libunwind-devel
[Top][All Lists]
Advanced

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

[Libunwind-devel] 'mcontext_t' has no member named 'arm_r0'


From: Thierry Panthier
Subject: [Libunwind-devel] 'mcontext_t' has no member named 'arm_r0'
Date: Wed, 4 Feb 2009 12:38:41 +1100

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"                                                \

reply via email to

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