Commit Graph

987 Commits

Author SHA1 Message Date
Giacomo Vercesi 08c53ecdde FunctionControlFlowGraphSVG is now a FunctionKind 2022-07-28 08:43:07 +02:00
Massimo Fioravanti da30cf9e99 Pipeline: add read-only containers 2022-07-25 16:24:27 +02:00
Davide Depau 363fa21fe0 Introduce PipelineC API shutdown method 2022-07-22 21:04:03 +02:00
Davide Depau 4c0576c1e4 Set custom crash error message 2022-07-22 21:04:03 +02:00
Davide Depau 4f06a26105 Introduce CLI initialization utility 2022-07-22 21:04:03 +02:00
Antonio Frighetto 186d907be3 Model: extend model::Segment
`Segment` now includes a `Type` of struct kind. This is intended to
emit the segment as a struct later in decompilation. The implementation
of name has also been added.
2022-07-22 16:10:51 +02:00
Giacomo Vercesi 80afd71721 Add singleTargetFilename to pipelines
A step's artifacts now include singleTargetFilename, which gives a
suggested filename to use when a single element is extracted from the
underlying container.
2022-06-29 14:50:58 +02:00
Giacomo Vercesi 2df691535d Pipeline: Make recalculateAllPossibleTargets
`recalculateAllPossibleTarget` is now a private member of
PipelineManager This was done since all calls that can trigger a change
in the target list have been isolated and the call is done implicitly.
This removes rp_manager_recompute_all_available_targets from PipelineC,
since it was added as a stopgap until the above was implemented.
2022-06-29 14:50:58 +02:00
Giacomo Vercesi 487af0f4b0 Do not pass file paths to revng from PipelineC
Allow deserializing containers from a byte string rather than pointing
to a file, this allows revng to have an opaque workdir.
2022-06-29 14:50:58 +02:00
Giacomo Vercesi 05dc27715d Improve pipeline saving capabilities
This commit introduces some changes to how the revng pipeline handles
serializing to disk. Specificaly:

* Pipeline globals (specifically model.yml) are better handled if they
  are in a subdirectory. They are now saved in the "context"
  subdirectory.
* In python:revng.api the pipeline is serialized whenever there is a
  non-reproducible change to the state (e.g. binary upload or model
  change).
  In the case of analyses this is done conservatively by checking that
  the diff produced is not empty.
* The logic for computing a step's subdirectory has been moved to the
  pipeline runner, consequently if a step is asked to serialize it
  will not create any subdirectories.
* Functionality for saving a single step/context has been exposed in
  Pipeline C.
* Finally, all path concatenations are now handled by
  llvm::sys::path::append, for extra os-agnosticism.
2022-06-29 14:50:58 +02:00
Massimo Fioravanti 93ccd83f6e Fix: llvm merge back crash
merge back now relies on modifying linkage rather than
OverrideFromSources
2022-06-22 18:10:47 +02:00
Massimo Fioravanti 726caad82b pipeline::Target: fix infinite loop due to typo 2022-06-22 18:10:47 +02:00
Alessandro Di Federico f4684e244d Switch to new testsuite 2022-06-20 19:04:18 +02:00
Massimo Fioravanti 55fb87b268 PipelineC: introduce dead kinds
We need to prevent stub kinds used just to represent dead elements to be
displayed in the GUI and CL.
We do so by introducing a DeadKind which expands their targets to the
empty list.
2022-06-20 19:03:17 +02:00
Ivan Krysak 7e538776d4 Outline sugiyama style layouter interface 2022-06-15 16:04:44 +03:00
Ivan Krysak 7591788620 Implement node size calculation 2022-06-15 16:04:44 +03:00
Ivan Krysak 840a34c0a4 Implement CFG extraction 2022-06-15 16:04:44 +03:00
Ivan Krysak 71f2ea6b22 Outline yield::Graph 2022-06-15 16:04:44 +03:00
Ivan Krysak d3afdc47bb Outline yield::cfg::Configuration 2022-06-15 16:04:43 +03:00
Ivan Krysak 5b49873523 Move delay slot control down to basic block level 2022-06-15 16:04:43 +03:00
Ivan Krysak b19663e439 Implement labeled block detection 2022-06-15 16:03:45 +03:00
Ivan Krysak de9861815a Move fallthrough detection to yield::cfg 2022-06-15 16:02:44 +03:00
Ivan Krysak 80e9243e06 Add a basic CFG pipeline 2022-06-15 15:52:26 +03:00
Ivan Krysak f536ba46f0 Separate process-assembly from yield-assembly 2022-06-15 15:52:25 +03:00
Ivan Krysak 832a8d0baa Use TTG-based assembly to weaken dependency on efa 2022-06-15 15:52:23 +03:00
Ivan Krysak 74764f9729 Switch to TTG-based assembly description 2022-06-15 15:52:00 +03:00
Ivan Krysak f26ee02029 Use tuple tree generator for assembly description 2022-06-15 15:51:23 +03:00
Ivan Krysak 49d0c316a0 Implement GenericGraph-based CFG exporter 2022-06-15 15:51:18 +03:00
Ivan Krysak 04efcb8ed8 Drop the revng yield .* tools 2022-06-14 18:55:59 +03:00
Ivan Krysak bc775a91b4 Improve the String wrapper 2022-06-14 18:55:59 +03:00
Ivan Krysak 150fab6bbc Fix a minor pipeline::Target construction issue 2022-06-14 12:40:11 +03:00
Ivan Krysak 257bcb9b3c Make MetaAddress constexpr constructible 2022-06-14 12:40:11 +03:00
Ivan Krysak dffe311ad8 Add efa::FunctionEdgeType::needsFallthrough 2022-06-14 12:40:11 +03:00
Massimo Fioravanti 22bce466b1 revng-pipeline: support handles multiple branches
This commit introduces the possibility to have multiple pipeline
branches in a single YAML pipeline file.
2022-06-13 18:34:03 +02:00
Giacomo Vercesi 7052f2a8a0 Support analyses and globals in Python
This commit adds the newly implemented functionality in PipelineC both
in revng.api and the graphql api, allowing:

