Commit Graph

2743 Commits

Author SHA1 Message Date
Alessandro Di Federico e9470d6329 Pipeline: improve naming and docs 2023-08-01 12:17:20 +02:00
Alessandro Di Federico 14525d91f5 Adopt llvm::Task 2023-08-01 10:51:16 +02:00
Alessandro Di Federico b188f91863 Introduce ContainerToTargetsMap::size() 2023-08-01 10:51:15 +02:00
Alessandro Di Federico 2c8c06e4ab Introduce ProgressListeners 2023-08-01 10:49:41 +02:00
Alessandro Di Federico abff5649b8 Merge branch 'feature/improved-navigation-and-look' 2023-07-31 16:05:53 +02:00
Giacomo Vercesi 9ea7d361f6 BinaryCrossRelations: fix mime type
Change the mime type of `BinaryCrossRelations` to `text/x.yaml`, so that
it's not base64-encoded when transmitting over GraphQL.
2023-07-31 16:05:52 +02:00
Giacomo Vercesi 2a99f50040 revng-model.ts: allow individual serdes
Allow the serialization and deserialization of individual model objects,
this is useful when these need to be exchanged individually across an
IPC boundary.
2023-07-31 16:05:52 +02:00
Giacomo Vercesi f77d4d6d1f PTML: introduce data-scope-location
Introduce the new `data-scope-location` tag that's to be used for
switching between C and ASM. Include the tag when generating ASM
instructions.
2023-07-31 16:05:51 +02:00
Giacomo Vercesi db7ad24175 PipelineManager: add produceTargets with checks
Move much of the logic of `rp_manager_produce_targets` to a method
inside `PipelineManager`, add additional checks for the existence of the
targets that are requested to be produced.
2023-07-31 16:05:51 +02:00
Giacomo Vercesi 7e96bb2189 revng.api: avoid NULL dereferencing in extract
The call to `rp_container_extract_one` can return a null pointer, add a
check that allows to avoid dereferencing it if this happens.
2023-07-31 16:05:51 +02:00
Alessandro Di Federico db6c6b1f90 Merge branch 'feature/hex-dump-container' 2023-07-31 14:19:10 +02:00
Kacper Kołodziej 46e9ea0e10 HexDump implementation
HexDumpPipe dumps content of binary file in the similar way as hexdump
tool with addition of PTML markup for instructions addresses.

Continuous parts of binary code are wrapped with <span
data-location-definition=""></span> where data-location-definition
attribute contains Entry/BasicBlock/Instruction addresses in generic
form. <span> tags can be nested if byte(s) belong to many instructions
in code.

At the end of the line every <span> is closed and opened on the next
line again if it still applies to the next byte.

MetaAddress are converted to IntervalMetaAddress (which implements own,
optional-less operator-) and stored in boost::icl::intruval_map. This
map is used to get addresses of instructions to which each byte belongs.
2023-07-31 11:29:41 +02:00
Kacper Kołodziej c0f226fa70 Add const qualifiers to some functions
getJumpTargetBlock takes llvm::BasicBlock * as argument, but doesn't
need to modify it, so const it adds const to it and other functions that
are used by getJumpTargetBlock: findJumpTarget, isTranslated, getType,
isJumpTarget.
2023-07-31 11:29:40 +02:00
Kacper Kołodziej 7bec0190e8 Fix spelling in docstring 2023-07-31 11:29:40 +02:00
Giacomo Vercesi 878f9efcc8 daemon/test.py: change output capture
Change the way the tests capture the output of the daemon from `PIPE`
to `TemporaryFile`, as the latter avoids deadlocks related to the use of
the `Popen.wait` function in conjunction with `PIPE`.
2023-07-31 10:34:43 +02:00
Alessandro Di Federico aac84a8523 Merge branch 'feature/mass-testing-fixes' 2023-07-26 16:17:30 +02:00
Alessandro Di Federico 8ca44dc32a for-propagated-prototypes: disable debug-info 2023-07-26 13:39:10 +02:00
Alessandro Di Federico 8e213ade74 TypeShrinking: shrink zext(value) == constant 2023-07-26 10:16:25 +02:00
Alessandro Di Federico 6ed958d614 Improve TypeShrinking
This commit fixes a TypeShrinking bug and extends it to better handle
more instructions. Specifically, we now handle shift left, select, phi
and bitwise operations.
2023-07-26 10:16:25 +02:00
Alessandro Di Federico e0c7038f46 Rework RootAnalyzer::optimize pipeline
This commit reorganizes and explains the reasoning behind the design of
the RootAnalyzer optimization pipeline.
2023-07-26 10:16:25 +02:00
Alessandro Di Federico 99fec2cb10 AdvancedValueInfo: improve logging 2023-07-26 10:16:25 +02:00
Alessandro Di Federico dcc7ca3c6b AdvancedValueInfoMFI: zero-extend constraints
This commit introduces a change in AdvancedValueInfoMFI which forces to
consider constraints valid on 32-bit values to be valid on their
untruncated 64-bit counterparts.

