diff options
| author | Michael Meskes <meskes@debian.org> | 2011-01-20 11:21:45 +0100 |
|---|---|---|
| committer | Michael Meskes <meskes@debian.org> | 2011-01-20 11:21:45 +0100 |
| commit | 14ee89c73b263c9a9e6e5bd300ef05c1ed41742a (patch) | |
| tree | ba2010adc07bd73710310b25adb8428ea866e067 /src/VBox/Disassembler | |
| parent | 361589e3ae692db27161410309b92c6b89e1ec6c (diff) | |
| download | virtualbox-14ee89c73b263c9a9e6e5bd300ef05c1ed41742a.tar.gz | |
Imported Upstream version 4.0.2-dfsgupstream/4.0.2-dfsg
Diffstat (limited to 'src/VBox/Disassembler')
| -rw-r--r-- | src/VBox/Disassembler/DisasmCore.cpp | 1 | ||||
| -rw-r--r-- | src/VBox/Disassembler/DisasmReg.cpp | 2 | ||||
| -rw-r--r-- | src/VBox/Disassembler/DisasmTestA.asm | 11 | ||||
| -rw-r--r-- | src/VBox/Disassembler/testcase/Makefile.kmk | 28 | ||||
| -rw-r--r-- | src/VBox/Disassembler/testcase/tstAsmFnstsw-1.asm | 21 | ||||
| -rw-r--r-- | src/VBox/Disassembler/testcase/tstAsmMovSeg-1.asm | 21 | ||||
| -rw-r--r-- | src/VBox/Disassembler/testcase/tstAsmMovzx-1.asm | 21 | ||||
| -rw-r--r-- | src/VBox/Disassembler/testcase/tstAsmPop-1.asm | 21 | ||||
| -rw-r--r-- | src/VBox/Disassembler/testcase/tstAsmPush-1.asm | 21 | ||||
| -rw-r--r-- | src/VBox/Disassembler/testcase/tstAsmSignExtend-1.asm | 21 |
10 files changed, 147 insertions, 21 deletions
diff --git a/src/VBox/Disassembler/DisasmCore.cpp b/src/VBox/Disassembler/DisasmCore.cpp index 038ef9469..869627862 100644 --- a/src/VBox/Disassembler/DisasmCore.cpp +++ b/src/VBox/Disassembler/DisasmCore.cpp @@ -27,7 +27,6 @@ #include <VBox/dis.h> #include <VBox/disopcode.h> -#include <VBox/cpum.h> #include <VBox/err.h> #include <VBox/log.h> #include <iprt/assert.h> diff --git a/src/VBox/Disassembler/DisasmReg.cpp b/src/VBox/Disassembler/DisasmReg.cpp index 20e712c5f..41e484d6f 100644 --- a/src/VBox/Disassembler/DisasmReg.cpp +++ b/src/VBox/Disassembler/DisasmReg.cpp @@ -27,9 +27,9 @@ #include <VBox/dis.h> #include <VBox/disopcode.h> -#include <VBox/cpum.h> #include <VBox/err.h> #include <VBox/log.h> +#include <VBox/vmm/cpum.h> #include <iprt/assert.h> #include <iprt/string.h> #include <iprt/stdarg.h> diff --git a/src/VBox/Disassembler/DisasmTestA.asm b/src/VBox/Disassembler/DisasmTestA.asm index a242d8073..20cc30231 100644 --- a/src/VBox/Disassembler/DisasmTestA.asm +++ b/src/VBox/Disassembler/DisasmTestA.asm @@ -1,9 +1,10 @@ +; $Id: DisasmTestA.asm 35346 2010-12-27 16:13:13Z vboxsync $ +;; @file +; VBox disassembler: Assembler test routines ; -; VBox disassembler: -; Assembler test routines ; -; Copyright (C) 2006-2007 Oracle Corporation +; Copyright (C) 2006-2010 Oracle Corporation ; ; This file is part of VirtualBox Open Source Edition (OSE), as ; available from http://www.virtualbox.org. This file is free software; @@ -18,9 +19,9 @@ ;* Header Files * ;******************************************************************************* %include "VBox/nasm.mac" -%include "VBox/vm.mac" +%include "VBox/vmm/vm.mac" %include "VBox/err.mac" -%include "VBox/stam.mac" +%include "VBox/vmm/stam.mac" %include "VBox/x86.mac" BITS 32 diff --git a/src/VBox/Disassembler/testcase/Makefile.kmk b/src/VBox/Disassembler/testcase/Makefile.kmk index f5eaffd27..38ac657f4 100644 --- a/src/VBox/Disassembler/testcase/Makefile.kmk +++ b/src/VBox/Disassembler/testcase/Makefile.kmk @@ -1,4 +1,4 @@ -# $Id: Makefile.kmk 28800 2010-04-27 08:22:32Z vboxsync $ +# $Id: Makefile.kmk 35381 2010-12-30 16:12:47Z vboxsync $ ## @file # Sub-Makefile for the VBox Disassembler. # @@ -76,15 +76,15 @@ VBOX_DISAS_TEST_CLEAN += $(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/,\ $(VBOX_DISAS_TESTS_BIN:.asm=-32.bin)\ $(VBOX_DISAS_TESTS_BIN:.asm=-64.bin)) -$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BIN:.asm=-16.bin)): $(PATH_SUB_CURRENT)/$$(patsubst %-16.bin,%.asm,$$(notdir $$(@))) | $$(call DIRDEP,$$(@D)) +$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BIN:.asm=-16.bin)): $(PATH_SUB_CURRENT)/$$(patsubst %-16.bin,%.asm,$$(notdir $$(@))) | $$(dir $$@) @$(ECHO) "Assembling: $(<F) into $(@F)" $(TOOL_YASM_AS) -f bin -a x86 --force-strict -DTEST_BITS=16 -o $@ $< -$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BIN:.asm=-32.bin)): $(PATH_SUB_CURRENT)/$$(patsubst %-32.bin,%.asm,$$(notdir $$(@))) | $$(call DIRDEP,$$(@D)) +$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BIN:.asm=-32.bin)): $(PATH_SUB_CURRENT)/$$(patsubst %-32.bin,%.asm,$$(notdir $$(@))) | $$(dir $$@) @$(ECHO) "Assembling: $(<F) into $(@F)" $(TOOL_YASM_AS) -f bin -a x86 --force-strict -DTEST_BITS=32 -o $@ $< -$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BIN:.asm=-64.bin)): $(PATH_SUB_CURRENT)/$$(patsubst %-64.bin,%.asm,$$(notdir $$(@))) | $$(call DIRDEP,$$(@D)) +$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BIN:.asm=-64.bin)): $(PATH_SUB_CURRENT)/$$(patsubst %-64.bin,%.asm,$$(notdir $$(@))) | $$(dir $$@) @$(ECHO) "Assembling: $(<F) into $(@F)" $(TOOL_YASM_AS) -f bin -a x86 --force-strict -DTEST_BITS=64 -o $@ $< @@ -95,15 +95,15 @@ VBOX_DISAS_TEST_CLEAN += $(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/,\ $(VBOX_DISAS_TESTS_BUILD:.asm=-32-disas.asm)\ $(VBOX_DISAS_TESTS_BUILD:.asm=-64-disas.asm)) -$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-16-disas.asm)): $$(subst -disas.asm,.bin,$$@) $$(INSTARGET_tstDisasm-2) | $$(call DIRDEP,$$(@D)) +$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-16-disas.asm)): $$(subst -disas.asm,.bin,$$@) $$(INSTARGET_tstDisasm-2) | $$(dir $$@) @$(ECHO) "Generating: $(@F) from $(<F)" $(REDIRECT) -E VBOX_LOG_DEST=nofile -o $@ -- $(INSTARGET_tstDisasm-2) --style=yasm --cpumode=16 $< -$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-32-disas.asm)): $$(subst -disas.asm,.bin,$$@) $$(INSTARGET_tstDisasm-2) | $$(call DIRDEP,$$(@D)) +$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-32-disas.asm)): $$(subst -disas.asm,.bin,$$@) $$(INSTARGET_tstDisasm-2) | $$(dir $$@) @$(ECHO) "Generating: $(@F) from $(<F)" $(REDIRECT) -E VBOX_LOG_DEST=nofile -o $@ -- $(INSTARGET_tstDisasm-2) --style=yasm --cpumode=32 $< -$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-64-disas.asm)): $$(subst -disas.asm,.bin,$$@) $$(INSTARGET_tstDisasm-2) | $$(call DIRDEP,$$(@D)) +$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-64-disas.asm)): $$(subst -disas.asm,.bin,$$@) $$(INSTARGET_tstDisasm-2) | $$(dir $$@) @$(ECHO) "Generating: $(@F) from $(<F)" $(REDIRECT) -E VBOX_LOG_DEST=nofile -o $@ -- $(INSTARGET_tstDisasm-2) --style=yasm --cpumode=64 $< @@ -113,15 +113,15 @@ VBOX_DISAS_TEST_CLEAN += $(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/,\ $(VBOX_DISAS_TESTS_BUILD:.asm=-32-disas.bin)\ $(VBOX_DISAS_TESTS_BUILD:.asm=-64-disas.bin)) -$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-16-disas.bin)): $$(subst .bin,.asm,$$@) | $$(call DIRDEP,$$(@D)) +$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-16-disas.bin)): $$(subst .bin,.asm,$$@) | $$(dir $$@) @$(ECHO) "Re-assembling: $(<F) into $(@F)" $(TOOL_YASM_AS) -f bin -a x86 --force-strict -DTEST_BITS=16 -o $@ $< -$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-32-disas.bin)): $$(subst .bin,.asm,$$@) | $$(call DIRDEP,$$(@D)) +$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-32-disas.bin)): $$(subst .bin,.asm,$$@) | $$(dir $$@) @$(ECHO) "Re-assembling: $(<F) into $(@F)" $(TOOL_YASM_AS) -f bin -a x86 --force-strict -DTEST_BITS=32 -o $@ $< -$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-64-disas.bin)): $$(subst .bin,.asm,$$@) | $$(call DIRDEP,$$(@D)) +$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-64-disas.bin)): $$(subst .bin,.asm,$$@) | $$(dir $$@) @$(ECHO) "Re-assembling: $(<F) into $(@F)" $(TOOL_YASM_AS) -f bin -a x86 --force-strict -DTEST_BITS=64 -o $@ $< @@ -130,7 +130,7 @@ VBOX_DISAS_TESTS += $(foreach test, $(VBOX_DISAS_TESTS_BUILD:.asm=), $(test)-16. $(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/,\ $(VBOX_DISAS_TESTS_BUILD:.asm=-16.tst)\ $(VBOX_DISAS_TESTS_BUILD:.asm=-32.tst)\ -$(VBOX_DISAS_TESTS_BUILD:.asm=-64.tst) ): $$(subst .tst,-disas.bin,$$@) | $$(call DIRDEP,$$(@D)) +$(VBOX_DISAS_TESTS_BUILD:.asm=-64.tst) ): $$(subst .tst,-disas.bin,$$@) | $$(dir $$@) @$(ECHO) "Verifying build: $(<F) and $(@F:.tst=.bin)" @$(RM) -f $@ $(CMP) $(@:.tst=.bin) $< @@ -142,21 +142,21 @@ $(VBOX_DISAS_TESTS_BUILD:.asm=-64.tst) ): $$(subst .tst,-disas.bin,$$@) | $$(cal # Generate the rules for the 'invalid' tests. VBOX_DISAS_TESTS += $(foreach test, $(VBOX_DISAS_TESTS_INVALID:.asm=), $(test)-16.tst $(test)-32.tst $(test)-64.tst) -$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_INVALID:.asm=-16.tst)): $$(patsubst %.tst,%.bin,$$@) $$(INSTARGET_tstDisasm-2) | $$(call DIRDEP,$$(@D)) +$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_INVALID:.asm=-16.tst)): $$(patsubst %.tst,%.bin,$$@) $$(INSTARGET_tstDisasm-2) | $$(dir $$@) @$(ECHO) "TESTING: $(@F) [--undef-op=all]" @$(RM) -f $@ $(REDIRECT) -E VBOX_LOG_DEST=nofile -- $(INSTARGET_tstDisasm-2) --undef-op=all --cpumode=16 $< @$(APPEND) $@ "done" @$(ECHO) " PASSED: $(@F) [--undef-op=all]" -$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_INVALID:.asm=-32.tst)): $$(patsubst %.tst,%.bin,$$@) $$(INSTARGET_tstDisasm-2) | $$(call DIRDEP,$$(@D)) +$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_INVALID:.asm=-32.tst)): $$(patsubst %.tst,%.bin,$$@) $$(INSTARGET_tstDisasm-2) | $$(dir $$@) @$(ECHO) "TESTING: $(@F) [--undef-op=all]" @$(RM) -f $@ $(REDIRECT) -E VBOX_LOG_DEST=nofile -- $(INSTARGET_tstDisasm-2) --undef-op=all --cpumode=32 $< @$(APPEND) $@ "done" @$(ECHO) " PASSED: $(@F) [--undef-op=all]" -$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_INVALID:.asm=-64.tst)): $$(patsubst %.tst,%.bin,$$@) $$(INSTARGET_tstDisasm-2) | $$(call DIRDEP,$$(@D)) +$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_INVALID:.asm=-64.tst)): $$(patsubst %.tst,%.bin,$$@) $$(INSTARGET_tstDisasm-2) | $$(dir $$@) @$(ECHO) "TESTING: $(@F) [--undef-op=all]" @$(RM) -f $@ $(REDIRECT) -E VBOX_LOG_DEST=nofile -- $(INSTARGET_tstDisasm-2) --undef-op=all --cpumode=64 $< diff --git a/src/VBox/Disassembler/testcase/tstAsmFnstsw-1.asm b/src/VBox/Disassembler/testcase/tstAsmFnstsw-1.asm index 7530ef3fe..61662310b 100644 --- a/src/VBox/Disassembler/testcase/tstAsmFnstsw-1.asm +++ b/src/VBox/Disassembler/testcase/tstAsmFnstsw-1.asm @@ -1,3 +1,24 @@ +; $Id: tstAsmLock-1.asm 60692 2010-04-27 08:22:32Z umoeller $ +;; @file +; Disassembly testcase - Valid fnstsw* instructitons. +; +; This is a build test, that means it will be assembled, disassembled, +; then the disassembly output will be assembled and the new binary will +; compared with the original. +; + +; +; Copyright (C) 2008-2011 Oracle Corporation +; +; This file is part of VirtualBox Open Source Edition (OSE), as +; available from http://www.virtualbox.org. This file is free software; +; you can redistribute it and/or modify it under the terms of the GNU +; General Public License (GPL) as published by the Free Software +; Foundation, in version 2 as it comes in the "COPYING" file of the +; VirtualBox OSE distribution. VirtualBox OSE is distributed in the +; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +; + %include "tstAsm.mac" BITS TEST_BITS diff --git a/src/VBox/Disassembler/testcase/tstAsmMovSeg-1.asm b/src/VBox/Disassembler/testcase/tstAsmMovSeg-1.asm index dc427c63e..5a4888822 100644 --- a/src/VBox/Disassembler/testcase/tstAsmMovSeg-1.asm +++ b/src/VBox/Disassembler/testcase/tstAsmMovSeg-1.asm @@ -1,3 +1,24 @@ +; $Id: tstAsmMovSeg-1.asm 35474 2011-01-11 09:08:30Z vboxsync $ +;; @file +; Disassembly testcase - Valid mov from/to segment instructions. +; +; This is a build test, that means it will be assembled, disassembled, +; then the disassembly output will be assembled and the new binary will +; compared with the original. +; + +; +; Copyright (C) 2008-2011 Oracle Corporation +; +; This file is part of VirtualBox Open Source Edition (OSE), as +; available from http://www.virtualbox.org. This file is free software; +; you can redistribute it and/or modify it under the terms of the GNU +; General Public License (GPL) as published by the Free Software +; Foundation, in version 2 as it comes in the "COPYING" file of the +; VirtualBox OSE distribution. VirtualBox OSE is distributed in the +; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +; + BITS TEST_BITS mov fs, eax diff --git a/src/VBox/Disassembler/testcase/tstAsmMovzx-1.asm b/src/VBox/Disassembler/testcase/tstAsmMovzx-1.asm index e114950eb..0cb415658 100644 --- a/src/VBox/Disassembler/testcase/tstAsmMovzx-1.asm +++ b/src/VBox/Disassembler/testcase/tstAsmMovzx-1.asm @@ -1,3 +1,24 @@ +; $Id: tstAsmMovzx-1.asm 35474 2011-01-11 09:08:30Z vboxsync $ +;; @file +; Disassembly testcase - Valid movzx sequences and related instructions. +; +; This is a build test, that means it will be assembled, disassembled, +; then the disassembly output will be assembled and the new binary will +; compared with the original. +; + +; +; Copyright (C) 2008-2011 Oracle Corporation +; +; This file is part of VirtualBox Open Source Edition (OSE), as +; available from http://www.virtualbox.org. This file is free software; +; you can redistribute it and/or modify it under the terms of the GNU +; General Public License (GPL) as published by the Free Software +; Foundation, in version 2 as it comes in the "COPYING" file of the +; VirtualBox OSE distribution. VirtualBox OSE is distributed in the +; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +; + BITS TEST_BITS movzx ax, al diff --git a/src/VBox/Disassembler/testcase/tstAsmPop-1.asm b/src/VBox/Disassembler/testcase/tstAsmPop-1.asm index 9e8cb458d..f1af94b92 100644 --- a/src/VBox/Disassembler/testcase/tstAsmPop-1.asm +++ b/src/VBox/Disassembler/testcase/tstAsmPop-1.asm @@ -1,3 +1,24 @@ +; $Id: tstAsmPop-1.asm 35474 2011-01-11 09:08:30Z vboxsync $ +;; @file +; Disassembly testcase - Valid pop sequences and related instructions. +; +; This is a build test, that means it will be assembled, disassembled, +; then the disassembly output will be assembled and the new binary will +; compared with the original. +; + +; +; Copyright (C) 2008-2011 Oracle Corporation +; +; This file is part of VirtualBox Open Source Edition (OSE), as +; available from http://www.virtualbox.org. This file is free software; +; you can redistribute it and/or modify it under the terms of the GNU +; General Public License (GPL) as published by the Free Software +; Foundation, in version 2 as it comes in the "COPYING" file of the +; VirtualBox OSE distribution. VirtualBox OSE is distributed in the +; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +; + BITS TEST_BITS %if TEST_BITS != 64 pop bp diff --git a/src/VBox/Disassembler/testcase/tstAsmPush-1.asm b/src/VBox/Disassembler/testcase/tstAsmPush-1.asm index dd51dc4b5..dd32571f8 100644 --- a/src/VBox/Disassembler/testcase/tstAsmPush-1.asm +++ b/src/VBox/Disassembler/testcase/tstAsmPush-1.asm @@ -1,3 +1,24 @@ +; $Id: tstAsmPush-1.asm 35474 2011-01-11 09:08:30Z vboxsync $ +;; @file +; Disassembly testcase - Valid push sequences and related instructions. +; +; This is a build test, that means it will be assembled, disassembled, +; then the disassembly output will be assembled and the new binary will +; compared with the original. +; + +; +; Copyright (C) 2008-2011 Oracle Corporation +; +; This file is part of VirtualBox Open Source Edition (OSE), as +; available from http://www.virtualbox.org. This file is free software; +; you can redistribute it and/or modify it under the terms of the GNU +; General Public License (GPL) as published by the Free Software +; Foundation, in version 2 as it comes in the "COPYING" file of the +; VirtualBox OSE distribution. VirtualBox OSE is distributed in the +; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +; + BITS TEST_BITS %if TEST_BITS != 64 push bp diff --git a/src/VBox/Disassembler/testcase/tstAsmSignExtend-1.asm b/src/VBox/Disassembler/testcase/tstAsmSignExtend-1.asm index f9044cdcf..e8717e085 100644 --- a/src/VBox/Disassembler/testcase/tstAsmSignExtend-1.asm +++ b/src/VBox/Disassembler/testcase/tstAsmSignExtend-1.asm @@ -1,3 +1,24 @@ +; $Id: tstAsmSignExtend-1.asm 35474 2011-01-11 09:08:30Z vboxsync $ +;; @file +; Disassembly testcase - Valid sign extension instructions. +; +; This is a build test, that means it will be assembled, disassembled, +; then the disassembly output will be assembled and the new binary will +; compared with the original. +; + +; +; Copyright (C) 2008-2011 Oracle Corporation +; +; This file is part of VirtualBox Open Source Edition (OSE), as +; available from http://www.virtualbox.org. This file is free software; +; you can redistribute it and/or modify it under the terms of the GNU +; General Public License (GPL) as published by the Free Software +; Foundation, in version 2 as it comes in the "COPYING" file of the +; VirtualBox OSE distribution. VirtualBox OSE is distributed in the +; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. +; + %include "tstAsm.mac" BITS TEST_BITS |
