Commit Graph

6113 Commits

Author SHA1 Message Date
Giacomo Vercesi aa09b17964 PipelineC: fix rp_container_extract_one
To keep consistency with the rest of PipelineC, return `nullptr` when
calling `rp_container_extract_one` when the content of the specified
target hasn't been produced
2023-02-07 16:54:35 +01:00
Giacomo Vercesi aa344d4122 revng daemon: add -b none
Add the `-b none` option to `revng daemon` that allows disabling any
automatic bind
2023-02-07 16:54:35 +01:00
Giacomo Vercesi 23cd7f871a revng daemon: fix project-id checking
Fixes the regex that's used to check if the project ID is valid
2023-02-07 16:54:35 +01:00
Giacomo Vercesi 1e1d3b4920 rcc: fix off-by-one in line reporting 2023-02-07 16:54:35 +01:00
Pietro Fezzardi 72b32dafa2 MakeModelGEP: array accesses jumping many elements
Before this commit we couldn't handle gracefully situations where the
model had an array with elements of given size X and the IR had strided
accesses with a stride Y that was larger than X.

This commit gracefully handles that case, but for now it always bail
out.

In the future we could think of handling this better if Y is a multiple
of X.
2023-02-07 08:12:42 +01:00
Alessandro Di Federico a910d3b5c9 Merge branch 'feature/import-types' 2023-02-06 17:14:33 +01:00
Antonio Frighetto 69e8615c9f Introduce test for Segment.Type importing 2023-02-06 12:08:18 +01:00
Antonio Frighetto ab36efca8d Model: import data objects in Segment.Type 2023-02-06 12:08:18 +01:00
Alessandro Di Federico b89c3e9332 Merge branch 'feature/no-error-list-preliminaries' 2023-02-06 09:37:52 +01:00
Antonio Frighetto 87dec68f24 Pipeline: refine overestimated targets
A logic issue was addressed in `Runner::getDiffInvalidations`.
Premature invalidation of all targets (overestimated targets
found by `getInvalidations`) could lead to an error due to
lack of those targets (do not exist yet). We make sure that
such targets exist before providing them to the pipeline.
2023-02-06 09:37:23 +01:00
Antonio Frighetto 7c671ed6de TupleTreeDiff: evict cached references in apply
As the input model requires to be mutable, `evictCachedReferences`
is needed in order to invalidate cached references.
2023-02-06 09:37:23 +01:00
Antonio Frighetto 15fcf98446 ProcessCallGraph: fix access to Metadata
A logic issue existed in the Pipe, as it was mistakenly relying on
`IsolatedRoot` instead of the isolated function. That was breaking
things if those functions were to be removed. This issue has been
addressed by correcting the behaviour of the Pipe.
2023-02-06 09:37:23 +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
Antonio Frighetto 2d086e04a1 Context: fix entry in containsReadOnlyContainer
`ReadOnlyContainers` is defined to be a `llvm::StringMap`
of a further `llvm::StringMap` of `std::unique_ptr`s of
`ContainerBase`. A logic issue has been addressed by
properly dereferincing the inner map.
2023-02-06 09:37:23 +01:00
Antonio Frighetto 8ca4c4c6ea Runner: bail out with no requests target 2023-02-06 09:37:23 +01:00
Antonio Frighetto 308d8ee8a3 Loader: associate container name to its role
`Container` names were mistakenly associated to the name
of their declaration. This has been fixed by associating
them to their `Role`.
2023-02-06 09:37:23 +01:00
Antonio Frighetto c91a44363a Yield: split internal pipes off
A cyclic dependency between shared objects `revngYield` and
`revngFunctionIsolation` could exist if `FunctionIsolation`
were to use `yield`-defined methods. This has been prevented
by splitting pipes off within `Yield`.
2023-02-06 09:37:23 +01:00
Massimo Fioravanti 9432399254 Introduce ApplyDiffAnalysis 2023-02-06 09:37:23 +01:00
Antonio Frighetto ea0a06a876 revng.daemon: accept no arguments for analysis
Let GraphQL accept zero or more parameters for analyses.
2023-02-06 09:37:23 +01:00
Massimo Fioravanti dad043027d Rework and EFA yield cross relations
Yield and EFA shared the same namespace, this commits splits them and
introduces tuple tree containers as well.
2023-02-06 09:37:23 +01:00
Antonio Frighetto c5d9a4d787 Introduce helper for location conversion 2023-02-06 09:37:23 +01:00
Antonio Frighetto c3480b6f9b CLOption: improve isSet for a cl::opt<T>
A logic issue existed when validating whether a `cl::opt<T>`
was set. This has been addressed by replacing `isDefaultOption`
method with `getNumOccurrences`, as the former one was not
meant to be used for checking if the option was set or not.
Likewise, the default Option itself is written to a `std::string`,
in method `get`; the latter is leveraged by `Invokable`.
2023-02-06 09:37:23 +01:00
Alessandro Di Federico c7ade9595c Merge branch 'feature/debug-info' 2023-02-02 15:27:01 +01:00
Djordje Todorovic a48e518467 Introduce AttachDebugInfo pass 2023-02-02 15:26:44 +01:00
Djordje Todorovic eb6849045d FunctionMetadataCache: split an assert 2023-02-02 15:26:26 +01:00
Djordje Todorovic 3365a626df LLVMContainer: avoid copying !dbg to declarations 2023-02-02 15:26:18 +01:00
Pietro Fezzardi 04d877a992 TypeSystemPrint: fix print without stack type 2023-02-02 14:49:46 +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
Giacomo Vercesi b4c1cd94e1 revng-daemon: preserve more signals
Add more signals to be handled from python rather than LLVM.
2023-02-01 17:46:19 +01:00
Andrea Gussoni 26a717a4ac Compute weight for untangle regions once
Compute the weight of collpased regions the first time it is requested
and cache it, and use the cached value for all successive queries.
This also prevents a bug which occurs when we query the weight two
times for the same collapsed node, whose related collapsed region object
has been in the meantime destroyed by the tiling process.
2023-02-01 09:56:36 +00:00
Andrea Gussoni ebe0729332 Improve debug graphs for collapsed nodes
Integrate the debug graph serialization for collapsed nodes in the
RegionCFG.
2023-01-31 17:25:27 +00:00
Andrea Gussoni ca540399d4 Ensure that no backedges are left
Ensure that no backedges are left after the restructuring of all the
metaregions.

