Commit Graph

103 Commits

Author SHA1 Message Date
Giacomo Vercesi 07be2c1cae Allow the use of valgrind with python
This commit does 2 main things:
* Adds PYTHONMALLOC=1 environment variable when `--valgrind` is used
  to force python to use normal malloc instead of the custom allocator
  python normally uses that's not friendly with valgrind
* Add a suppression file to remove a couple of false-positives that
  happen consistently and generate useless noise
2023-04-20 14:43:12 +02:00
Alessandro Di Federico 6e0fc63b77 Reschedule AttachDebugInfo after InlineHelpers 2023-04-13 18:11:48 +02:00
Giacomo Vercesi af237074f3 Implement AnalysesList in Python API & GraphQL
Implement the new functionality of AnalysesList on the python's side of
rev.ng and the GraphQL schema both in static and autogenerated form
2023-03-22 17:31:46 +01:00
Massimo Fioravanti 0373732b69 Add auto-analysis list
Introduces a default analysis list indede to be run first on binaries.
2023-03-22 17:31:46 +01:00
Ivan Krysak e1ebe8ea35 ABI-testing: introduce CABI-FT correction script 2023-03-15 10:19:03 +01:00
Ivan Krysak a360b11426 ABI: fix issues with regparm abi definitions 2023-03-15 10:19:03 +01:00
Ivan Krysak e84c76019a ABI: introduce an additional definition option
The new option is `NoRegisterArgumentsCanComeAfterStackOnes`
If it's set to `true`, then no register argument can follow any stack
argument under the said abi, otherwise such "shuffling" of arguments
is allowed.
2023-03-15 10:19:03 +01:00
Ivan Krysak 550b286a9e ABI: stop treating stack pointer as callee saved 2023-03-15 10:19:03 +01:00
Ivan Krysak f068bcb34f ABI-testing: switch to the new analyses 2023-03-15 10:19:03 +01:00
Ivan Krysak 6fc300d6d4 ABI: forbid using XMM registers to return values
This should be reverted once the vector register support is introduced
2023-03-15 10:19:02 +01:00
Ivan Krysak 8b675e131e ABI: introduce runtime abi definition 2023-03-15 10:19:02 +01:00
Ivan Krysak ad0fc079b8 ABI-testing: rename verify-abi
The new name is `check-compatibility-with-abi`
2023-03-15 10:19:02 +01:00
Ivan Krysak f4cbbaa365 ABI-testing: remove an extra tag redefinition 2023-03-15 10:19:02 +01:00
Ivan Krysak 3687869795 Model: make AddPrimitiveTypes a pure analysis 2023-03-15 10:19:01 +01:00
Giacomo Vercesi 7751143aad revng daemon: add timeout-keep-alive option
Add the `--timeout-keep-alive` option for all invocations of `revng
daemon`. This avoids some edge cases where connections are abruply
closed.
2023-03-14 20:50:28 +01:00
Giacomo Vercesi 8e05ae5ead rcc: fix report output with multiple rules
The rule output logic was wrongly coded to do `"\n".join` where
appending a newline to each line was the correct behavior.
Also remove a leftover typo in `rcc-config.yml`.
2023-03-13 22:53:44 +01:00
Alessandro Di Federico f68b7866b3 Introduce BasicBlockID
This commit introduces `BasicBlockID` as the unique identifier for a
`efa::BasicBlock` into the CFG. A `BasicBlockID` is defined by a
`MetaAddress` plus an incremental integer. This enables us to have
multiple instances of the same block in a single function, which is
particularly useful when inlining multiple times the same function.

Apart from this, the commit also does the following:

* It drops representing `MetaAddress`es a `structs` in the IR. This created
  several issues related to ABI. We now represent them as strings.

* It defines more functions in `support.h`, instead of defining prototypes
  by hand in `CodeGenerator.cpp` and the like. Specifically, `unknownPC`
  and `raise_exception_helper`. We also introduce a C "constructor" for
  `PlainMetaAddress`.

* It significantly reduces the API of `GeneratedCodeBasicInfo`, which
  was supposed to be put on a diet since a long time.  Specifically,
  many jump target related methods have been moved to free functions in
  `IRHelpers.h`.  Also `GCBI::getSuccessors` has been pushed into its
  only user, `PruneRetSuccessors`, to prevent further usage of a
  deprecated API. In the future, it would be nice to drop it entirely.

* It introduces `efa::BasicBlock::InlinedFrom`.

* Introduce an enum to represent named argument indices for `newpc`.
  This enables us to more effectively manipulate its argument list.

* It improves the verification and error reporting for
  `efa::FunctionMetadata`.

* Update tests.

