Commit Graph

223 Commits

Author SHA1 Message Date
Giacomo Vercesi 3e3779498e Implement python interface for revng
Add a python interface (`revng.profile`) for interacting with the rev.ng
infrastructure as a whole; either through the CLI (`CLIProject`) or the
GraphQL API (`DaemonProject`).
2025-05-07 10:48:51 +02:00
Ivan Krysak 79964eac74 Avoid ' misuse in error messages and comments 2025-04-17 16:41:21 +02:00
Ivan Krysak 76ed261375 Use revng_undefined_ instead of init_
Current `init_` prefix used to set the default values of SCVs
is very common in typical code, hence it would cause a lot of
collisions.
2025-04-17 11:19:17 +03:00
Ivan Krysak 0c99d5d5fb IDBImporter: omit unnecessary typedefs 2025-04-17 11:19:17 +03:00
Ivan Krysak b72bcd7dd2 Introduce a basic problem name reporting system 2025-04-17 11:19:17 +03:00
Ivan Krysak 47a1869695 tests: ensure architecture is always available 2025-04-17 11:19:17 +03:00
Ivan Krysak 1383b0a40a Importers: replace .s in section names 2025-04-17 11:19:17 +03:00
Ivan Krysak 433af9ef6e Adopt the new name deduplication pass 2025-04-17 11:19:17 +03:00
Ivan Krysak dce5c1a02c NamingConfiguration: pull more prefixes inside
Unify additional values that used to be hardcoded in the old backend
under the same naming configuration root.
2025-04-17 11:19:17 +03:00
Ivan Krysak f070f1f1e1 Model: sunset double name system 2025-04-17 11:19:17 +03:00
Ivan Krysak 25790b5a78 NameBuilder: change automatic segment name
Use index within the binary instead of address in order to make these
shorter.
2025-04-15 16:35:42 +03:00
Ivan Krysak 50bbcaba1c Sunset name collision tests
Because of the switch to pre-model deduplication, no collisions are
possible, as such, it doesn't make much sense to keep these.
2025-04-15 16:35:42 +03:00
Giacomo Vercesi e634861c1a Implement SyncingManager
Implement the SyncingManager class which wraps the Manager and implements
save syncing features, which comprise autosave and saving via
synchronizers.
2025-04-03 15:59:18 +02:00
Giacomo Vercesi 42f8321f59 Fix S3 storage test
Fix the storage test by converting it from bash to python and also
testing all the occasions where a save should be triggered.
2025-03-28 14:23:10 +01:00
Pietro Fezzardi 9e0f015eb8 Drop old conversion from LLVM to MLIR
The previous conversion from LLVM to MLIR was translating plain LLVM IR
to LLVM MLIR Dialect, as a preliminary step for further conversion from
LLVM MLIR Dialect to Clift.
This is not how things are expected to work anymore, so the old code is
now dead and can be removed.
2025-01-29 23:55:49 +01:00
Pietro Fezzardi 6e17dbed58 Tests: test the prepare-for-clift artifact
This is the initial part of the clift-based decomilation pipeline.
2025-01-29 23:55:49 +01:00
Alessandro Di Federico b576fd1988 CollectFunctions tests: ignore loaded addresses
The tests was testing if a function whose entry address is the target of
load was identified as a function or not (it shouldn't).

This test was passing accidentally. This has not been supported since
the introduction of `RootAnalyzer`.  In order to support this again, we
need to resurrect `processLoadsAndStores`.
2025-01-28 12:19:16 +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 143c315196 Merge revng-c into revng 2024-11-21 10:50:55 +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 30f464119e s/module.ll/module.bc.zstd/g 2024-11-11 16:51:18 +01:00
Ivan Krysak c72abab5e4 Introduce name collision tests 2024-11-06 19:18:53 +02:00
Ivan Krysak 64446d0453 Adopt name builder across the model users 2024-11-06 19:18:53 +02:00
Ivan Krysak 2240da4ffc Improve test documentation 2024-11-06 19:18:53 +02:00
Alessandro Di Federico a48e0f5c93 Rework usage of analyses list 2024-11-04 15:09:56 +01:00
Alessandro Di Federico bd84bd7f2e Rework --analyze and --analyses-list 2024-10-31 17:19:51 +01:00
Giacomo Vercesi 248e642f02 Fix tests due to module.ll format change
`module.ll` is now a zstd-compressed bitcode file. Change the tests
where it relied on the module being LLVM IR by decompressing and
disassembling the input on the fly.
2024-10-30 10:28:08 +01:00
Alessandro Di Federico bf9ef91f4e Drop revng model import binary 2024-10-16 11:46:56 +02:00
Ivan Krysak 94d860e2b2 Clean up builder configuration
This also re-enables stack inlining by default.
2024-10-15 10:45:13 +03:00
Ivan Krysak 1a35cbcb77 Introduce PTMLCTypeBuilder 2024-10-15 10:45:13 +03:00
Alessandro Di Federico 8ca6a0739d precedence.c.filecheck: fix argument names
Due to a bug fix in revng, we're now having arguments in a different
(correct) order. Let the test reflect this.
2024-10-01 11:52:33 +02:00
Alessandro Di Federico 77ed34e633 Minor fixes to tests
Some of these changes are due to non-determinism.
We should find a more appropriate fix next time.
2024-09-27 10:35:10 +02:00
Ivan Krysak b4a6682a3e OperatorPrecedence: introduce forced parentheses 2024-09-10 11:49:42 +03:00
Ivan Krysak d52d8f153c Introduce basic operator precedence testing 2024-09-10 11:49:42 +03:00
Ivan Krysak a8b5ebdd95 import-from-c: rework testing from the ground up 2024-09-04 16:55:49 +02:00
Ivan Krysak f7fa47fc72 HeaderToModel: add size tag to the other tests 2024-09-04 13:04:44 +03:00
Alessandro Di Federico d28af50f84 DetectStackSize: handle counted loops 2024-08-23 18:01:47 +02:00
Alessandro Di Federico f83f40078c Invalidation tests: relax
At this stage, certain artifacts are invalidated by any change, even an
empty one.
2024-07-10 16:19:26 +02:00
Alessandro Di Federico 3c839cb821 Pipe::mutableContainers: use running containers 2024-07-09 08:58:51 +02:00
Pietro Fezzardi e1b5541462 DLA: depotentiate SimplifyInstanceAtOffset0
The DLAStep SimplifyInstanceAtOffset0 now only triggers if the parent
node has the child-at-offset-0 node as its only successor, or when the
child-at-offset-0 doesn't have other predecessors.

Doing this guarantees that it's impossible for another predecessor of
the child-at-offset-0 to start seeing memory accesses that were
initially relative to the parent.

This condition is slightly more restrictive than the previous one, but
it takes into consideration some far reaching consequences.
If SimplifyInstanceAtOffset0 aggressively like we did before, DLA can
end up inferring types in some memory locations, like executable
segments, for which there aren't clues in the binary.
This isn't bad per se, but if DLA does that, the newly recovered type is
identified as non-executable data, causing misdecompilation because
rev.ng doesn't decompile memory regions that it understands as non
executable.

This commit, making SimplifyInstanceAtOffset0 less aggressive, makes it
play better with the rest of the assumptions of the decompilation
pipeline.

It also relaxes a decompilation test that was previously working by
chance and that was effectively beyond the current expressive power of
reasoning for DLA at the moment.
2024-07-05 00:43:45 +02:00
Pietro Fezzardi 19d43cde1d Partially re-enable end-to-end tests
End-to-end tests were disabled due to a bug in ModelToHeader that caused
the decompiled C header with the types not to be recompilable in some
cases.

However, the commit that disabled the tests was too aggressive, because
the only part that needed to be disabled was the part of the tests that
actually recompiled the C code.

This commit re-enables the end-to-end tests except for the recompilation
part, that will be re-enabled after the bug in ModelToHeader is fixed.
2024-07-04 02:56:31 +02:00
Ivan Krysak 22b9a4db74 Restore an accidentally deleted test 2024-06-30 19:36:48 +02:00
Ivan Krysak aed53c943c linked-lists: re-enable compute return value 2024-06-27 11:07:02 +02:00
Ivan Krysak 94a0ad6b93 Adopt reworked model::Type 2024-06-27 11:07:01 +02:00
Ivan Krysak 3705906074 Model: rename Type into TypeDefinition 2024-06-27 11:07:01 +02:00
Ivan Krysak b72e2fd87b Model: allow omission of void size 2024-06-27 11:05:52 +02:00
Ivan Krysak dfa7478685 Adopt reworked model::Type 2024-06-27 11:05:51 +02:00
Ivan Krysak ac587cbb4f Model: rename Type into TypeDefinition 2024-06-27 11:05:48 +02:00
Ivan Krysak b2959e36df Minor improvements 2024-06-27 11:05:48 +02:00