- Timestamp:
- May 20, 2008 12:52:26 AM (17 years ago)
- Location:
- trunk/src/VBox/Disassembler
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/Makefile.kmk
r8933 r8937 1 1 # $Id$ 2 2 ## @file 3 # Makefile for the VBox Disassembler.3 # Sub-Makefile for the VBox Disassembler. 4 4 # 5 5 … … 20 20 # 21 21 22 DEPTH = ../../.. 23 include $(KBUILD_PATH)/header.kmk 22 DEPTH ?= ../../.. 23 SUB_DEPTH = . 24 include $(KBUILD_PATH)/subheader.kmk 25 26 # include the sub-makefile first. 27 ifdef VBOX_WITH_TESTCASES 28 include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk 29 endif 24 30 25 31 26 PROGRAMS = tstDisasmCore tstDisasm tstDisasm-2 27 LIBRARIES = DisasmR3 DisasmCoreR3 DisasmGC DisasmR0 28 32 LIBRARIES += DisasmR3 29 33 DisasmR3_TEMPLATE = VBOXR3 34 DisasmR3_DEFS = IN_DIS_R3 30 35 ifeq ($(KBUILD_TARGET),win) 31 36 DisasmR3_CXXFLAGS += -EHa 32 else 33 ifneq ($(KBUILD_TARGET),l4) 37 else ifneq ($(KBUILD_TARGET),l4) 34 38 DisasmR3_CXXFLAGS += -fexceptions 35 endif36 39 endif 37 DisasmR3_SOURCES = Disasm.cpp DisasmCore.cpp DisasmReg.cpp DisasmTables.cpp DisasmTablesX64.cpp 38 DisasmR3_DEFS = IN_DIS_R3 40 DisasmR3_SOURCES = \ 41 Disasm.cpp \ 42 DisasmCore.cpp \ 43 DisasmReg.cpp \ 44 DisasmTables.cpp \ 45 DisasmTablesX64.cpp 39 46 47 LIBRARIES += DisasmCoreR3 40 48 DisasmCoreR3_TEMPLATE = VBOXR3 41 DisasmCoreR3_SOURCES = DisasmCore.cpp DisasmReg.cpp DisasmTables.cpp DisasmTablesX64.cpp42 49 DisasmCoreR3_DEFS = IN_DIS_R3 DIS_CORE_ONLY 50 DisasmCoreR3_SOURCES = \ 51 DisasmCore.cpp \ 52 DisasmReg.cpp \ 53 DisasmTables.cpp \ 54 DisasmTablesX64.cpp 43 55 56 LIBRARIES += DisasmGC 44 57 DisasmGC_TEMPLATE = VBOXGC 45 DisasmGC_SOURCES = DisasmCore.cpp DisasmReg.cpp DisasmTables.cpp DisasmTablesX64.cpp46 58 DisasmGC_DEFS = IN_DIS_GC IN_RT_GC DIS_CORE_ONLY 59 DisasmGC_SOURCES = \ 60 DisasmCore.cpp \ 61 DisasmReg.cpp \ 62 DisasmTables.cpp \ 63 DisasmTablesX64.cpp 47 64 65 LIBRARIES += DisasmR0 48 66 DisasmR0_TEMPLATE = VBOXR0 49 DisasmR0_SOURCES = DisasmCore.cpp DisasmReg.cpp DisasmTables.cpp DisasmTablesX64.cpp50 67 DisasmR0_DEFS = IN_DIS_R0 IN_RT_R0 DIS_CORE_ONLY 51 52 tstDisasm_TEMPLATE = VBOXR3TSTEXE 53 tstDisasm_SOURCES = DisasmTest.cpp DisasmTestA.asm 54 tstDisasm_DEFS = IN_DIS_R3 55 tstDisasm_LIBS = \ 56 $(PATH_LIB)/DisasmR3$(VBOX_SUFF_LIB) \ 57 $(LIB_RUNTIME) 58 59 tstDisasmCore_TEMPLATE = VBOXR3TSTEXE 60 tstDisasmCore_SOURCES = DisasmTestCore.cpp 61 tstDisasmCore_DEFS = IN_DIS_R3 DIS_CORE_ONLY 62 tstDisasmCore_LIBS = \ 63 $(PATH_LIB)/DisasmCoreR3$(VBOX_SUFF_LIB) \ 64 $(LIB_RUNTIME) 65 66 tstDisasm-2_TEMPLATE = VBOXR3TSTEXE 67 tstDisasm-2_SOURCES = testcase/tstDisasm-2.cpp 68 tstDisasm-2_DEFS = IN_DIS_R3 69 tstDisasm-2_LIBS = \ 70 $(PATH_LIB)/DisasmR3$(VBOX_SUFF_LIB) \ 71 $(LIB_RUNTIME) 68 DisasmR0_SOURCES = \ 69 DisasmCore.cpp \ 70 DisasmReg.cpp \ 71 DisasmTables.cpp \ 72 DisasmTablesX64.cpp 72 73 73 74 74 include $(KBUILD_PATH)/footer.kmk 75 ifdef VBOX_WITH_TESTCASES 76 # testcase that hasn't been moved yet. 77 PROGRAMS += tstDisasm 78 tstDisasm_TEMPLATE = VBOXR3TSTEXE 79 tstDisasm_DEFS = IN_DIS_R3 80 tstDisasm_SOURCES = DisasmTest.cpp DisasmTestA.asm 81 tstDisasm_LIBS = \ 82 $(PATH_LIB)/DisasmR3$(VBOX_SUFF_LIB) \ 83 $(LIB_RUNTIME) 75 84 85 PROGRAMS += tstDisasmCore 86 tstDisasmCore_TEMPLATE = VBOXR3TSTEXE 87 tstDisasmCore_DEFS = IN_DIS_R3 DIS_CORE_ONLY 88 tstDisasmCore_SOURCES = DisasmTestCore.cpp 89 tstDisasmCore_LIBS = \ 90 $(PATH_LIB)/DisasmCoreR3$(VBOX_SUFF_LIB) \ 91 $(LIB_RUNTIME) 92 endif # VBOX_WITH_TESTCASES 93 94 95 include $(KBUILD_PATH)/subfooter.kmk 96 -
trunk/src/VBox/Disassembler/testcase/tstAsmLock-1.asm
r8935 r8937 3 3 ; Disassembly testcase - Valid lock sequences and related instructions. 4 4 ; 5 ; The intention is to check in a binary and the disassembler output. 6 ; Both will be recreated and verified during testing. 5 ; This is a build test, that means it will be assembled, disassembled, 6 ; then the disassembly output will be assembled and the new binary will 7 ; compared with the original. 7 8 ; 8 9 … … 23 24 ; 24 25 25 BITS 3226 BITS TEST_BITS 26 27 27 28 ; ADC -
trunk/src/VBox/Disassembler/testcase/tstAsmLock-2.asm
r8935 r8937 23 23 ; 24 24 25 BITS 3225 BITS TEST_BITS 26 26 27 27 ; ADC -
trunk/src/VBox/Disassembler/testcase/tstAsmLock-3.asm
r8935 r8937 23 23 ; 24 24 25 BITS 3225 BITS TEST_BITS 26 26 27 27 lock mov ebp, esp … … 39 39 lock mov [ebx], dl 40 40 lock ret 41 %if TEST_BITS != 64 41 42 lock pop ebp 42 43 lock push esp 44 %else 45 lock pop rbp 46 lock push rsp 47 %endif 43 48 -
trunk/src/VBox/Disassembler/testcase/tstDisasm-2.cpp
r8935 r8937 72 72 static void MyDisasYasmFormatter(PMYDISSTATE pState) 73 73 { 74 RTPrintf("yasm not implemented: %s", pState->szLine); 74 /* a very quick hack. */ 75 char szTmp[256]; 76 strcpy(szTmp, RTStrStripL(strchr(pState->szLine, ':') + 1)); 77 78 char *psz = strrchr(szTmp, '['); 79 *psz = '\0'; 80 RTStrStripR(szTmp); 81 82 psz = strstr(szTmp, " ptr "); 83 if (psz) 84 memset(psz, ' ', 5); 85 86 char *pszEnd = strchr(szTmp, '\0'); 87 while (pszEnd - &szTmp[0] < 71) 88 *pszEnd++ = ' '; 89 *pszEnd = '\0'; 90 91 RTPrintf(" %s ; %s", szTmp, pState->szLine); 75 92 } 76 93 … … 223 240 224 241 case kAsmStyle_yasm: 242 RTPrintf(" BITS %d\n", enmCpuMode == CPUMODE_16BIT ? 16 : enmCpuMode == CPUMODE_32BIT ? 32 : 64); 225 243 pfnFormatter = MyDisasYasmFormatter; 226 244 break; … … 257 275 else 258 276 { 259 RTPrintf("%s: error at %#RX64: unexpected valid instruction \n", argv0, State.uAddress);277 RTPrintf("%s: error at %#RX64: unexpected valid instruction (op=%d)\n", argv0, State.uAddress, State.Cpu.pCurInstr->opcode); 260 278 pfnFormatter(&State); 261 279 rcRet = VERR_GENERAL_FAILURE; … … 325 343 { 326 344 RTR3Init(); 345 const char * const argv0 = RTPathFilename(argv[0]); 327 346 328 347 /* options */ … … 378 397 else 379 398 { 380 RTStrmPrintf(g_pStdErr, "%s: Invalid CPU mode value %RU32\n", argv [0], ValueUnion.u32);399 RTStrmPrintf(g_pStdErr, "%s: Invalid CPU mode value %RU32\n", argv0, ValueUnion.u32); 381 400 return 1; 382 401 } … … 384 403 385 404 case 'h': 386 return Usage(argv [0]);405 return Usage(argv0); 387 406 388 407 case 'i': … … 418 437 { 419 438 enmStyle = kAsmStyle_masm; 420 RTStrmPrintf(g_pStdErr, "%s: masm style isn't implemented yet\n", argv [0]);439 RTStrmPrintf(g_pStdErr, "%s: masm style isn't implemented yet\n", argv0); 421 440 return 1; 422 441 } 423 442 else 424 443 { 425 RTStrmPrintf(g_pStdErr, "%s: unknown assembly style: %s\n", argv [0], ValueUnion.psz);444 RTStrmPrintf(g_pStdErr, "%s: unknown assembly style: %s\n", argv0, ValueUnion.psz); 426 445 return 1; 427 446 } … … 429 448 430 449 default: 431 RTStrmPrintf(g_pStdErr, "%s: syntax error: %Rrc\n", argv [0], ch);450 RTStrmPrintf(g_pStdErr, "%s: syntax error: %Rrc\n", argv0, ch); 432 451 return 1; 433 452 } 434 453 } 435 454 if (iArg >= argc) 436 return Usage(argv [0]);455 return Usage(argv0); 437 456 438 457 /* … … 450 469 if (RT_FAILURE(rc)) 451 470 { 452 RTStrmPrintf(g_pStdErr, "%s: %s: %Rrc\n", argv [0], argv[iArg], rc);471 RTStrmPrintf(g_pStdErr, "%s: %s: %Rrc\n", argv0, argv[iArg], rc); 453 472 break; 454 473 } … … 457 476 * Disassemble it. 458 477 */ 459 rc = MyDisasmBlock(argv [0], enmCpuMode, uAddress, (uint8_t *)pvFile, cbFile, enmStyle, fListing, fRaw, fAllInvalid);478 rc = MyDisasmBlock(argv0, enmCpuMode, uAddress, (uint8_t *)pvFile, cbFile, enmStyle, fListing, fRaw, fAllInvalid); 460 479 if (RT_FAILURE(rc)) 461 480 break;
Note:
See TracChangeset
for help on using the changeset viewer.