This additional assertion should help ensuring that no entries in the
`Backedges` set are left after the restructuring process, in turn making
it easier to spot bugs if backedges references are not handled correctly
during the steps of the restructuring.
2023-01-31 11:55:52 +01:00
Pietro Fezzardi f0573995ba MakeModelGEP: use branch-and-bound approach
Before this commit, MakeModelGEPPass was materializing all possible
traversals of the type system to select the best match for translating
some pointer arithmetic on the IR into ModelGEPs.

This proved to be very slow and to do a lot of useless computation on
larger binaries with big type systems.

This commit partially rewrites MakeModelGEPPass to adopt a
branch-and-bound approach to only explore paths on the type system that
have some chance of improving the best match.
2023-01-31 11:39:28 +01:00
Alessandro Di Federico 4a7ccfd68e Merge branch 'feature/fix-fetch-debuginfo' 2023-01-27 21:52:42 +01:00
Djordje Todorovic 8f95f14f12 CrossModelFindType: consider ExportedNames 2023-01-27 17:54:08 +01:00
Djordje Todorovic fec0ec7034 Model: add ExportedNames for local Functions 2023-01-27 17:54:06 +01:00
Djordje Todorovic 55d098b994 DwarfImporter: parse DW_AT_ranges 2023-01-27 17:54:03 +01:00
Djordje Todorovic 83905cf5ed Fix the level for FetchDebugInfo 2023-01-27 17:53:47 +01:00
Alessandro Di Federico 925fae4c4f Merge branch 'feature/fix-idb-importer' 2023-01-27 17:51:46 +01:00
Djordje Todorovic 22ba1800c5 idb: fix generation of empty structs and unions
There was a log message that we are creating typedef void* for empty
structs, but we have missed that piece of code. This patch adds that
logic.

In the case of unions, we completely ignored empty ones, and also
there was not handling if the type was generated by ordinal (as
in the case of structs). This patch also fixes it.
2023-01-27 17:49:11 +01:00
Djordje Todorovic 3e75c09da0 dropTypesDependingOnTypes: purge from Function too
This commit ensure that, not only we drop `model::DynamicFunction`s
depending on an invalid type, but `model::Function`s are dropped too.
2023-01-27 17:48:19 +01:00
Djordje Todorovic 0f7c473cf3 FixModel: factor out logic of type deletion 2023-01-27 17:46:23 +01:00
Djordje Todorovic 5be245c971 FixModel: filter zero-sized fields 2023-01-27 17:46:21 +01:00
Djordje Todorovic e1b070f2da FixModel: filter out empty arrays 2023-01-27 17:46:18 +01:00
Pietro Fezzardi 4e1fb3a854 DLA: fix CompactCompatibleArrays
Before this commit, the dla::Step CompactCompatibleArrays was
occasionally generating artificial nodes that were larger than the inner
data, forcing their size to Stride - AvailableSlack.
This commit fixes the problem keeping track of the actual size that is
consumed in the array element, and forcing the size of the artificial
nodes to that.
2023-01-24 16:50:42 +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
Alessandro Di Federico bf20a83268 revng-pipeline: reduce dependencies 2023-01-21 18:56:22 +01:00
Alessandro Di Federico 4929f201d1 script/revng: fix detection of packages directory 2023-01-21 16:46:35 +01:00
Alessandro Di Federico 7913bf9e58 Disable LeakSanitizer 2023-01-21 16:46:35 +01:00