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

Re: Porting valgrind to Debian/kFreeBSD



On Thu, Mar 07, 2013 at 05:49:55PM +0100, Petr Salinger wrote:
> >>Valgrind does appear to be aware of sysarch, implementing
> >>sysarch(AMD64_SET_FSBASE) in
> >>coregrind/m_syswrap/syswrap-amd64-freebsd.c.
> >
> >Aha.  eglibc is testing that the syscall succeeds, which is indicated by
> >setting RAX to 0.
> 
> The standard kernel in a success case sets RAX to zero
> and clears carry flag. In error case the carry flag is set
> and RAX contains error number.
> 
> It probably should be
> 
> SET_STATUS_Success2((0L, tst->arch.vex.guest_RDX );

As you suggest, this change also works (replacement of my earlier change, not
cumulative with it):

-      SET_STATUS_Success2((ULong)*p, tst->arch.vex.guest_RDX );
+      SET_STATUS_Success2(0, tst->arch.vex.guest_RDX );

Jeff


Reply to: