From 45036cc3ae94bec5f1d62da379143f60eb8aed5b Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 15 Aug 2018 20:30:11 +0200 Subject: [PATCH 1/3] Add a link to a blog post explaining what auto-NSDMI are --- etc/config/c++.amazon.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/config/c++.amazon.properties b/etc/config/c++.amazon.properties index 02e0213d8..9425b76a8 100644 --- a/etc/config/c++.amazon.properties +++ b/etc/config/c++.amazon.properties @@ -160,7 +160,7 @@ compiler.clang_p1144.notification=Experimental __is_trivially_relocatable; see < compiler.clang_autonsdmi.exe=/opt/compiler-explorer/clang-autonsdmi-trunk/bin/clang++ compiler.clang_autonsdmi.semver=(experimental auto NSDMI) compiler.clang_autonsdmi.options=-std=c++2a -stdlib=libc++ -compiler.clang_autonsdmi.notification=Experimental auto NSDMI +compiler.clang_autonsdmi.notification=Experimental auto NSDMI; see this blog post for more information # Clang for RISC-V group.rvclang.compilers=rv32clang From f703811d4e5a448b62fc1e55a7892ecd96fc2d84 Mon Sep 17 00:00:00 2001 From: Patrick Quist Date: Thu, 16 Aug 2018 16:34:22 +0200 Subject: [PATCH 2/3] Fix incorrect regular expression for jmp calls Not sure if this breaks anything --- lib/demangler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/demangler.js b/lib/demangler.js index 362e875a5..bd69578d0 100644 --- a/lib/demangler.js +++ b/lib/demangler.js @@ -46,7 +46,7 @@ class Demangler extends AsmRegex { this.includeMetadata = true; this.compiler = compiler; - this.jumpDef = /(j.+|b|bl|blx)\s+([.a-z_$][a-z0-9$_@.]*)/i; + this.jumpDef = /(j\w+|b|bl|blx)\s+([a-z_$][a-z0-9$_@]*)/i; this.callDef = /call[q]?\s+([.a-z_$][a-z0-9$_@.]*)/i; // symbols in a mov or lea command starting with an underscore From d3bced7019e02e5fe0d221a282601d996a3277e7 Mon Sep 17 00:00:00 2001 From: Partouf Date: Thu, 16 Aug 2018 20:51:55 +0200 Subject: [PATCH 3/3] tests for fixed demangler jmp regex --- test/demangler-tests.js | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/test/demangler-tests.js b/test/demangler-tests.js index 41fec76ed..447cbad57 100644 --- a/test/demangler-tests.js +++ b/test/demangler-tests.js @@ -209,6 +209,46 @@ describe('Basic demangling', function () { ] ); }); + + it('Should ignore comments after jmps', function () { + const result = {}; + result.asm = [ + {"text": " jmp _Z1fP6mytype # TAILCALL"} + ]; + + const demangler = new Demangler(cppfiltpath, new DummyCompiler()); + demangler.demanglerArguments = ['-n']; + demangler.result = result; + demangler.symbolstore = new SymbolStore(); + demangler.collectLabels(); + + const output = demangler.othersymbols.listSymbols(); + output.should.deep.equal( + [ + "_Z1fP6mytype" + ] + ); + }); + + it('Should still work with normal jmps', function () { + const result = {}; + result.asm = [ + {"text": " jmp _Z1fP6mytype"} + ]; + + const demangler = new Demangler(cppfiltpath, new DummyCompiler()); + demangler.demanglerArguments = ['-n']; + demangler.result = result; + demangler.symbolstore = new SymbolStore(); + demangler.collectLabels(); + + const output = demangler.othersymbols.listSymbols(); + output.should.deep.equal( + [ + "_Z1fP6mytype" + ] + ); + }); }); function DoDemangleTest(root, filename) {