VirtualBox

Changeset 98842 in vbox


Ignore:
Timestamp:
Mar 6, 2023 5:14:45 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156165
Message:

VMM/IEM,ValKit: Require explicit instruction file loading call for IEMAllInstructionsPython.py. bugref:10369

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py

    r98103 r98842  
    1010disassembler tables and tests.
    1111"""
     12
     13from __future__ import print_function;
    1214
    1315__copyright__ = \
     
    16001602
    16011603        # The /r form:
    1602         if len(sOpcode) == 4 and sOpcode.startswith('/') and sOpcode[-1].isdigit():
    1603             return int(sOpcode[-1:]) << 3;
     1604        if len(sOpcode) == 2 and sOpcode[0] == '/' and sOpcode[1].isdigit():
     1605            return int(sOpcode[1:]) << 3;
    16041606
    16051607        # The 11/r form:
     
    36453647    return 0;
    36463648
    3647 def __parseAll():
     3649## List of all main instruction files and their default maps.
     3650g_aasAllInstrFilesAndDefaultMap = (
     3651    ( 'IEMAllInstructionsOneByte.cpp.h',   'one',        ),
     3652    ( 'IEMAllInstructionsTwoByte0f.cpp.h', 'two0f',      ),
     3653    ( 'IEMAllInstructionsThree0f38.cpp.h', 'three0f38',  ),
     3654    ( 'IEMAllInstructionsThree0f3a.cpp.h', 'three0f3a',  ),
     3655    ( 'IEMAllInstructionsVexMap1.cpp.h',   'vexmap1',    ),
     3656    ( 'IEMAllInstructionsVexMap2.cpp.h',   'vexmap2',    ),
     3657    ( 'IEMAllInstructionsVexMap3.cpp.h',   'vexmap3',    ),
     3658    ( 'IEMAllInstructions3DNow.cpp.h',     '3dnow',      ),
     3659);
     3660
     3661def parseAll():
    36483662    """
    36493663    Parses all the IEMAllInstruction*.cpp.h files.
     
    36533667    sSrcDir = os.path.dirname(os.path.abspath(__file__));
    36543668    cErrors = 0;
    3655     for sDefaultMap, sName in [
    3656         ( 'one',        'IEMAllInstructionsOneByte.cpp.h'),
    3657         ( 'two0f',      'IEMAllInstructionsTwoByte0f.cpp.h'),
    3658         ( 'three0f38',  'IEMAllInstructionsThree0f38.cpp.h'),
    3659         ( 'three0f3a',  'IEMAllInstructionsThree0f3a.cpp.h'),
    3660         ( 'vexmap1',    'IEMAllInstructionsVexMap1.cpp.h'),
    3661         ( 'vexmap2',    'IEMAllInstructionsVexMap2.cpp.h'),
    3662         ( 'vexmap3',    'IEMAllInstructionsVexMap3.cpp.h'),
    3663         ( '3dnow',      'IEMAllInstructions3DNow.cpp.h'),
    3664     ]:
     3669    for sName, sDefaultMap in g_aasAllInstrFilesAndDefaultMap:
    36653670        cErrors += __parseFileByName(os.path.join(sSrcDir, sName), sDefaultMap);
    36663671    cErrors += __doTestCopying();
     
    36753680
    36763681    if cErrors != 0:
    3677         #raise Exception('%d parse errors' % (cErrors,));
    3678         sys.exit(1);
     3682        raise Exception('%d parse errors' % (cErrors,));
    36793683    return True;
    36803684
    3681 
    3682 
    3683 __parseAll();
    36843685
    36853686
     
    37183719    elif oInstr.sEncoding == 'ModR/M':
    37193720        # ASSUME the first operand is using the ModR/M encoding
    3720         assert len(oInstr.aoOperands) >= 1 and oInstr.aoOperands[0].usesModRM();
     3721        assert len(oInstr.aoOperands) >= 1 and oInstr.aoOperands[0].usesModRM(), "oInstr=%s" % (oInstr,);
    37213722        asColumns.append('IDX_ParseModRM,');
    37223723    elif oInstr.sEncoding in [ 'prefix', ]:
     
    38373838    """
    38383839    Generates disassembler tables.
     3840
     3841    Returns exit code.
    38393842    """
     3843
     3844    #
     3845    # Parse all.
     3846    #
     3847    try:
     3848        parseAll();
     3849    except Exception as oXcpt:
     3850        print('error: parseAll failed: %s' % (oXcpt,), file = sys.stderr);
     3851        return 1;
     3852
    38403853
    38413854    #
     
    39483961        oDstFile.write('\n');
    39493962        #break; #for now
     3963    return 0;
    39503964
    39513965if __name__ == '__main__':
    3952     generateDisassemblerTables();
    3953 
     3966    sys.exit(generateDisassemblerTables());
     3967
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-data.py

    r98107 r98842  
    452452        Returns success indicator.
    453453        """
     454
     455        #
     456        # Do the parsing.
     457        #
     458        try:
     459            iai.parseAll();
     460        except Exception as oXcpt:
     461            print('error: parseAll failed: %s' % (oXcpt,), file = sys.stderr);
     462            return False;
    454463
    455464        #
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