While being unsound, this is important to easily devirtualize indirect
branches on 64-bit architectures where often constraints are expressed
on 32-bit switch values.
2023-07-26 10:16:25 +02:00
Alessandro Di Federico 259d64fc59 MFP::getMaximalFixedPoint: name return result type 2023-07-26 10:16:25 +02:00
Alessandro Di Federico 43baa73149 DOTGraphTraits<MFP::Graph>: improve HTML handling 2023-07-26 10:16:25 +02:00
Alessandro Di Federico a24f3479ca JumpTargetManager::readFromPointer: fix unmapped
This commit introduces a fix to correctly handle trying to read from an
unmapped region.
2023-07-26 10:16:25 +02:00
Alessandro Di Federico ee335eadf1 GraphTraits: improve handling of const MFP::Graph
Improve the handling of const MFP::Graph in GraphTraits and
DOTGraphTraits.
2023-07-26 10:16:25 +02:00
Alessandro Di Federico d4d9e5dac5 DropRangeMetadataPass: preserve all analyses 2023-07-26 10:16:25 +02:00
Alessandro Di Federico 537e25e440 TypeShrinking.h: add missing header 2023-07-26 10:16:25 +02:00
Alessandro Di Federico 73a7041396 Introduce GenericGraph::verify 2023-07-26 10:16:25 +02:00
Alessandro Di Federico a552bb1920 ConstantRangeSet: introduce size manipulation API 2023-07-26 10:16:25 +02:00
Alessandro Di Federico 1d53bf4696 Introduce getLLVMIntegerTypeFor 2023-07-26 10:16:25 +02:00
Alessandro Di Federico 0b5404b8ac AdvancedValueInfo: include MFP's DOTGraphTraits
The fact we were missing this include led to dump mute graphs.
2023-07-26 10:16:25 +02:00
Alessandro Di Federico 22b3da2a02 Remove {DataFlow,ControlFlowEdges}Graph::Base 2023-07-26 10:16:25 +02:00
Djordje Todorovic 60ebfa950d VerifyHelper: Remember the reason of fail
In some cases we want to know what was the reason of some error
without crashing the revng.
2023-07-24 09:22:07 +02:00
Djordje Todorovic 0e176f3147 Support for uint64_t in pipeline analyses options 2023-07-24 09:22:07 +02:00
Alessandro Di Federico 4daa8e68d6 Merge branch 'feature/comments-in-the-model' 2023-07-21 17:25:26 +02:00
Ivan Krysak 2136e05115 Fix a nasty issue caused by an uninitialized flag 2023-07-21 17:25:24 +02:00
Ivan Krysak 19138353f7 abi::FunctionType: preserve return value comments 2023-07-21 17:25:24 +02:00
Ivan Krysak 11c221299e Yield: add the function comment to assembly view 2023-07-21 17:25:24 +02:00
Ivan Krysak ed4efb0bd9 yield::ptml: add functionComment function 2023-07-21 17:25:24 +02:00
Ivan Krysak 18204ccb9f yield::ptml: add comment function
This is a generic way to format an arbitrary type with `Comment`
field as a comment and emit it using PTML.
2023-07-21 17:25:24 +02:00
Ivan Krysak 4654e4ef74 Ranks: introduce ranks for function arguments 2023-07-21 17:25:24 +02:00
Ivan Krysak 888b083248 Model: introduce edit path helpers for comments 2023-07-21 17:25:24 +02:00
Ivan Krysak 5c31405e63 Model: rework edit path helpers from the ground up 2023-07-21 17:25:24 +02:00
Ivan Krysak 0c8a5aaffb Model: move edit path helpers in from PTML 2023-07-21 17:25:24 +02:00
Ivan Krysak 8fb21693cc CompileTime: improve documentation 2023-07-21 17:25:24 +02:00
Ivan Krysak a012c752e2 CompileTime: introduce selection helper template 2023-07-21 17:25:24 +02:00
Ivan Krysak b2506d8f4b STLExtras: separate compile time helpers 2023-07-21 17:25:24 +02:00
Ivan Krysak 70a5c8edd0 Model: make metadata utilities more generic 2023-07-21 17:25:24 +02:00
Ivan Krysak 560ed4f55e Model: add ReturnValueComment field to functions 2023-07-21 17:25:24 +02:00