diff --git a/etc/config/c++.wud-mgodbolt01.properties b/etc/config/c++.wud-mgodbolt01.properties new file mode 100644 index 00000000..d19b58f0 --- /dev/null +++ b/etc/config/c++.wud-mgodbolt01.properties @@ -0,0 +1,23 @@ +defaultCompiler=g52 +compilers=g44:g45:g46:clang35:g51:g52:gdef:ec2-52-201-230-81.compute-1.amazonaws.com@10240 +#compilers=localhost@20480 +compiler.g44.exe=/usr/bin/g++-4.4 +compiler.g44.name=g++ 4.4 +compiler.g44.alias=/usr/bin/g++-4.4 +compiler.g45.exe=/usr/bin/g++-4.5 +compiler.g45.name=g++ 4.5 +compiler.g45.alias=/usr/bin/g++-4.5 +compiler.g46.exe=/usr/bin/g++-4.6 +compiler.g46.name=g++ 4.6 +compiler.g46.alias=/usr/bin/g++-4.6 +compiler.clang35.exe=/usr/bin/clang++-3.5 +compiler.clang35.name=Clang 3.5 +compiler.clang35.intelAsm=-mllvm --x86-asm-syntax=intel +compiler.clang35.supportsBinary=false +compiler.g51.exe=/home/mgodbolt/.fighome/runtime/gcc/5.1.0-1/bin/g++ +compiler.g51.name=g++ 5.1 +compiler.g52.exe=/home/mgodbolt/.fighome/runtime/gcc/5.2.0-1/bin/g++ +compiler.g52.name=g++ 5.2 +compiler.gdef.exe=/usr/bin/g++ +compiler.gdef.name=Default G++ +#compiler-wrapper=./c-preload/compiler-wrapper diff --git a/lib/asm.js b/lib/asm.js index 4f391877..8a5d91b2 100644 --- a/lib/asm.js +++ b/lib/asm.js @@ -268,7 +268,7 @@ var self = this; this.opcodes = []; this.offset = null; - var numberRe = /^\s+(([0-9a-f]+\b\s*)+)(.*)/; + var numberRe = /^\s+(([0-9a-f]+\b\s*)([0-9a-f][0-9a-f]\b\s*)*)(.*)/; var prevOffset = -1; var prevOpcodes = []; this.hasOpcodes = function () { @@ -282,7 +282,7 @@ prevOffset = -1; return line; } - var restOfLine = match[3]; + var restOfLine = match[4]; var numbers = match[1].split(/\s+/).filter(function (x) { return x; }).map(function (x) { diff --git a/test/cases/cl-maxarray.asm.dlcb.json b/test/cases/cl-maxarray.asm.dlcb.json new file mode 100644 index 00000000..36cfc0f1 --- /dev/null +++ b/test/cases/cl-maxarray.asm.dlcb.json @@ -0,0 +1,330 @@ +[ + { + "text": "x$ = 8", + "source": null + }, + { + "text": "y$ = 16", + "source": null + }, + { + "text": "maxArray PROC", + "source": null + }, + { + "text": "", + "source": null + }, + { + "text": " lea rax, QWORD PTR [rcx+8]", + "source": null, + "opcodes": [ + 72, + 141, + 65, + 8 + ], + "address": 0 + }, + { + "text": " sub rdx, rcx", + "source": null, + "opcodes": [ + 72, + 43, + 209 + ], + "address": 4 + }, + { + "text": " mov ecx, 16384 ; 00004000H", + "source": null, + "opcodes": [ + 185, + 0, + 64, + 0, + 0 + ], + "address": 7 + }, + { + "text": " npad 4", + "source": null, + "opcodes": [ + 15, + 31, + 64, + 0 + ], + "address": 12 + }, + { + "text": "$LL9@maxArray:", + "source": null + }, + { + "text": "", + "source": null + }, + { + "text": " movsd xmm0, QWORD PTR [rdx+rax-8]", + "source": null, + "opcodes": [ + 242, + 15, + 16, + 68, + 2, + 248 + ], + "address": 16 + }, + { + "text": " comisd xmm0, QWORD PTR [rax-8]", + "source": null, + "opcodes": [ + 102, + 15, + 47, + 64, + 248 + ], + "address": 22 + }, + { + "text": " jbe SHORT $LN10@maxArray", + "source": null, + "opcodes": [ + 118, + 5 + ], + "address": 27 + }, + { + "text": " movsd QWORD PTR [rax-8], xmm0", + "source": null, + "opcodes": [ + 242, + 15, + 17, + 64, + 248 + ], + "address": 29 + }, + { + "text": "$LN10@maxArray:", + "source": null + }, + { + "text": " movsd xmm0, QWORD PTR [rdx+rax]", + "source": null, + "opcodes": [ + 242, + 15, + 16, + 4, + 2 + ], + "address": 34 + }, + { + "text": " comisd xmm0, QWORD PTR [rax]", + "source": null, + "opcodes": [ + 102, + 15, + 47, + 0 + ], + "address": 39 + }, + { + "text": " jbe SHORT $LN14@maxArray", + "source": null, + "opcodes": [ + 118, + 4 + ], + "address": 43 + }, + { + "text": " movsd QWORD PTR [rax], xmm0", + "source": null, + "opcodes": [ + 242, + 15, + 17, + 0 + ], + "address": 45 + }, + { + "text": "$LN14@maxArray:", + "source": null + }, + { + "text": "", + "source": null + }, + { + "text": " movsd xmm0, QWORD PTR [rdx+rax+8]", + "source": null, + "opcodes": [ + 242, + 15, + 16, + 68, + 2, + 8 + ], + "address": 49 + }, + { + "text": " comisd xmm0, QWORD PTR [rax+8]", + "source": null, + "opcodes": [ + 102, + 15, + 47, + 64, + 8 + ], + "address": 55 + }, + { + "text": " jbe SHORT $LN15@maxArray", + "source": null, + "opcodes": [ + 118, + 5 + ], + "address": 60 + }, + { + "text": " movsd QWORD PTR [rax+8], xmm0", + "source": null, + "opcodes": [ + 242, + 15, + 17, + 64, + 8 + ], + "address": 62 + }, + { + "text": "$LN15@maxArray:", + "source": null + }, + { + "text": "", + "source": null + }, + { + "text": " movsd xmm0, QWORD PTR [rdx+rax+16]", + "source": null, + "opcodes": [ + 242, + 15, + 16, + 68, + 2, + 16 + ], + "address": 67 + }, + { + "text": " comisd xmm0, QWORD PTR [rax+16]", + "source": null, + "opcodes": [ + 102, + 15, + 47, + 64, + 16 + ], + "address": 73 + }, + { + "text": " jbe SHORT $LN16@maxArray", + "source": null, + "opcodes": [ + 118, + 5 + ], + "address": 78 + }, + { + "text": " movsd QWORD PTR [rax+16], xmm0", + "source": null, + "opcodes": [ + 242, + 15, + 17, + 64, + 16 + ], + "address": 80 + }, + { + "text": "$LN16@maxArray:", + "source": null + }, + { + "text": " add rax, 32 ; 00000020H", + "source": null, + "opcodes": [ + 72, + 131, + 192, + 32 + ], + "address": 85 + }, + { + "text": "", + "source": null + }, + { + "text": " sub rcx, 1", + "source": null, + "opcodes": [ + 72, + 131, + 233, + 1 + ], + "address": 89 + }, + { + "text": " jne SHORT $LL9@maxArray", + "source": null, + "opcodes": [ + 117, + 177 + ], + "address": 93 + }, + { + "text": "", + "source": null + }, + { + "text": " ret 0", + "source": null, + "opcodes": [ + 195 + ], + "address": 95 + }, + { + "text": "maxArray ENDP", + "source": null + }, + { + "text": "", + "source": null + } +] diff --git a/test/cases/cl-regex.asm.directives.labels.comments.json b/test/cases/cl-regex.asm.directives.labels.comments.json index 9f5d9aca..be413d34 100644 --- a/test/cases/cl-regex.asm.directives.labels.comments.json +++ b/test/cases/cl-regex.asm.directives.labels.comments.json @@ -120,7 +120,7 @@ "source": 11 }, { - "text": " rsp, 120 ; 00000078H", + "text": " add rsp, 120 ; 00000078H", "source": 11 }, { @@ -135,4 +135,4 @@ "text": "", "source": null } -] \ No newline at end of file +] diff --git a/test/cases/cl-regex.asm.dlcb.json b/test/cases/cl-regex.asm.dlcb.json index 78b73e2f..44307700 100644 --- a/test/cases/cl-regex.asm.dlcb.json +++ b/test/cases/cl-regex.asm.dlcb.json @@ -287,14 +287,13 @@ "address": 99 }, { - "text": " rsp, 120 ; 00000078H", + "text": " add rsp, 120 ; 00000078H", "source": 11, "opcodes": [ 72, 131, 196, - 120, - 2781 + 120 ], "address": 104 }, @@ -314,4 +313,4 @@ "text": "", "source": null } -] \ No newline at end of file +] diff --git a/test/test.js b/test/test.js index 2c88abb6..dceac17f 100755 --- a/test/test.js +++ b/test/test.js @@ -95,6 +95,7 @@ function testFilter(filename, suffix, filters) { // bless("cases/cl-regex.asm", "cases/cl-regex.asm.directives.labels.comments.json", {directives: true, labels: true, commentOnly: true}); // bless("cases/cl-regex.asm", "cases/cl-regex.asm.dlcb.json", {directives: true, labels: true, commentOnly: true, binary:true}); +// bless("cases/cl-maxarray.asm", "cases/cl-maxarray.asm.dlcb.json", {directives: true, labels: true, commentOnly: true, binary:true}); cases.forEach(function (x) { testFilter(x, ".directives", {directives: true})