1615 Commits
Author SHA1 Message Date
Patrick Quist c28d535c1e Changes needed to make dotnet work with nsjail (#3307) 2022-02-01 08:39:55 +01:00
TimmyTechTV a07a42b7a3 Adding Static Analysis to tooling (#3306)
* Create microsoft-analysis-tool.js
2022-01-31 21:40:50 -06:00
Mats Larsen 9b890b1656 Refactor handling of Assembly Documentation Providers (#3247) 2022-01-31 14:05:21 +01:00
Marc Poulhiès c4e76cd7a4 Add GNAT cross compiler from Alire project (#3294)
Add new adarts compiler properties used to set the RTS (if needed) to be used by
GNAT. This is needed as the cross compilers come with several RTS and you must
provide one.

Use Alire (https://alire.ada.dev/) cross compilers for ARM32 and RISC-V 64.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2022-01-30 10:49:13 -06:00
Mats Larsen 7c966783ac Fix lib/compilers/dotnet lint error 2022-01-30 14:47:55 +01:00
Steve 0a3aadbe80 Add support for C#, F# and Visual Basic (#3168) 2022-01-29 16:16:27 +01:00
Marc Poulhiès b83dafac61 Add comment for GNAT handling of command line options and enable strings (#3252)
Add some comments around the command line options handling of GNAT.

Add strings tool for Ada.

Also enable binary and execution in the default config.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2022-01-25 08:54:42 +01:00
Marc Poulhiès 1d8cae9562 Fix strings tool calling wrt binary/executable targets (#3251)
If only binary output is selected without the execution, strings would complain
about missing file.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2022-01-24 21:10:52 -06:00
Mats Larsen 1406669452 Move BaseFormatter into /lib/formatters (#3250) 2022-01-24 21:07:52 -06:00
Matt Godbolt 8bd3945bbb Upgrade eslint-plugin-unicorn, and fix issues it ponted out 2022-01-18 07:57:57 -06:00
Luca Pizzini ee2370fbc0 Fix bug: /compile endpoint API errors should be 400s (#3246)
closes #2560
2022-01-17 14:04:36 -06:00
Elektron72 bf9d2334b9 Add AVR assembly documentation (#3218) 2022-01-07 16:30:56 +01:00
Marc Poulhiès 8679767220 Fix parsing assembler from binary when templates are used (#3238)
When compiling to binary and with the demangling enabled, the assembler parser
was not correctly matching the "labels". The labelRe regex is tailored from
matching against the real symbol names, before any demangling. In the
binary+demangle context, we rely on objdump doing both at once, feeding our
parser with demangled names.

Make the labelRe match anything of the form:
00000000123af    <every thing here is the label>:

fixes #3235

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2022-01-07 09:07:37 +01:00
RabsRincon 91e4f3702a Make sure asm-raw behaves on compilation errors
Closes #3198
2021-12-31 13:23:22 +01:00
Mats Larsen da1a3ab7dc Make it possible to share types in /types directory between front and backend (#3211)
* Make it possible to share types in /types directory between front and backend

* Add new tsconfig files to gh-dist-files
2021-12-28 15:53:34 +01:00
Gregory Anders 7f0bc32ae4 API: Change 'filters' option to be additive (#3206) 2021-12-28 15:35:46 +01:00
Marc Poulhiès 86dd8f7814 Ada: new pane for GNAT Debug Tree (#3190)
Support for the GNAT Tree emitted by `-gnatdt` on stdout.
The pane is also available in the diff tool.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2021-12-28 15:35:11 +01:00
Elektron72 5a350691bb Add assembly documentation for 6502 (#3210)
This PR adds assembly documentation for the MOS 6502 and WDC 65C02 instruction sets, which are output by cc65.
2021-12-23 16:34:08 +01:00
Patrick QuistandMatt Godbolt 6e79e098c4 Minimal backend typescript support (#3207)
* minimal ts support

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2021-12-22 20:44:51 +01:00
Marc Poulhiès d00878f2b8 Fix missing gimple and original tree dump in GCC dump
Both gimple and original dumps are missing because CE currently only checks for
dumps coming from a pass advertised in -fdump-passes.
Fix this by faking 2 lines as coming from -fdump-passes.

fixes #3180

This is a fixed version of c8b25ee53b (#3183)

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2021-12-15 22:26:41 +01:00
partouf e003f11122 Revert "Create microsoft-analysis-tool.js (#3172)"
This reverts commit 819e18a045.
2021-12-15 21:01:54 +00:00
partouf 0de5dd9943 Revert "Fix missing gimple and original tree dump in GCC dump (#3183)"
This reverts commit c8b25ee53b.
2021-12-15 19:35:31 +00:00
timmy-ms 819e18a045 Create microsoft-analysis-tool.js (#3172) 2021-12-15 19:34:02 +01:00
Marc Poulhiès c8b25ee53b Fix missing gimple and original tree dump in GCC dump (#3183)
Both gimple and original dumps are missing because CE currently only checks for
dumps coming from a pass advertised in -fdump-passes.
Fix this by faking 2 lines as coming from -fdump-passes.

fixes #3180

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2021-12-15 19:25:16 +01:00
Marc Poulhiès 04787cef05 Fix source/assembly mapping when GNAT expanded code pane opened (#3177)
* Fix source/assembly mapping when GNAT expanded code pane opened

Using -gnatDGL to get the expanded code also asks GNAT to emit debug
informations pointing to the .dg file containing the expanded code, breaking CE
that is using these info to map assembly and source lines. Using -gnatGL instead
avoids the breaking of asm/source mapping but emits the expanded code in stdout
instead of a plain file.

This change replaces -gnatDGL by -gnatGL and extracts the expanded code from
stdout.

fixes #3171

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>

* fixup! Fix source/assembly mapping when GNAT expanded code pane opened
2021-12-15 19:19:35 +01:00
Mats Larsen 810a1d0918 Describe which opcode and arch was not found (#3175) 2021-12-15 19:10:50 +01:00
Matt Godbolt 73c758671a Update eslint et al 2021-12-13 22:40:03 -06:00
Patrick Quist a00f263bcd Handle filecontent and filename errors (#3170) 2021-12-10 19:52:21 +01:00
Mats Larsen d7c4eecbf7 Refactor and return 404 from AsmDocs APIs (#3143)
Refactors the handler for the AsmDocs API to reduce code duplication.

**Breaking changes proposed**

- API will now return 404. This used to return 200 with "Unknown opcode" which is what led to issue #3117. Following cases has been changed:
  1. archiecture was not found
  2. instruction opcode was not found
- API will now return 406 not acceptable when the accepted content type is not text or json
- There is no longer a `result` field on a 200 request, instead the assembly documentation object is returned.
- There is no longer a `found` field on any request, the HTTP codes indicate whether it was found or not (200 means found)

**New features**

- The frontend will only request the opcode for an instruction set at most once, caching every single outgoing request.
- The "There was an error fetching the documentation for this opcode" has been adjusted to contain what went wrong.

Relevant tests have been added and updated.
2021-12-07 11:43:08 +01:00
Marc Poulhiès 24693766d0 rust: HIR dump and small refactor with macro expansion (#3147)
Small refactoring for handling -Zunpretty calls:

- reuse options from main compiler invocation instead of crafting new ones.
- factor out common part.

Now also handles HIR output in a dedicated pane.
Still a lot of copy/pasting from the macro expansion.

fixes #2567

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2021-12-05 19:04:12 +01:00
Mats Larsen 560d18c410 Temporarily patch Kotlin runtime execution (#3151)
Fixes the problem where any (reasonable) Kotlin JVM execution would fail with a NoClassDefFound error with kotlin.jvm.internal.Intrinsics.

The Kotlin execution is now packed into a jar with the Kotlin Standard Library and executed with java -jar.
2021-12-03 22:59:08 +01:00
Björn Gustavsson 12d27b59b7 Format the output file for Erlang in a nicer way (#3135)
For Erlang, format the output in the same way as the 'S' option
does. To achieve this, we use the `beam_listing` module, which is
undocumented but has been stable for many many years.
2021-11-24 08:30:34 -06:00
Marc Poulhiès 8a6701f3a1 Fix and refactor rustc-cg-gcc GCC dump (#3128)
Conflicting changes in #3109 and #3064 left the GCC dump of rustc broken.

Reapplied the changes and refactored how the -fdump-foo-pass= option is crafted.
Instead of using stdout, use an explicit file. Beware that this won't work with
older GCC version. Regular GCC is still using the 'dump all files' instead of
the targeted option, so it's not impacted by this limitation. Only rustc-cg-gcc
is currently using this mecanism and it's using a recent libgccjit.

Really fixes #2868

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2021-11-22 00:08:02 +01:00
Patrick Quist 2bc71691ef Erlang highlight and add to amazon (#3129) 2021-11-21 23:53:43 +01:00
Marc Poulhiès 0efd82d6a4 Fix linter error in erlang.js
Trivial linter error:
```
compiler-explorer/lib/compilers/erlang.js
  65:1  warning  More than 1 blank line not allowed  no-multiple-empty-lines

✖ 1 problem (0 errors, 1 warning)
  0 errors and 1 warning potentially fixable with the `--fix` option.
```
2021-11-21 19:15:27 +01:00
Timothy MooresandPatrick Quist 82772f4bbb add support for erlang to beam bytecode (#3094)
* add support for erlang to beam bytecode

* changed call by 'this' to overridden functions

* Update base-compiler.js

Co-authored-by: Patrick Quist <partouf@gmail.com>
2021-11-21 14:22:04 +01:00
Marc Poulhiès 177fee0739 Enable the GCC dump for the rustc using GCC backend (#3109)
Beware that the way it is working causes several dump files to be empty. The
list of potential files is based on `-fdump-passes` output, but during the
actual compilation, some passes may or may not emit something (eg. a passe may
not be executed at all because it's not applicable). The drop down list will
contain some dump names that will simply display message like:

   Pass 'cselim (tree)' was requested
   but nothing was dumped. Possible causes are:
    - pass is not valid in this (maybe you changed the compiler options);
    - pass is valid but did not emit anything (eg. it was not executed).

This is expected and until someone has a better idea, this will be the case :)

fixes: #2868
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2021-11-21 14:18:25 +01:00
Marc PoulhièsandNico Lehmann 20ebcf7417 Honour rustc flags when emitting MIR and emit both assembly and MIR in the same execution (#3116)
* Honor compiler flags in rustc MIR output view

* Refactor rustc/MIR execution handling

Apply the same receipe as for GNAT and GCC for minimizing the number of
executions for getting extra outputs (here MIR).

After discussions in #3107, the way the output files are created is also
changed to use the syntax `--emit KIND=PATH` (see
https://doc.bccnsoft.com/docs/rust-1.36.0-docs-html/rustc/command-line-arguments.html)

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>

* fixup! Refactor rustc/MIR execution handling

Co-authored-by: Nico Lehmann <nico.lehmannm@gmail.com>
2021-11-21 14:15:30 +01:00
Rubén Rincón Blanco f7d77bd07e Modify the path include guard to fix some false-positives (#3083)
Closes #3045
2021-11-21 13:45:50 +01:00
Marc Poulhiès bba925ae02 Show GNAT expanded code pane even in case of compiler error (#3121)
Even when the compiler exits with an error, try to display the expanded
code.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2021-11-21 13:26:27 +01:00
Marc Poulhiès 4e96bfb776 Filter fdump-passes output from stderr before displaying (#3115)
The refactor from #3024 left all the output from -fdump-passes in
stderr. Filter it out before displaying it in the output pane.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2021-11-21 13:26:12 +01:00
Marc Poulhiès 88d58f9fe2 Refactor GCC dump and GNAT expanded code creation (#3064)
Instead of having a dedicated invocation of the compilers, inject needed options
in the main compilation command and do everything in one run. This should fix
GNAT race condition on ALI file, save some CPU time and make the latency a bit
better. This can work as long as everything can really be done in one run (eg.
no incompatible options, no clash on stdout/stderr).

Add optionsForBackend in base compiler class that is meant to be overloaded by
compilers for injecting options based on current backend options. Use it for
GCC dumps (BaseCompiler) and GNAT expanded code.

Fixes #3041
References #3029

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2021-11-16 21:09:18 +01:00
Nico Lehmann 19159930b5 Remove trailing whitespaces
Reviewed-by: Marc Poulhiès <dkm@kataplop.net>
2021-11-13 18:29:23 +01:00
Marc PoulhièsandRubén Rincón Blanco 6f18695dc0 Refactor GCC dump handling (#3024)
This change allows for only dumping a single pass (the one selected). In order
to populate the list of available dumps, it now queries GCC for the enabled
passes.

It can still be misleading to users as a pass can be enabled but for some reason
does not dump anything. In order to avoid this, the only solution seems to be to
still dump all files and filter the list... This defeats the initial goal and
only adds complexity for the current compilers.

But this makes #2868 easier to implement (see #2985 that was a aborted first
attempt) and if someday another libgccjit-based compiler is added, it could be
easily hooked to this.

It also changes the naming in the drop down menu. For example, instead of :
'009t.omplower' it now uses 'omplower (tree)' (ie.
'<pass-name> (tree|ipa|rtl)').

Fixes #3014

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Co-authored-by: Rubén Rincón Blanco <ruben@rinconblanco.es>
2021-11-08 18:52:30 +01:00
RabsRincon ed0609bb90 Avoid null error if asm line is somehow missing 2021-11-08 17:42:35 +01:00
Mats Larsen 27b3c5ec20 Set Java default encoding to UTF-8 (#3096)
The default encoding used for Java is now UTF-8. This did not have to be changed for the Scala or Kotlin compilers as those already default to UTF-8
2021-11-04 17:15:21 +01:00
Matt Godbolt cf7d70402e Await for things (#3086)
* Await for things

We had a number of things that aren't await()ing their promises.
That led to non-deterministic compiler settings like Intel support.
I used the IDE to find them all and fix the ones that I thought looked
important.

More generally we should use tslint (once we're all typescript) to
ensure this more generally. I tried the eslint equivalent but it
either overreacted or didn't catch anything.

Closes #3085
2021-10-31 15:31:45 -05:00
Mats Larsen c9542a2c1a Implemement backwards compatability for Format API after #2957 (#3066)
* Implement fix for #3065

* Address review comments

* Undo accidental formatting
2021-10-30 15:40:34 +02:00
RabsRincon 8886821da4 Add a way to ensure no tracking is done and now 3rd party is available 2021-10-26 20:31:38 +02:00
Justus H 3d573e4b79 Fix IAR EWB implementation to work on Linux and tweak its ARM support (#3028)
* Fix path regex in IAR EWB asm parser to work with Linux paths

Currently the regex only supports Windows paths. This commit updates
the regex so that it works with Windows as well as Linux paths.

* Improve ARM support in IAR EWB asm parser
2021-10-22 08:55:13 -05:00