tstX86-1.cpp revision 45c462a65387ada09a80826a8413c53e229b15f6
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync * X86 instruction set exploration/testcase #1.
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync * Copyright (C) 2011-2012 Oracle Corporation
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync * available from http://www.virtualbox.org. This file is free software;
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync * you can redistribute it and/or modify it under the terms of the GNU
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync * General Public License (GPL) as published by the Free Software
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync/*******************************************************************************
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync* Header Files *
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync*******************************************************************************/
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync/*******************************************************************************
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync* Structures and Typedefs *
db4e05173041f696b1362c454bbf7e3a41fbe955vboxsync*******************************************************************************/
db4e05173041f696b1362c454bbf7e3a41fbe955vboxsynctypedef struct TRAPINFO
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync/*******************************************************************************
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync* Global Variables *
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync*******************************************************************************/
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync/*******************************************************************************
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync* Internal Functions *
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync*******************************************************************************/
db4e05173041f696b1362c454bbf7e3a41fbe955vboxsyncstatic PCTRAPINFO findTrapInfo(uintptr_t uTrapPC, uintptr_t uTrapSP)
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync /* Search by trap program counter. */
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync /* Search by return address. */
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsync if (g_aTrapInfo[i].uTrapPC + g_aTrapInfo[i].cbInstr == uReturn)
68e0b366071a6dd88182866e8852ec5ec90a8b66vboxsyncstatic void sigHandler(int iSig, siginfo_t *pSigInfo, void *pvSigCtx)
if (pTrapInfo)
int main()
return rcExit;
RTTESTI_CHECK_RC(RTMemProtect(g_pbEfExecPage + PAGE_SIZE, PAGE_SIZE, RTMEM_PROT_NONE), VINF_SUCCESS);
#ifdef USE_SIGNAL
if (rc != 0)
if (rc != 0)
if (rc != 0)
if (rc != 0)
if (rc != 0)
if (rc != 0)