Changeset 32992 in vbox for trunk/src/VBox/Disassembler/testcase
- Timestamp:
- Oct 7, 2010 10:54:44 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/testcase/tstDisasm-2.cpp
r28800 r32992 584 584 * 585 585 * @returns VBox status code. 586 * @param argv0 Program name (for errors and warnings). 587 * @param enmCpuMode The cpu mode to disassemble in. 588 * @param uAddress The address we're starting to disassemble at. 589 * @param pbFile Where to start disassemble. 590 * @param cbFile How much to disassemble. 591 * @param enmStyle The assembly output style. 592 * @param fListing Whether to print in a listing like mode. 593 * @param enmUndefOp How to deal with undefined opcodes. 586 * @param argv0 Program name (for errors and warnings). 587 * @param enmCpuMode The cpu mode to disassemble in. 588 * @param uAddress The address we're starting to disassemble at. 589 * @param uHighlightAddr The address of the instruction that should be 590 * highlighted. Pass UINT64_MAX to keep quiet. 591 * @param pbFile Where to start disassemble. 592 * @param cbFile How much to disassemble. 593 * @param enmStyle The assembly output style. 594 * @param fListing Whether to print in a listing like mode. 595 * @param enmUndefOp How to deal with undefined opcodes. 594 596 */ 595 static int MyDisasmBlock(const char *argv0, DISCPUMODE enmCpuMode, uint64_t uAddress, uint8_t *pbFile, size_t cbFile, 597 static int MyDisasmBlock(const char *argv0, DISCPUMODE enmCpuMode, uint64_t uAddress, 598 uint64_t uHighlightAddr, uint8_t *pbFile, size_t cbFile, 596 599 ASMSTYLE enmStyle, bool fListing, UNDEFOPHANDLING enmUndefOp) 597 600 { … … 717 720 } 718 721 722 /* Highlight this instruction? */ 723 if (uHighlightAddr - State.uAddress < State.cbInstr) 724 RTPrintf("; ^^^^^^^^^^^^^^^^^^^^^\n"); 719 725 720 726 /* next */ … … 804 810 /* options */ 805 811 uint64_t uAddress = 0; 812 uint64_t uHighlightAddr = UINT64_MAX; 806 813 ASMSTYLE enmStyle = kAsmStyle_Default; 807 814 UNDEFOPHANDLING enmUndefOp = kUndefOp_Fail; … … 933 940 for ( ; iArg < argc; iArg++) 934 941 { 942 char ch2; 935 943 const char *psz = argv[iArg]; 936 944 while (*psz) 937 945 { 938 946 /** @todo this stuff belongs in IPRT, same stuff as mac address reading. Could be reused for IPv6 with a different item size.*/ 939 /* skip white space */ 940 while (RT_C_IS_SPACE(*psz)) 947 /* skip white space, and for the benfit of linux panics '<' and '>'. */ 948 while (RT_C_IS_SPACE(ch2 = *psz) || ch2 == '<' || ch2 == '>') 949 { 950 if (ch2 == '<') 951 uHighlightAddr = uAddress + cb; 941 952 psz++; 942 if (!*psz) 953 } 954 if (!ch2) 943 955 break; 944 956 … … 947 959 if (iNum == -1) 948 960 return 1; 949 if (!RT_C_IS_SPACE( *psz) && *psz)961 if (!RT_C_IS_SPACE(ch2 = *psz) && ch2 != '\0' && ch2 != '>') 950 962 { 951 963 int iDigit = HexDigitToNum(*psz++); … … 972 984 * Disassemble it. 973 985 */ 974 rc = MyDisasmBlock(argv0, enmCpuMode, uAddress, pb, cb, enmStyle, fListing, enmUndefOp);986 rc = MyDisasmBlock(argv0, enmCpuMode, uAddress, uHighlightAddr, pb, cb, enmStyle, fListing, enmUndefOp); 975 987 } 976 988 else … … 996 1008 * Disassemble it. 997 1009 */ 998 rc = MyDisasmBlock(argv0, enmCpuMode, uAddress, (uint8_t *)pvFile, cbFile, enmStyle, fListing, enmUndefOp);1010 rc = MyDisasmBlock(argv0, enmCpuMode, uAddress, uHighlightAddr, (uint8_t *)pvFile, cbFile, enmStyle, fListing, enmUndefOp); 999 1011 if (RT_FAILURE(rc)) 1000 1012 break;
Note:
See TracChangeset
for help on using the changeset viewer.