From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeIE2-00023b-9M for qemu-devel@nongnu.org; Thu, 20 Aug 2009 20:43:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeIDw-00023P-Nv for qemu-devel@nongnu.org; Thu, 20 Aug 2009 20:43:25 -0400 Received: from [199.232.76.173] (port=56007 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeIDw-00023M-IE for qemu-devel@nongnu.org; Thu, 20 Aug 2009 20:43:20 -0400 Received: from mail-bw0-f227.google.com ([209.85.218.227]:45550) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MeIDv-0002bn-Lo for qemu-devel@nongnu.org; Thu, 20 Aug 2009 20:43:20 -0400 Received: by bwz27 with SMTP id 27so259461bwz.34 for ; Thu, 20 Aug 2009 17:43:17 -0700 (PDT) MIME-Version: 1.0 Date: Thu, 20 Aug 2009 17:43:17 -0700 Message-ID: <526ddcfc0908201743x2d37a468s29c9388007060f6f@mail.gmail.com> From: Toni Content-Type: multipart/alternative; boundary=0016e6567e546fbfa404719c275c Subject: [Qemu-devel] Qemu user-mode MacOS List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --0016e6567e546fbfa404719c275c Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi,I have a problem: I'm trying to install on Mac OS qemu user-mode, I need it, and so I find out that the only way is correct the wrong part of the source code of qemu darwin_user, I correct some errors, but now I found out something that I don't undestand: CC i386-darwin-user/cpu-exec.o /Users/ToNy/Desktop/qemu-0.10.5_prova/cpu-exec.c: In function =91cpu_x86_signal_handler=92: /Users/ToNy/Desktop/qemu-0.10.5_prova/cpu-exec.c:1182: error: dereferencing pointer to incomplete type /Users/ToNy/Desktop/qemu-0.10.5_prova/cpu-exec.c:1183: error: dereferencing pointer to incomplete type /Users/ToNy/Desktop/qemu-0.10.5_prova/cpu-exec.c:1186: error: dereferencing pointer to incomplete type /Users/ToNy/Desktop/qemu-0.10.5_prova/cpu-exec.c:1187: error: dereferencing pointer to incomplete type make[1]: *** [cpu-exec.o] Error 1 make: *** [subdir-i386-darwin-user] Error 2 that is this part of code: #1154# include #1168int cpu_signal_handler(int host_signum, void *pinfo, #1169 void *puc) #1170{ #1171 siginfo_t *info =3D pinfo; #1172 struct ucontext *uc =3D puc; #1173 unsigned long pc; #1174 int trapno; #1175 #1176#ifndef REG_EIP #1177/* for glibc 2.1 */ #1178#define REG_EIP EIP #1179#define REG_ERR ERR #1180#define REG_TRAPNO TRAPNO #1181#endif #1182 pc =3D EIP_sig(uc); #1183 trapno =3D TRAP_sig(uc); #1184 return handle_cpu_signal(pc, (unsigned long)info->si_addr, #1185 trapno =3D=3D 0xe ? #1186 (ERROR_sig(uc) >> 1) & 1 : 0, #1187 &uc->uc_sigmask, puc); the problem may be the ucontext definition of the uc variable, that is defined in sys/ucontext.h, that call _structs.h where finally we found the struct: #ifdef __need_struct_ucontext #undef __need_struct_ucontext #ifndef _STRUCT_UCONTEXT #if __DARWIN_UNIX03 #define _STRUCT_UCONTEXT struct __darwin_ucontext #else /* !__DARWIN_UNIX03 */ #define _STRUCT_UCONTEXT struct ucontext #endif /* __DARWIN_UNIX03 */ _STRUCT_UCONTEXT { int uc_onstack; __darwin_sigset_t uc_sigmask; /* signal mask used by this context */ _STRUCT_SIGALTSTACK uc_stack; /* stack used by this context */ _STRUCT_UCONTEXT *uc_link; /* pointer to resuming context */ __darwin_size_t uc_mcsize; /* size of the machine context passed in */ _STRUCT_MCONTEXT *uc_mcontext; /* pointer to machine specific context */ #ifdef _XOPEN_SOURCE _STRUCT_MCONTEXT __mcontext_data; #endif /* _XOPEN_SOURCE */ }; #endif /* _STRUCT_UCONTEXT */ #endif /* __need_struct_ucontext */ here I found _STRUCT_SIGALTSTACK that gave me the same error in another part, in that case I resolved the error simply with the declaration of the struct inside the code... but I think that is better now to understand why it gives error. The _STRUCT_SIGALTSTACK is also declared inside _structs.h: #ifdef __need_struct_sigaltstack #undef __need_struct_sigaltstack /* Structure used in sigaltstack call. */ #ifndef _STRUCT_SIGALTSTACK #if __DARWIN_UNIX03 #define _STRUCT_SIGALTSTACK struct __darwin_sigaltstack #else /* !__DARWIN_UNIX03 */ #define _STRUCT_SIGALTSTACK struct sigaltstack #endif /* __DARWIN_UNIX03 */ _STRUCT_SIGALTSTACK { void *ss_sp; /* signal stack base */ __darwin_size_t ss_size; /* signal stack length */ int ss_flags; /* SA_DISABLE and/or SA_ONSTACK */ }; #endif /* _STRUCT_SIGALTSTACK */ #endif /* __need_struct_sigaltstack */ --0016e6567e546fbfa404719c275c Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi,
I have a problem: I'm trying to install on Mac OS qemu user-mod= e, I need it, and so I find out that the only way is correct the wrong part= of the source code of qemu darwin_user, I correct some errors, but now I f= ound out something that I don't undestand:

=A0=A0CC =A0 =A0i386-darwin-user/cpu-exec.o
<= div>/Users/ToNy/Desktop/qemu-0.10.5_prova/cpu-exec.c: In function =91cpu_x8= 6_signal_handler=92:
/Users/ToNy/Desktop/qemu-0.10.5_prova/cpu-ex= ec.c:1182: error: dereferencing pointer to incomplete type
/Users/ToNy/Desktop/qemu-0.10.5_prova/cpu-exec.c:1183: error: derefere= ncing pointer to incomplete type
/Users/ToNy/Desktop/qemu-0.10.5_= prova/cpu-exec.c:1186: error: dereferencing pointer to incomplete type
/Users/ToNy/Desktop/qemu-0.10.5_prova/cpu-exec.c:1187: error: derefere= ncing pointer to incomplete type
make[1]: *** [cpu-exec.o] Error = 1
make: *** [subdir-i386-darwin-user] Error 2

that is this part of code:

#1154# include <sys/ucontext.h>


#1168int cpu_signal_han= dler(int host_signum, void *pinfo,

#1169=A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0#1170{

#1171=A0= =A0 siginfo_t *info =3D pinfo;

#1172=A0= =A0 =A0struct ucontext *uc =3D puc;

#1173=A0=A0 =A0unsigned long pc;

#1174=A0= =A0 =A0int trapno;

#1175

#11= 76#ifndef REG_EIP

#11= 77/* for glibc 2.1 */

#11= 78#define REG_EIP=A0 =A0 EIP

#11= 79#define REG_ERR=A0 =A0 ERR

#11= 80#define REG_TRAPNO TRAPNO

#11= 81#endif

#1182 =A0pc =3D EIP_sig(uc);

#1183=A0= =A0 =A0trapno =3D TRAP_sig(uc);

#1184=A0= =A0 =A0return handle_cpu_signal(pc, (= unsigned long)info->si_addr,

#1185=A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0trapno =3D=3D 0xe ?

#1186=A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0(ERROR_sig(uc) &g= t;> 1) & 1 : 0,

#1187=A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0&uc->uc_si= gmask, puc);


<= p style=3D"margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco">the proble= m may be the ucontext definition=A0of the uc variable,=A0that is defined in= =A0sys= /ucontext.h,=A0that call=A0_structs.h where finally we found the struct:


<= p style=3D"margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco">

#ifdef __need_struct_uco= ntext

#undef __need_str= uct_ucontext

#ifndef _STRUCT_UCONTEXT

#if __DARWIN_UNIX03

#define _STRUCT_UCONTEXT =A0 =A0 = =A0 =A0struct __darwin_ucontext

#else /* !__DARWIN_UNIX0= 3 */

#define _STRUCT_UC= ONTEXT =A0 =A0 =A0 =A0struct ucontext

#endif /* __DARWIN_UNIX03 */

_STRUCT_UCONTEXT

{

=A0=A0 =A0 =A0 =A0int =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 uc_onstack;

=A0=A0 =A0 =A0 =A0__darwin_sigset= _t =A0 =A0 =A0 uc_sigmask; =A0 =A0 /* signal mask used by this context */

=A0=A0 =A0 =A0 =A0_STRUC= T_SIGALTSTACK =A0 =A0 uc_stack; =A0 =A0 =A0 /* stack used by this context *= /

=A0=A0 =A0 =A0 =A0_ST= RUCT_UCONTEXT =A0 =A0 =A0 =A0*uc_link; =A0 =A0 =A0 /* pointer to resuming c= ontext */

=A0=A0 =A0 =A0 =A0__darwin_size_t= =A0 =A0 =A0 =A0 uc_mcsize; =A0 =A0 =A0/* size of the machine context passe= d in */

=A0=A0 =A0 =A0 =A0_STRUC= T_MCONTEXT =A0 =A0 =A0 =A0*uc_mcontext; =A0 /* pointer to machine specific = context */

#ifdef _XOPE= N_SOURCE

=A0=A0 =A0 =A0 =A0_STRUCT_MCONTEX= T =A0 =A0 =A0 =A0__mcontext_data;

#endif /* _XOPEN_SOURCE = */

};

#endif /* _STRUCT_UCONTE= XT */

#endif /* __need_= struct_ucontext */

her= e I found=A0_STRUCT_SIGALTSTACK that gave me the same error in another part= , in that case I resolved the error simply with the declaration of the stru= ct inside the code... but I think that is better now to understand why it g= ives error.


<= p style=3D"margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco">The=A0_STR= UCT_SIGALTSTACK is also declared inside=A0_structs.h:


#ifdef __need_struct_sigaltstack

#undef __need_struct_sig= altstack

/* Structure u= sed in sigaltstack call. */

#ifndef _STRUCT_SIGALTSTACK

#if __DARWIN_UNIX03

#define _STRUCT_SIGALTSTACK =A0 = =A0 struct __darwin_sigaltstack

#else /* !__DARWIN_UNIX0= 3 */

#define _STRUCT_SI= GALTSTACK =A0 =A0 struct sigaltstack

#endif /* __DARWIN_UNIX03 */

_STRUCT_SIGALTSTACK<= /p>

{

=A0=A0 =A0 =A0 =A0void =A0 =A0 =A0 =A0 =A0 =A0*ss_sp; = =A0 =A0 =A0 =A0 /* signal stack base */

=A0=A0 =A0 =A0 =A0__darwin_size_t= ss_size; =A0 =A0 =A0 =A0/* signal stack length */

=A0=A0 =A0 =A0 =A0int = =A0 =A0 =A0 =A0 =A0 =A0 ss_flags; =A0 =A0 =A0 /* SA_DISABLE and/or SA_ONSTA= CK */

};

#endif /* _STRUCT_SIGALTSTACK */<= /font>

#endif /* __need_struct= _sigaltstack */

--0016e6567e546fbfa404719c275c--