77 Commits

Author SHA1 Message Date
Alessandro Di Federico 934e2a92f5 Make argv non-const char * 2026-04-23 13:40:42 +02:00
Ivan Krysak f0e00d66ab Do not use doxygen for TODOs 2026-02-25 12:47:27 +01:00
Ivan Krysak 16985c37ea Add comments clarifying error-related behavior 2025-10-13 10:26:41 +03:00
Giacomo Vercesi 8c76e7d2ef Cleanup Storage classes
Due to the removal of `S3StorageClient`, simplify the infrastructure
under `/Storage/`:
* Move and rename `LocalStorageClient` to `StorageClient`, de-virtualize
  all of its methods
* Move and rename `LocalWritableFile`, `LocalReadableFile` to
  `WritableFile` and `ReadableFile`, de-vitualize all methods
* Drop the `Std{in,out}StorageClient`, make `FilePath` handle the
  stdin/stdout logic
* Remove `setStorageCredentials` from `PipelineManager`
2025-05-07 16:42:34 +02:00
Giacomo Vercesi a9a0fdc236 ELFImport: fix input file missing
When using revng through `revng daemon` the variable `InputPath` is not
populated, leading to `lddtree` failing silently. Fall back to the input
binary in the resume directory in case the the `InputPath` variable is
empty.
2025-03-14 13:05:39 +01:00
Alessandro Di Federico 9c47c92af2 Target::PathComponents: use SmallVector<1> 2024-10-30 19:30:04 +01:00
Alessandro Di Federico a0c670652c Improve usages of Expected<T> 2024-10-10 14:50:26 +02:00
Alessandro Di Federico c1cbb4e9a0 Initialize pointers to nullptr 2024-09-27 12:07:17 +02:00
Alessandro Di Federico 2cdedc71f4 s/serialize/toString/
We keep serialize for method dealing with streams.
If it returns a `std::string`, let's use `toString`.
2024-09-27 12:07:17 +02:00
Alessandro Di Federico 7b00473859 PDBImporter: rework .pdb search 2024-08-05 17:41:34 +02:00
Giacomo Vercesi 94aa2b51d2 Add Context Global Index 2023-11-03 12:13:58 +01:00
Giacomo Vercesi 04698bb550 Return invalidations when deserializing container
When deserializing a container in the pipeline, return the invalidations
that have been caused by the container changing content.
2023-11-03 12:13:58 +01:00
Giacomo Vercesi 56af9c1f9d Propagate errors from Analysis/Pipes to daemon
Leverage the `rp_error` mechanism to propagate errors from analyses and
pipes to the GraphQL schema.
2023-11-03 12:13:58 +01:00
Giacomo Vercesi 3b0d708a2f Drop custom globals mutator from PipelineC
Remove globals mutator from PipelineC api, as there are analyses present
that allow changing them.
2023-11-03 12:13:58 +01:00
Giacomo Vercesi d6890473f4 PipelineC: add missing null checks 2023-11-03 12:13:57 +01:00
Giacomo Vercesi e2504dd6f2 Implement storage credentials update
Add the functionality to rev.ng's infrastructure to allow to dynamically
update the credentials of the underlying storage provider at runtime.
2023-09-14 17:32:08 +02:00
Giacomo Vercesi 0c5bc8c120 Drop unused functions from PipelineC
Remove all the functions that are no longer needed by `revng.api`.
2023-09-14 15:44:33 +02:00
Giacomo Vercesi f710af9f2f Cleanup revng.daemon graphql API
Drop autogenerated queries from the GraphQL API and switch `revng.api`
to use `PipelineDescriptor`.
2023-09-14 15:44:33 +02:00
Giacomo Vercesi 0b2754c824 pipeline: drop Disk from storage methods
This commit changes the following method names across the codebase:
* `storeToDisk` -> `store`
* `loadFromDisk` -> `load`
This has been done since the storage is no longer bound to the local
storage.
2023-09-06 15:23:43 +02:00
Giacomo Vercesi 93d3a6238d revng: introduce S3 support
Add the capability for all revng tooling to run with an S3-backed
workdir.
2023-09-06 15:23:43 +02:00
Giacomo Vercesi a84ebd0e51 revng.daemon: trim Eventmanager's functionality
Drop most of the functionality provided by EventManager. Add the
functionality that allows saving the working directory after a period of
inactivity.
2023-09-06 15:23:43 +02:00
Giacomo Vercesi e719b3b7e5 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 17:45:36 +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
Ivan Krysak a123ec2c35 Remove clang-format off around concepts
Now that clang-format no longer breaks anything involving a concept or
a requires clause on sight, these are no longer necessary
2023-07-02 13:20:49 +02:00
Ivan Krysak bc98e0079f Formatting: change PenaltyReturnTypeOnItsOwnLine
The new value is 21.
2023-07-02 13:20:49 +02:00
Giacomo Vercesi 31cd2b53f9 rcc: add codespell
Add codespell to the list of checks performed by
revng-check-conventions. This should reduce the amount of typos present
in the revng codebase.
2023-05-11 10:05:32 +02:00
Alessandro Di Federico f68185abc9 Push ParseCommandLineOptions into InitRevng 2023-04-28 14:34:35 +02:00
Giacomo Vercesi a2b7d0e0bf PipelineC: add tracing
Add support for tracing onto the PipelineC. This is done by:
1. Creating wrapper functions for each PipelineC function with the
   script in `scripts/PipelineC_add_tracing.py`. These will call a
   special function called `wrap` which will ultimately call a method
   with a `_` prepended to the name
