Commit Graph

6113 Commits

Author SHA1 Message Date
Giacomo Vercesi f6f512883a revng daemon: add save mutation
Add the `save` mutation to the GraphQL api. This allows a client to
trigger saving.
2024-12-20 12:24:34 +01:00
Giacomo Vercesi 319b558ddb EventManager: change saving logic
Switch the saving logic of EventManager from 5 minutes of inactivity to
every 2 minutes, regardless of user interaction. However if the user
does not interact, then consecutive saves will not be made.
2024-12-20 12:24:28 +01:00
Giacomo Vercesi 05041a302a PipelineManager: save after running analyses
Save the context after an analysis (or analyses-list) has run. This
guarantees that at least the model is preserved in case of crash.
2024-12-20 12:24:28 +01:00
Giacomo Vercesi 878356bd57 revng ptml: drop c.comparison PTML token
The `c.comparison` token was dropped by commit
0812989cb0, drop it also in the color
conversion table of `revng ptml`.
2024-12-20 12:24:28 +01:00
Pietro Fezzardi c367111ed1 Merge branch 'feature/ese' 2024-12-18 10:56:53 +01:00
Andrea Gussoni 26cf42eb12 ESE: Introduce the Enforce Single Exit pass
Introduce the Enforce Single Exit pass, whose task is to normalize a
generic `ScopeGraph`, which may have multiple exit blocks (and/or
infinite loop regions), in order to have a single `sink_block` as exit
block.

This is done by adding a new entry block, a `sink_block`, and some
`scope_closer` edges (which are visible only on the `ScopeGraph`) that
enforce the property.

This is done taking inspiration from how the internally the
`PostDominatorTree` pass construct the temporary graph on which the post
dominance information is computed on.

Some unit tests are added in order to verify that the pass works as
expected.
2024-12-18 10:51:40 +01:00
Andrea Gussoni 3dc66217a4 GraphAlgorithms: remove unused code 2024-12-18 10:51:36 +01:00
Alessandro Di Federico a3d79374b1 Merge branch 'feature/more-docs' 2024-12-11 17:16:10 +01:00
Alessandro Di Federico 797ad1678b Document CLI commands 2024-12-11 16:15:43 +01:00
Alessandro Di Federico 620d142d53 Reroganize and expand documentation 2024-12-11 16:15:37 +01:00
Alessandro Di Federico 0c7c20ad48 Introduce model, artifacts and analyses references 2024-12-11 16:15:27 +01:00
Alessandro Di Federico 276a4aa974 Generate model docs 2024-12-11 16:15:10 +01:00
Alessandro Di Federico ade0603d3f Add docs for artifacts and analyses 2024-12-11 16:15:10 +01:00
Alessandro Di Federico d2d32b304e Model: improve documentation 2024-12-11 16:15:09 +01:00
Alessandro Di Federico 5b7703aff3 Minor changes 2024-12-11 16:15:09 +01:00
Pietro Fezzardi 533478e4c1 Merge branch 'feature/scopegraph' 2024-12-05 23:47:01 +01:00
Andrea Gussoni fa69bd24e5 ScopeGraph: introduce the ScopeGraph
Introduce the `ScopeCloser` and `GotoTarget` annotations in the IR, and
the relative necessary machinery, needed to handle scope closer and goto
edges for the new backend.

A specialization of the `llvm::GraphTraits`, called `ScopeGraph`, that
is able to handle both the above mentioned annotations is provided.

For the `llvm::GraphTraits` implementation, we introduce the
`GeneratorIterator` class, which uses a coroutine to store the status of
the iteration.

A debug logger pass is added, so that we are able to test the
functionality with `FileCheck`.
2024-12-05 15:43:57 +01:00
Andrea Gussoni 023771f084 FunctionTags: correct typo
Correct `function-dispatcher` typo.
2024-12-04 11:22:00 +01:00
Alessandro Di Federico 9622ba038a Merge branch 'feature/efa-qa-fixes' 2024-12-04 09:46:37 +01:00
Alessandro Di Federico cfcbd3e5f9 Introduce model::Register::canonicalArchitecture
This commit fixes the fact that mipsel had apparently no registers due
to the fact that its registers were associated to mips.
2024-12-04 09:45:37 +01:00
Alessandro Di Federico ab0010b3f6 Reduce usage of PostHelper jump targets 2024-12-03 12:13:15 +01:00
Alessandro Di Federico 035e8e99a2 Minor changes 2024-12-03 12:12:44 +01:00
Alessandro Di Federico 78242ec9a9 Merge branch 'feature/unmapped-code' 2024-11-28 15:22:24 +01:00
Alessandro Di Federico 832840c307 Importers: ignore unmapped code
This commit ensures that parts of the model that must point to code
(specifically `Binary::EntryPoint`, `Binary::ExtraCodeAddresses` and
`Function::Entry`) actually point to a segment mapped as +x.
2024-11-28 15:22:10 +01:00
Alessandro Di Federico 37feb2dd77 Binary::verify: verify executable addresses
Fail if code addresses are not within an executable segment.
2024-11-28 14:04:36 +01:00
Alessandro Di Federico 278c6f625c Importers: first of all, Segments
This commit makes sure that before setting EntryPoint, adding
ExtraCodeAddresses or Function entry points, we completed the processing
of Segments.
2024-11-28 14:04:36 +01:00
Alessandro Di Federico d1252046ce Importers: do not set EntryPoint, if absent 2024-11-28 13:58:29 +01:00
Alessandro Di Federico 1e2a55e372 Minor changes 2024-11-28 13:58:28 +01:00
Alessandro Di Federico 6e733427bc emitMessage: fix function calle emission 2024-11-27 17:18:39 +01:00
Alessandro Di Federico 11d8515f46 ModelToHeader: adjust blank lines 2024-11-27 17:18:12 +01:00
Alessandro Di Federico c81f02a10f Merge branch 'feature/llvm-transparent-zstd' 2024-11-26 15:42:17 +01:00
Giacomo Vercesi 70217f00c9 revng opt: drop unwrapping of zstd modules
Drop support of uncompressing zstd-compressed modules in `revng opt` as
this functionality has been moved within `llvm`.