* retrieval of global variable names
* unwrapping of a single target
* execution of analyses
2022-05-24 10:56:02 +02:00
Massimo Fioravanti 1508a1bc72 revng-pipeline: support out of line analyses 2022-05-24 08:59:08 +02:00
Massimo Fioravanti e38dfc74cc PipelineC: introduce run_all_analyses 2022-05-24 08:59:08 +02:00
Massimo Fioravanti f0a5ffe3b3 revng-pipeline: globals, extractOne and analyses 2022-05-24 08:58:48 +02:00
Massimo Fioravanti 2c48713af9 Make TupleTreeDiff compatible with regular vectors 2022-05-24 08:50:24 +02:00
Pietro Fezzardi 1bb5bd6eee ModelGlobal: don't move the underlying model::Binary
Moving it was causing the address of the model to change, while for the
functionality of revng-pipeline we need it to be stable.

So we pay the price of expensive copy, for the sake of downstream
stability.
2022-05-12 16:59:47 +02:00
Pietro Fezzardi 741d55279b TupleTree: add copy-constructor and -assignment
The copy of a TupleTree is potentially very expensive, so it was
disabled until now and only allowed via the explict method clone().

We have now decided to make TupleTree copiable.
This commit adds a copy-constructor and a copy-assignment, killing the
clone() method that was already unused and is now effectively useless.
2022-05-11 16:16:49 +02:00
Pietro Fezzardi b190f1a47c Refactor logic to compact function targets
This commit introduces a reusable function to compact
pipeline::TargetLists that represent functions.

Initially this reasoning was only needed by TaggedFunctionKind, but now
also FunctionStringMap needs it, and potentially others in the future,
so it makes sense to keep only a single implementation for it instead of
duplicating code (and likely bugs).
2022-05-11 16:16:49 +02:00
Pietro Fezzardi ca566a76f0 Rename StringMapContainer to FunctionStringMap
This new naming more closely describes the fact that each element in the
map must be associated with a model::Function
2022-05-11 16:16:32 +02:00
Pietro Fezzardi bce0bd70b1 StringMapContainer: fix enumeration for * target 2022-05-11 14:52:22 +02:00
Pietro Fezzardi 2dea29d926 StringMapContainer: use multiline strings in YAML 2022-05-11 14:39:31 +02:00
Pietro Fezzardi 0f4df96ad6 Mark some dump() methods as debug_function 2022-05-11 14:39:31 +02:00
Pietro Fezzardi bfe67413d3 StringMapContainer: find() and contains() methods 2022-05-11 14:39:31 +02:00
Pietro Fezzardi 1c6dac225a Add dedicated non-generated TypeKind.h header
This is necessary because now QualifiedType.h needs TypeKind, but
including Type.h directly would result in a circular dependency between
Type.h and QualifiedType.h
2022-05-11 14:39:31 +02:00
Giacomo Vercesi 8a61d7c2b9 Model/ABI.h: make doc fields multiline 2022-05-09 13:35:10 +02:00
Ivan Krysak 282b4e238d Add yield-assembly pipeline 2022-05-06 18:51:47 +02:00