Commit Graph

500 Commits

Author SHA1 Message Date
Alessandro Di Federico d28af50f84 DetectStackSize: handle counted loops 2024-08-23 18:01:47 +02:00
Alessandro Di Federico b096da3b4b revng-c-pipelines.yml: add early-type-shrinking 2024-07-10 17:24:56 +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
Pietro Fezzardi dfe3f4cb47 Rename revng C headers for decompiled code
Strip away the 'revng-' prefix from the filename.
2024-06-27 17:26:18 -04:00
Pietro Fezzardi d72139357f Add DecompileToDirectoryPipe
This pipe decompiles all the C code in a single directory, packaged up
as a .tar.gz file.
2024-06-27 17:26:18 -04:00
Pietro Fezzardi a12b621832 Add CleanupIRPass 2024-06-27 17:14:28 -04:00
Pietro Fezzardi a1bc9b10f4 Add emit-recompilable-archive artifact to doc 2024-06-27 22:10:01 +02:00
Alessandro Di Federico e7c4952377 Add cleanup-ir to docs 2024-06-27 22:10:01 +02:00
Ivan Krysak 74f56bcd93 Introduce a broken debug info removal pass 2024-06-27 11:07:02 +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 db6254c50e rcc: treat *.inc as c plus plus files 2024-06-27 11:05:52 +02:00
Ivan Krysak b72e2fd87b Model: allow omission of void size 2024-06-27 11:05:52 +02:00
Ivan Krysak cd36ef1963 Update the docs 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 ee238fd473 RCC: allow prettier to print errors 2024-06-27 11:05:49 +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
Alessandro Di Federico 2aa4812ca0 end-to-end.yml: disable check-decompiled-c
This is a temporary change.
2024-06-27 10:13:49 +02:00
Pietro Fezzardi 85340c8d84 ModelToHeader: disable type inlining by default
This is due to the fact that type inlining currently is broken in some
corner cases involving recursive types.
The bugs are caused by the fact that TypeInlineHelper uses its own
custom graph instead of using the DependencyGraph used by ModelToHeader,
causing different decisions about the order of emission of types.
As a result, the generated C types are not valid C, and they fail to
compile because a field of a struct has a type that is defined later
than its use.

After refactoring TypeInlineHelper to use DependencyGraph like
ModelToHeader, this can be reverted.
2024-06-26 12:21:58 +02:00
Alessandro Di Federico aaba2f7d0f segregate-stack-accesses.yml: adopt --debug-names 2024-06-26 12:21:58 +02:00
Alessandro Di Federico f231e19a5f decompilation.yml: remove test duplication 2024-06-26 12:21:58 +02:00
Alessandro Di Federico 398681c5ce Introduce tests for invalidation 2024-06-25 09:50:38 +02:00
Alessandro Di Federico 6e49fed965 FunctionMetadata::{ControlFlowGraph,Blocks} 2024-06-20 10:24:51 +02:00
Alessandro Di Federico d859db08a4 Fix tests 2024-06-20 10:24:51 +02:00
Alessandro Di Federico bce1d6c0f3 Adopt invalidation along the core pipeline 2024-06-20 10:24:50 +02:00
Alessandro Di Federico b5f7576573 Rework TupleTreeGenerator tracking 2024-06-20 10:24:50 +02:00
Alessandro Di Federico b350d12ad2 TTG: spread some optional: true around 2024-06-20 10:24:49 +02:00
Alessandro Di Federico 5186a58053 s/FunctionMetadata/ControlFlowGraph/ 2024-06-18 17:56:24 +02:00
Pietro Fezzardi 80663458bb Pipeline: add loop-rotate, to match do-while loops 2024-06-06 11:27:48 +02:00
Pietro Fezzardi 19e3818521 Make test for implicit C casts more robust
Before this commit, the test was implicitly relying on control-flow
recovery and on the specific order of the then/else scopes in an
if-statement.

This commit relaxes that requirement, since it's not part of what the
test is designed to test.
2024-05-30 12:00:50 +02:00
Djordje Todorovic 6d31e1c0a9 Add test for simplify-switch 2024-05-29 16:27:52 +02:00
Djordje Todorovic 6941df12a3 Add SimplifySwitch Pipe 2024-05-29 16:27:52 +02:00
Djordje Todorovic 6349299806 docs: Add simplify-switch artifact 2024-05-29 16:25:53 +02:00
Djordje Todorovic 46946df1d3 Adjust x86_64 collect-cfg test 2024-05-29 16:25:53 +02:00
Lauri Vasama ba58ec8edb Add import-clift-types pipe 2024-05-29 15:43:35 +02:00
Lauri Vasama ba914a1bb5 Replace MLIR container and LLVM import pipe 2024-05-29 15:43:35 +02:00
Lauri Vasama e2f3f31093 Introduce RawFunctionType::Architecture 2024-05-29 15:43:35 +02:00
Lauri Vasama 4636bb736f Fix MIME types documentation 2024-05-29 15:42:15 +02:00
Alessandro Di Federico 84e3fac538 Minor changes 2024-05-29 12:06:03 +02:00
Alessandro Di Federico f35ca5efc2 for-collect-cfg.yml: make tests more robust 2024-05-22 10:25:25 +02:00
Alessandro Di Federico 738da4fbb5 Minor changes 2024-05-22 10:25:25 +02:00
Alessandro Di Federico 9eb4726989 decompilation.yml: split off revng-c.decompilation 2024-05-21 09:44:04 +02:00
Alessandro Di Federico 22c97bce6b Drop model::Segment::Sections 2024-05-21 09:44:04 +02:00
Djordje Todorovic 0f46ec5578 Add tests for C cast expressions 2024-05-16 17:57:22 +02:00