(This is a revert of commit dd8d158e47)
2024-11-26 11:30:19 +01:00
Giacomo Vercesi 58b326b8fa ZstdStream: remove manual memory management
Remove the use of manual memory management, convert to the use of
`std::unique_ptr`.
2024-11-26 09:48:37 +01:00
Alessandro Di Federico 56c6d49050 Merge branch 'feature/backlog-fixes' 2024-11-25 17:58:59 +01:00
Giacomo Vercesi 046be11be2 revng graphql: gracefully terminate daemon
When stopping an internal daemon, first try to use SIGINT and then
resort to SIGKILL. This is to avoid the signal handler exiting with a
non-zero return code during shutdown.
2024-11-25 17:52:27 +01:00
Giacomo Vercesi 3a936a650c Tracing/Runner: lazily initialize CommandHandler
Avoid initializing `CommandHandler` statically, as this causes the
constructor to run every time `libPipelineC` is linked against.
2024-11-25 16:25:48 +01:00
Giacomo Vercesi 1b6ff00595 Tracing/Runner: delay registering signal handlers
On the C++ side of revng it is important that LLVM's signal handlers are
registered within the initialization of `revng::InitRevng`, as this
allows downstream users (e.g. `revng daemon`) to preserve its signal
handlers before setting up the C++ infrastructure. In
`Tracing/Runner.cpp` there's `CommandHandler` which is statically
initialized and called `llvm::sys::AddSignalHandler`, this happened at
`dlopen` time, breaking the promise outlined above. Rework the code so
that the function is called lazily instead of statically.
2024-11-25 14:55:01 +01:00
Giacomo Vercesi 9ee719f2c2 ptml/common: fix missing kwargs
Add the missing `kwargs` to the invocation of the wrapped `func` in
`suppress_brokenpipe`.
2024-11-22 16:05:16 +01:00
Alessandro Di Federico 686083bdab Remove mentions to revng-c 2024-11-21 15:54:23 +01:00
Alessandro Di Federico 143c315196 Merge revng-c into revng 2024-11-21 10:50:55 +01:00
Alessandro Di Federico 73de70872f Merge branch 'feature/backlog-fixes' 2024-11-13 09:28:35 +01:00
Giacomo Vercesi 38cd15d755 fetch_debuginfo: fix race condition
Fix a possible race condition that could arise if multiple instances of
`fetch-debuginfo` are run in parallel. This avoids the same file being
written by multiple processes and being moved early. This avoids a
`FileNotFoundError` and possibly data corruption due to the concurrent
situation.
2024-11-13 09:28:12 +01:00
Giacomo Vercesi 7a01742421 mass-testing: show smallest binaries
Show on the overview page of mass-testing the smallest binary for OOMs
and timeouts, as these are probably show an early sign of some broken
aspect of the pipeline.
2024-11-13 09:28:12 +01:00
Giacomo Vercesi 8773f3bbd6 mass-testing dump-sections: improve --text-size
Improve text-size detection in the case of PE and Mach-O files. In both
cases if a suitable `.text`-like section is not found then the text size
will be the sum of all segments with an executable flag.
2024-11-13 09:28:12 +01:00
Alessandro Di Federico efcea8ae48 importBinary: fix error handling 2024-11-12 18:05:48 +01:00
Alessandro Di Federico ba186a130c s/module.ll/module.bc.zstd/g 2024-11-12 14:58:00 +01:00
Alessandro Di Federico bbd527ae51 DecompileToDirectory: do not emit PTML 2024-11-12 14:28:21 +01:00
Alessandro Di Federico 30f464119e s/module.ll/module.bc.zstd/g 2024-11-11 16:51:18 +01:00
Alessandro Di Federico 7e88fbedfc Merge branch 'feature/shorter-names' 2024-11-07 09:12:32 +01:00
Alessandro Di Federico 24651ac468 Merge branch 'feature/shorter-names' 2024-11-07 09:12:27 +01:00