39 Commits

Author SHA1 Message Date
Alessandro Di Federico 686083bdab Remove mentions to revng-c 2024-11-21 15:54:23 +01:00
Alessandro Di Federico 9cca30976d docs/*.rst: add warning 2024-08-07 16:08:00 +02:00
Alessandro Di Federico 757f7e21d7 Import docs 2024-02-09 10:04:24 +01:00
Alessandro Di Federico 0e7d3a9a71 Pass PlainMetaAddress by pointer 2023-12-12 10:20:51 +01:00
Giacomo Vercesi 31cd2b53f9 rcc: add codespell
Add codespell to the list of checks performed by
revng-check-conventions. This should reduce the amount of typos present
in the revng codebase.
2023-05-11 10:05:32 +02:00
Giacomo Vercesi a13c3e5ac2 revng: fix executable/shebang in scripts
Some files had discordant executable bit presence and shebang presence.
This commit fixes these occurrences by adding removing the required
feautures where needed.
2023-05-11 10:02:46 +02:00
Giacomo Vercesi cf0921ab31 revng-check-conventions: allow ignoring InitRevng
Add an additional `rcc-ignore` rule to ignore the absence of `InitRevng`
in a `Main.cpp` file
2023-04-20 14:43:11 +02:00
Giacomo Vercesi 8a780a58aa GraphQL: return binaries in b64
This change fixes the pipeline behavior when producing targets:
* produce and extract now return rp_buffer, which has a start pointer
  and size
* the python api `revng.api` will return on produce/extract either str
  or  bytes depending on the mime type of the container
* the GraphQL api will encode bytes in base64
2023-02-07 16:54:35 +01:00
Giacomo Vercesi bf4122ed0a Introduce v2 of revng-check-conventions 2022-09-29 15:21:59 +02:00
Alessandro Di Federico bee6872414 Fix CMake formatting 2022-06-21 18:24:43 +02:00
Alessandro Di Federico f4684e244d Switch to new testsuite 2022-06-20 19:04:18 +02:00
Giacomo Vercesi 31a836e48c revng-check-conventions: introduce flake8 2022-04-20 09:56:44 +02:00
Giacomo Vercesi d81dc49809 revng-check-conventions: license check 2022-04-20 09:55:18 +02:00
Alessandro Di Federico 2b55d1df22 Adopt cmake-format 2022-03-17 18:52:18 +01:00
Filippo Cremonese d5e5e16887 Apply and enforce python formatting with black 2022-02-23 18:02:39 +01:00
Antonio Frighetto 34580789eb BinaryFile: add architecture-dependent fields
Add return address register and minimal final stack offset in Arch.
2021-12-15 18:03:30 +01:00
Alessandro Di Federico 0a6c52a590 Update docs/GeneratedIRReference.rst
* Drop outdated portion describing ABI/CFG metadata that are now stored
  in the model.
* Introduce MetaAddress concept.
* Describe the four-parts program counter CSVs.
* Update description of the dispatcher.
* Update description of `function_call` and `newpc`.
2021-10-21 15:02:00 +02:00
Andrea Gussoni fe7d0b256f GeneratedIRReference.rst: toolchain installation 2021-09-01 16:34:25 +02:00
Matteo Giordano e954b07051 GeneratedIRReference.rst: general fixes
General correction about deprecated flags and new ones.
2021-09-01 16:34:25 +02:00
Matteo Giordano 86e27e608c GeneratedIRReference.rst: --no-link not needed 2021-09-01 16:34:25 +02:00
Matteo Giordano 0ec73686f3 Fixed typos in GeneratedIRReference.rst 2021-09-01 16:34:25 +02:00
Alessandro Di Federico b150274a1f Import overview document 2021-05-14 13:45:00 +02:00
Alessandro Di Federico 2b9cbb98ec Introduce --invoke-isolated-functions
This commit ensures that FunctionIsolation and EnforceABI do only
thing. This means that they no longer modify `root`.

Instead, we have a new pass, `invoke-isolated-functions` that needs to
be run after them and replaces the entry point of the functions with
invokes to the isolated functions, possibly with the appropriate
arguments.
2021-04-22 14:45:52 +02:00
Alessandro Di Federico 86d931dc1f Update FromIRToExecutable.rst 2021-03-06 16:56:09 +01:00
Alessandro Di Federico 0e4c4aad59 Make --use-debug-symbols the default 2020-10-21 10:34:34 +02:00
Alessandro Di Federico 20c367b88f Add ArchitectureName to revng.input.architecture 2020-05-14 11:58:18 +02:00
Alessandro Di Federico d50fbe969a Update documentation and add revng. to metadata 2019-04-11 19:51:32 +02:00
Alessandro Di Federico 6ae0610e2d Force Python versions
This commit switches all scripts to Python 3, except for
`revng-merge-dynamic` which requires Python 2 due to a limitation of
pyelftools.
2019-02-12 18:40:24 +01:00
Alessandro Di Federico 53db84f7d6 s/revamb/revng/g 2019-02-11 16:09:23 +01:00
Alessandro Di Federico cc02713f6d Abandon argparse in favor of LLVM's CommandLine
This commit dismisses the `argparse` library (the only non-runtime C
component of rev.ng) in favor of LLVM's CommandLine library, which
offers several benefits. Among others, now command line arguments can be
easily specified as a global variable, decentralizing their management
and avoiding the long list of arguments in the constructor of singleton
objects such as `CodeGenerator`.
2018-10-03 23:11:13 +02:00
Andrea Gussoni 500d77f43e Register and add among JT reasons FunctionSymbol
The symbol handling has been extended to register whether a symbol
represents a function or not. This information is then used to register,
during the global data harvesting phase, all the function symbols and
explicitly mark them through the "FunctionSymbol" `JTReason`.

We use this information during the CFEP harvesting phase to integrate
the information produced by the function boundaries detection with
potential unidentified CFEPs.

This option can be enabled with the `--use-debug-symbols`, which
supersedes `--use-sections`.
2018-09-20 17:52:10 +02:00
Niccolò Izzo 92253e23b2 Fixed typos in revamb documentation 2018-08-18 17:14:02 +02:00
Alessandro Di Federico aa38255149 Output a CSV file with the required libraries
This commit makes `revamb` produce a new file `.ll.need.csv` containing
a list of all the dynamic libraries required by the input program. This
will be transformed by the 'csv-to-ld-options` (was:
`li-csv-to-ld-options`) into the appropriate linking options.
2018-05-29 08:35:24 +02:00
Andrea Gussoni cf42e497aa Introduce the Function Isolation Pass
This commit introduces the Function Isolation Pass. We use the
information provided by the Function Boundaries Detection Pass to
organize the code that `revamb` places inside the `root` function in
different LLVM functions. To do this we obviously need to introduce some
changes and tricks to handle the execution of the translated program.

The main idea is to have two different realms (one where the isolated
functions live, one in which we have basically the old root function).
We start the execution from the realm of the *non isolated* functions,
and we transfer, as soon as possible, the execution to the *isolated
functions* realm. We then have a fallback mechanism to restore the
execution in the right place in the *non isolated* functions realm, and
so on.

The largest change, besides the re-organization of the code in different
functions, is the use of the exception handling mechanism provided by
the LLVM framework in order to be able to manage the switch between the
two realms.

We also introduce the `support.h` header file, which contains a couple
of definitions used by `support.c` and that need to be shared with some
of the components involved in the translation process. We have defined
some helper functions, directly in C, that we use both for handling the
exception mechanism and for giving extra debug informations when an
exception is raised.

The `revamb-dump` utility now supports the `-i` option to specify the
path were to save the new LLVM module.

The `translate` utility now supports the `-i` option that produces a
binary in which the function isolation has been applied.

We also introduced some tests that apply the function isolation pass to
the `Runtime/` tests already present. In this way we can verify that the
translation and the following function isolation preserve the behavior
of the program.

When serializing the new LLVM module we regenerate the metadata used for
debug purposes, and for doing this, since we not longer have only the
`root` function, we have changed some details in the `DebugHelper` class
in order to be able to emit the metadata for all the functions of our
interest in a single shot.
2018-04-22 15:19:36 +02:00
Alessandro Di Federico e031583308 Set CSVs linkage to internal
This simple commit should improve performance of the generated program
sensibly. Basically all the global variables will have internal linkage
from now on (unless the `--external` parameter is specified on the
command line). This way, the compiler will be able to avoid load/store
instructions when leaving code in the current translation unit.
2017-04-03 15:57:50 +02:00
Alessandro Di Federico 12ed8219da Disable slow backend optimization
Introduce the `-disable-machine-licm` argument when the `translate`
script invokes `llc` with `-O2`.
2017-04-03 13:57:56 +02:00
Alessandro Di Federico d4168436db Install documentation
This commit introduces a docs target which translates `.rst` files into
man pages or HTML documents and installs them in `/usr/share/man/man1`
or `/usr/share/doc/revamb`.
2017-03-31 16:14:15 +02:00
Alessandro Di Federico 89d49789fb docs: reflect recent changes to root and linking
Update `GeneratedIRReference.rst:` to reflect recent changes to the
`root` function. Specifically, the presence of the stack pointer
argument and initialization of the program counter and the stack
pointer.

`FromIRToExecutable.rst` has been updated too, to take into account the
new way we link `support.c`.

Finally, the `--tracing` argument has been removed from
`RevambUsage.rst` and the `-trace` argument is no documented in
`TranslateUsage.rst`.
2017-03-31 16:12:14 +02:00
Alessandro Di Federico 5154cb57f2 Initial import of documentation 2017-01-11 16:02:19 +01:00