2. Conversion of all PipelineC methods in `PipelineC.cpp` to `static`
   and their rename with a `_` in front, in order for them to work with
   the wrapper function in (1)
3. Generation of 2 additional include files, one for types and one for
   functions, to be used by users of tracing files in order to have
   introspection.

These steps allow the creation of a trace file with the use of the
`REVNG_C_API_TRACE_PATH` environment variable. The traces can then be
used in conjunction with the `revng trace run` and `revng trace
inspect` commands.
2023-04-20 14:43:13 +02:00
Giacomo Vercesi 19bb38d32b PipelineC: fix UAF on rp_targets_list
The underlying rp_target pointer was not stable, switch to returning a
copy of the target instead.
2023-04-20 14:43:13 +02:00
Giacomo Vercesi 8d89c6a318 PipelineC: rp_initialize: only use argc and argv
Switch from specifying `libraries` and `pipelines` in `rp_initialize`
and `rp_manager_create` to the use of command-line options that are to
be passed via `argc` and `argv` in `rp_initialize`.
2023-04-20 14:43:12 +02:00
Giacomo Vercesi 9a972009d1 PipelineC: size and const-correctness
Fix the return type (often mismatched from uint64_t to int) and the
const-correctness of many functions in PipelineC
2023-04-20 14:43:12 +02:00
Alessandro Di Federico 394111ed40 Add missing includes 2023-04-08 08:42:24 +02:00
Giacomo Vercesi 2e96e09f63 Drop analyze-all
Drop all the uses of analyzeAll and swap its use with the invocation of
the appropriate analysesList
2023-03-22 17:50:02 +01:00
Massimo Fioravanti 312e2e8d53 Add analyses lists
Introduces the possibility of specifiying lists of analyses as way to
give them coherent names.
2023-03-22 17:31:46 +01:00
Giacomo Vercesi c7d13fd176 PipelineC: fix model verification clause
In the previous implementation of Model.verify an llvm::Error was
returned. Some call sites retained the logic associated with it. Fix
these with the correct logic.
Also fix an instance of `verify` that was missing an assert.
2023-03-20 16:20:06 +01:00
Giacomo Vercesi 3b94dfae4b PipelineC: rework rp_error data type
Drop the use of unique_ptr within the rp_error data type and instead use
std::monostate. Also fix the functions to allow the use of `nullptr` as
the error parameter
2023-03-20 16:08:04 +01:00
Giacomo Vercesi 15da250710 api/daemon: fix single analysis handling
* Let GraphQL accept zero or more parameters for analyses
* Handle the general case of analyses using zero or more containers with
  a variable ammount of targets
2023-03-15 10:19:01 +01:00
Giacomo Vercesi 2b4cfafe55 revng.api: Fix file upload/buffer reading
This commit fixes file output `revng.api` in two ways:
* The buffer's size is properly reported in `PipelineC.cpp`
* The function `deserialize_container` in `revng.api.manager` no longer
  appends a `\0` to `content`, while avoiding a redundant copy
2023-02-16 15:11:00 +01:00
Massimo Fioravanti 2521ef434a Rework PipelineC errors
PipelineC errors are now splitted in simple and document errors.
Error lists are gone.
2023-02-09 13:43:09 +01:00
Massimo Fioravanti 4dc2e92782 Introduce DocumentError
`DocumentError`s are the inteded way of propagating errors from the
pipeline to the frontend when a location is required to inform the user
of the error whereabouts.
2023-02-09 13:42:50 +01:00
Giacomo Vercesi 8a780a58aa GraphQL: return binaries in b64
This change fixes the pipeline behavior when producing targets:
* produce and extract now return rp_buffer, which has a start pointer
  and size
* the python api `revng.api` will return on produce/extract either str
  or  bytes depending on the mime type of the container
* the GraphQL api will encode bytes in base64
2023-02-07 16:54:35 +01:00
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
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
Giacomo Vercesi 7526d72492 Kinds: exposed locations produced
Expose the locations that can be found in each kind
2022-11-11 13:43:55 +01:00
Giacomo Vercesi 0b80801b2b TupleTreeDiff: applyDiff uses ErrorList
Change how TupleTreeDiff and Visitor work so they can populate an
ErrorList in case the deserialization/apply of a diff fails.
2022-10-30 09:13:44 +01:00
Giacomo Vercesi a75fc40abe PipelineC: drop rp_manager_create_memory_only
The function was unused, broken and superseded by the other
rp_manager_create with `execution_directory=nullptr`.
2022-10-30 09:13:23 +01:00
Giacomo Vercesi 81d25f9805 PipelineC: expose invalidation logic 2022-10-30 09:13:14 +01:00
Massimo Fioravanti d55aa9b9e6 Pipeline: remove * from targets
Now * is just a pipeline frontend shorthand.
2022-10-20 14:20:12 +02:00
Giacomo Vercesi d7265ff160 PipelineC: allow signal masking
Some users of PipelineC might be interested in preserving
pre-existing signals, this commits adds this functionality.
2022-10-04 14:13:56 +02:00
Giacomo Vercesi 7fda1ef459 PipelineC: drop AbortHook
Handle crashes via signal handlers. Switch python's revng.api from
a normal python function to faulthandler, which works also in the
case of harsher interruptions (e.g. SIGABRT).
2022-10-04 14:13:56 +02:00