Commit Graph

2752 Commits

Author SHA1 Message Date
Giacomo Vercesi 0e9c49e471 tests: add revng graphql
Add a run of `revng graphql` among the tests being run. This
leverages the new Component property to filter out any unwanted
artifacts from being produced.
2023-08-23 16:47:33 +02:00
Giacomo Vercesi c482951946 Add components to revng cli driver
This commit introduces the concept of `Component` to a pipeline step.
This, in turn, can be used by clients to figure out which artifacts are
produced by which revng component.
Additionally, this commit overhauls the `revng daemon-self-test`
command, renaming it to `revng graphql` and adding extra flexibility.
2023-08-23 16:47:30 +02:00
Giacomo Vercesi 1416acc8f5 revng.cli: centralize collect_pipelines
Move the logic that collects all the pipeline files to a cental
implementation.
2023-08-23 16:47:30 +02:00
Giacomo Vercesi 57eae2bc96 Drop hard-coded analyses list
Remove any use of hard-coded analyses lists, relying on user interaction
(e.g. command-line arguments) to have it instead.
2023-08-23 16:47:30 +02:00
Giacomo Vercesi e3dc5357ad revng.test-daemon: only run for with-debug-info
Run the `revng.test-daemon` test only with a debug-info executable in
order to reduce the overall test time.
2023-08-23 16:47:30 +02:00
Pietro Fezzardi 4003269e17 revng analyze: fix typo in argument description
s/ArtifactToProduce/AnalysisToRun

The misspelling on the argument description made the --help option very
unhelpful in discovering the proper usage of the tool.
2023-08-23 15:54:29 +02:00
Pietro Fezzardi 72bedb7dfd TypeSystemPrinter: print DynamicFunctions 2023-08-21 12:29:31 +02:00
Pietro Fezzardi 659a461b02 TypeSystemPrinter: fix handling of 0-sized types 2023-08-21 12:11:34 +02:00
Alessandro Di Federico 5b093ae38c Merge branch 'feature/progress-bars' 2023-08-01 14:59:49 +02:00
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