This commit is preliminary to another piece of work to improve the
generality of inlining beyond the simple "fake function" scenario, for
which the feature was originally conceived.
2023-02-23 14:51:10 +01:00
Alessandro Di Federico 892922794e rcc-config.yml: ban "#pragma clang optimize off" 2023-02-23 14:51:10 +01:00
Alessandro Di Federico 1d4fc9de5b rcc-config.yml: add documentation 2023-02-23 14:51:10 +01:00
Massimo Fioravanti 9eb33bcf8e check-convention: fix detection of asserts
A typo prevented check conventions from detecting non-revng asserts in
the code, which are forbidden.
2023-02-09 13:44:30 +01:00
Antonio Frighetto 69e8615c9f Introduce test for Segment.Type importing 2023-02-06 12:08:18 +01:00
Antonio Frighetto f73b9876fa FunctionIsolation: execute CollectCFG earlier
This change makes sure that CollectCFG is always intertwined
with FunctionIsolation, as it needs to run before the latter
executed. To avoid possible rearrangements on the pipeline
in the future, CollectCFG pass is now registered within FI.
2023-02-06 09:37:23 +01:00
Antonio Frighetto 17f799e3c2 Move ProcessCallGraph pipe within Isolate
`CrossRelations` container needs to be available
just as `FunctionIsolation` has executed.
2023-02-06 09:37:23 +01:00
Massimo Fioravanti 9432399254 Introduce ApplyDiffAnalysis 2023-02-06 09:37:23 +01:00
Djordje Todorovic a48e518467 Introduce AttachDebugInfo pass 2023-02-02 15:26:44 +01:00
Giacomo Vercesi f3f04ef891 daemon/test.py: improve daemon log handling
Improve the handling of the daemon process when running tests.
print.
2023-02-01 17:46:21 +01:00
Alessandro Di Federico e590afb38e CMake: use LIBRARY_OUTPUT_DIRECTORY for libaries
This ensure we don't have to `cmake -E copy`.
2023-01-21 18:56:43 +01:00
Djordje Todorovic 809ea798a6 Introduce revng import debug-info
It supports both PDB and DWARF formats.
We get rid of `import dwarf` tool.
2022-12-13 11:25:46 +01:00
Alessandro Di Federico bffbd58434 tuple_tree_generator: generate one .cpp only 2022-12-09 09:07:06 +01:00
Alessandro Di Federico 58c6e095b6 TTG CMake: one target, many schemas
This commit ensures that `target_tuple_tree_generator` can handle being
invoke multiple times on the same target.
This avoids the need to create a dedicated library as a workaround.
2022-12-09 09:05:14 +01:00
Alessandro Di Federico 821f3b169a abi/test.sh: fix shellcheck warning 2022-12-09 09:02:29 +01:00
Alessandro Di Federico 0ed1c6f9ee daemon-self-test: disable testing
Running `revng daemon-self-test` runs steps and analyses that are part
of downstream projects, leading to unexpected and unstable results.
We can still run this downstream.
We can re-enable this once we can run it on a specific step and with a
custom set of analyses.
2022-11-30 15:06:54 +01:00
Alessandro Di Federico 9470e2582b abi/test.sh: use temporary directory 2022-11-30 15:06:54 +01:00
Alessandro Di Federico 036963b0b7 Rework tests 2022-11-30 15:06:54 +01:00
Alessandro Di Federico 762cc63d96 CollectCFG: purge addresses from test ground truth 2022-11-30 15:06:54 +01:00
Alessandro Di Federico 085f44b0ad tests: adopt temp 2022-11-30 15:06:54 +01:00
Alessandro Di Federico 009c0c2434 flake8: disable R505 (else after return statement) 2022-11-22 15:10:52 +01:00
Giacomo Vercesi f7ec377aa4 mktemp: use --tmpdir
Without the --tmpdir argument the current directory is used to generate
the temporary file
2022-10-24 09:58:55 +02:00
Alessandro Di Federico 368f27b876 yields test: use one-per-architecture 2022-10-22 00:42:53 +02:00
Massimo Fioravanti d55aa9b9e6 Pipeline: remove * from targets
Now * is just a pipeline frontend shorthand.
2022-10-20 14:20:12 +02:00
Alessandro Di Federico 8aa2c2ac44 daemon/test.py: do not use memfd 2022-10-11 19:08:10 +02:00
Alessandro Di Federico 12191a8d01 daemon/test.py: use log function 2022-10-11 19:08:10 +02:00
Alessandro Di Federico 6fae9fc1c5 Stop checking Python requirements 2022-10-11 19:08:10 +02:00
Giacomo Vercesi ff48b9de75 Introduce revng daemon-self-test
This new command will, given an executable, try to produce all
artifacts. By default it will run `revng daemon`, however an external
address can be provided to test remote daemons, e.g. running inside a
container.
2022-10-06 15:12:36 +02:00
Giacomo Vercesi e5963395dc Drop requests in favor of aiohttp
Drop the use of requests in the daemon tests, use aiohttp instead as
it allows the use of unix sockets, which simplifies the creation of
multiple ephimeral daemons
2022-10-04 14:20:03 +02:00
Giacomo Vercesi 5d02e7258f revng.daemon test: fail if daemon exit code != 0 2022-10-04 14:13:56 +02:00
Giacomo Vercesi bf4122ed0a Introduce v2 of revng-check-conventions 2022-09-29 15:21:59 +02:00
Alessandro Di Federico f6d5cd24dd Give pretty names to temporary files 2022-09-26 18:09:01 +02:00
Ivan Krysak f0afb1066b Yield: rework testing and add call graph tests 2022-09-26 12:11:13 +02:00
Ivan Krysak bb37d48dad Yield: introduce YieldCallGraphSlicePipe 2022-09-26 12:09:28 +02:00