VirtualBox

Changeset 918 in vbox


Ignore:
Timestamp:
Feb 15, 2007 3:30:26 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
18646
Message:

reproduce the EMAll.cpp relocation issue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstLdrDisasmTest.cpp

    r916 r918  
    3434#include <iprt/string.h>
    3535
    36 #if 0 && defined(IN_RING0)
     36#if defined(IN_RING0) && !defined(__WIN__) && !defined(__OS2__) /* Too lazy to make import libs. */
    3737extern "C" DECLIMPORT(int) MyPrintf(const char *pszFormat, ...);
    3838# define MY_PRINTF(a) MyPrintf a
     
    7575
    7676
    77 
    7877DECLCALLBACK(int32_t) DisasmTest1ReadCode(RTUINTPTR SrcAddr, uint8_t *pbDst, uint32_t cb, RTUINTPTR uUser)
    7978{
     
    9089
    9190
     91/*
     92 * Use an inline function here just to test '__textcoal_nt' sections on darwin.
     93 */
     94inline int MyDisasm(uintptr_t CodeIndex, PDISCPUSTATE pCpu, uint32_t *pcb)
     95{
     96    uint32_t cb;
     97    int rc = DISCoreOneEx(CodeIndex, CPUMODE_32BIT, DisasmTest1ReadCode, 0, pCpu, &cb);
     98    *pcb = cb;
     99    MY_PRINTF(("DISCoreOneEx -> rc=%d cb=%d  Cpu: opcode=%#x pCurInstr=%p (42=%d)\n", \
     100               rc, cb, pCpu->opcode, pCpu->pCurInstr, 42)); \
     101    return rc;
     102}
     103
     104
    92105extern "C" DECLEXPORT(int) DisasmTest1(void)
    93106{
     
    96109    uint32_t cb;
    97110    int rc;
     111    MY_PRINTF(("DisasmTest1: %p\n", &DisasmTest1));
     112
    98113#define DISAS_AND_CHECK(cbInstr, enmOp) \
    99114        do { \
    100             rc = DISCoreOneEx(CodeIndex, CPUMODE_32BIT, DisasmTest1ReadCode, 0, &Cpu, &cb); \
    101             MY_PRINTF(("%d: rc=%d cb=%d Cpu: opcode=%#x pCurInstr=%p pfnReadBytes=%p (42=42)\n", \
    102                        __LINE__, rc, cb, Cpu.opcode, Cpu.pCurInstr, Cpu.pfnReadBytes, 42)); \
     115            rc = MyDisasm(CodeIndex, &Cpu, &cb); \
    103116            if (RT_FAILURE(rc)) \
    104117                return CodeIndex | 0xf000; \
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette