590 Commits

Author SHA1 Message Date
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
Alessandro Di Federico 7913bf9e58 Disable LeakSanitizer 2023-01-21 16:46:35 +01:00
Alessandro Di Federico 47fd084c88 revng --verbose: shorten paths only if beneficial 2023-01-21 16:46:35 +01:00
Djordje Todorovic 0d6ffa7504 Introduce revng fetch-debuginfo 2022-12-13 11:25:36 +01:00
Antonio Frighetto b2d24875e6 override-by-name.py: compare to bytes 2022-11-30 15:06:54 +01:00
Alessandro Di Federico 838d9a5992 revng model override-by-name: fix args doc 2022-11-30 15:06:54 +01:00
Massimo Fioravanti 044071435e Fix handling of binaries with no functions
Fix various edge cases when a binary with no functions was analyzed.
2022-11-22 16:19:28 +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 48cd3aad42 revng.cli: init commands_registry once
Only init commands_registry once, this is to avoid commands being
re-registered and allow quicker execution of nested commands.
2022-11-02 11:50:40 +01:00
Giacomo Vercesi 4af389c703 daemon-self-test: fix daemon output
Fix the `fail` function, to properly capture the output of the daemon
process in case of failure.
2022-11-02 11:50:40 +01:00
Giacomo Vercesi 2c4f5d1381 GraphQL: introduce target endpoint 2022-10-30 09:13:34 +01:00
Giacomo Vercesi 81d25f9805 PipelineC: expose invalidation logic 2022-10-30 09:13:14 +01:00
Giacomo Vercesi a6a7a09606 daemon-self-test: fix dumping of daemon output
Fix the `fail` function, to properly capture the output of the daemon
process in case of failure.
2022-10-30 09:12:33 +01:00
Giacomo Vercesi a465e796df revng.api: explicitly declare exports 2022-10-30 09:11:53 +01:00
Giacomo Vercesi e4adbe8134 revng.support: add get_root
Add the get_root function which will return the absolute path of the
root, relatively to the file location in support
2022-10-24 09:58:55 +02:00
Massimo Fioravanti d55aa9b9e6 Pipeline: remove * from targets
Now * is just a pipeline frontend shorthand.
2022-10-20 14:20:12 +02:00
Alessandro Di Federico 5a99154196 Put Python packages into lib/python*/site-packages 2022-10-11 19:08:10 +02:00
Giacomo Vercesi 4271082b3f revng.api: remove dead import 2022-10-11 17:09:18 +02:00
Giacomo Vercesi ff48b9de75 Introduce revng daemon-self-test
This new command will, given an executable, try to produce all
artifacts. By default it will run `revng daemon`, however an external
address can be provided to test remote daemons, e.g. running inside a
container.
2022-10-06 15:12:36 +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
Giacomo Vercesi 159fa8558d revng.api: Count owned pointers and shutdown
rp_shutdown must be called after all the owning pointers given by
PipelineC are freed, in order to guarantee this easily, the python
ApiWrapper will use an atomic counter, which when shutdown has been
signaled and counter reaches zero will automatically call rp_shutdown
2022-10-04 14:13:55 +02:00
Giacomo Vercesi a935cc3073 revng daemon: switch from hypercorn to uvicorn
Hypercorn is experiencing weird behaviour when running tests and
receiving SIGPIPEs when a couple of F5s are issued from the browser.
The switch to uvicorn fixed these issues.
2022-10-04 14:13:55 +02:00
Giacomo Vercesi 4f5e9c5986 revng.daemon.util: Remove dead code 2022-10-04 14:13:55 +02:00
Giacomo Vercesi df68b2c7c0 revng ptml: merge cat and strip
Merge the cat and strip subcommands within `revng ptml`
Refactor codebase so that both color and plaintext output are handled
in a unified manner.
2022-09-29 15:43:17 +02:00
Giacomo Vercesi bf4122ed0a Introduce v2 of revng-check-conventions 2022-09-29 15:21:59 +02:00
Alessandro Di Federico 3307fb4a46 api.Manager: use TemporaryDirectory if no workdir 2022-09-26 18:09:01 +02:00
Alessandro Di Federico f6d5cd24dd Give pretty names to temporary files 2022-09-26 18:09:01 +02:00
Alessandro Di Federico 011c65d8ab merge-dynamic: drop a default argument 2022-09-22 17:43:55 +02:00
Djordje Todorovic 753a50895c Introduce revng model import-idb 2022-09-21 18:39:10 +02:00
Giacomo Vercesi 7c900d45ca revng.daemon: fix for ariadne>=0.16 2022-09-21 14:07:24 +02:00
Giacomo Vercesi 67e970e1e8 Fix revng cli invocation with namespaces
When revng cli was invoked with a bare namespace, e.g. `revng ptml`
it would produce an ugly exception.
Fix this behavior by instead rerunning the command with `--help`
appended.
2022-09-02 03:49:56 +02:00
Giacomo Vercesi 07c2457a16 revng.cli: various improvements
This commit introduces some miscellaneous fixes to revng.cli:

* Remove useless subclasses in pipeline_tools.py;
* Improve type annotations in _commands/ptml and fix a help string;
* Add some extra type annotations for `Command`;
* Remove useless namespaces in `commands_registry` and add help text
  for the ones in use;
2022-09-01 17:45:44 +02:00
Giacomo Vercesi bbbcbd080a revng ptml cat: add C highlighting 2022-09-01 15:49:44 +02:00
Alessandro Di Federico b14b40b1eb revng: do not print failing command 2022-08-31 18:07:47 +02:00
Massimo Fioravanti 6b099c57e8 Pipeline: introduce options for analyses 2022-08-29 14:43:25 +02:00
Alessandro Di Federico 178b58b9d5 ImportBinary: turn into an analysis 2022-08-26 09:50:42 +02:00
Alessandro Di Federico 38d91a793b AddPrimitiveTypes: turn into an analysis 2022-08-26 09:50:42 +02:00
Alessandro Di Federico f00a86d491 manager.py: check manager.produce_targets success 2022-08-26 09:50:42 +02:00
Giacomo Vercesi 2ce7b216e8 GraphQL: drop step name conversion 2022-08-26 09:50:42 +02:00
Giacomo Vercesi f281b5930b revng.daemon: rework schema_generator.py
Rework both classes in schema_generator.py, main changes:
* Drop manager.pipeline_artifact_structure as it was used exclusively
  by SchemaGenerator and is no longer needed
* Rename SchemaGen and BindableGen to SchemaGenerator and
  DynamicBindableGenerator to better express their role, add
  docstrings that explain what they do
* Decouple Artifacts and Analyses discovery, since a step can have
  analyses and no artifacts (and vice-versa)
2022-08-26 09:50:37 +02:00
Massimo Fioravanti 42b623db06 Pipeline: rework CLI organization 2022-08-10 09:49:24 +02:00
Massimo Fioravanti 261a114d6d Pipeline: corner-case fix in backward deduction 2022-08-10 09:49:24 +02:00
Massimo Fioravanti 0bb115a4f3 revng-pipeline: rework syntax for targets
Was: step:container:p/a/t/h:kind
Now: step/container/p/a/t/h:kind
2022-08-10 09:49:24 +02:00
Massimo Fioravanti 4cd5abe2b0 revng-pipeline: introduce --produce and --analyze 2022-08-10 09:49:24 +02:00
Massimo Fioravanti 9c13f8dbdd Introduce revng-artifact 2022-08-10 09:49:24 +02:00
Massimo Fioravanti 96bd5835d8 revng-pipeline: rework file-to-container syntax 2022-08-10 09:49:24 +02:00
Giacomo Vercesi e23d238e85 revng.cli: explicitly initialize Commands
Commands now require a `setup` function, where the will register the
command instance manually
2022-08-10 09:49:24 +02:00
Alessandro Di Federico 45d563bc15 revng: use ld.so --preload instead of LD_PRELOAD 2022-08-08 13:55:25 +02:00
Alessandro Di Federico 82771be9b5 revng-model-dump: emit YAML 2022-08-08 13:55:25 +02:00